- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经仔细阅读过Kubernetes文档,但是在运行在K8作业启动的pod内的应用程序与主机文件系统上的文件交互时仍然遇到问题。即使使用最简单的实用程序也会发生这种情况,因此我提供了一个简化的yaml配置示例。此处引用的本地文件'hello.txt'确实存在于主机上的/tmp中(即,在Kubernetes环境之外),我什至chmod 777也已将其保存。我还在主机文件系统中尝试过/tmp以外的其他位置。
Kubernetes作业启动的Pod以Status = Error终止并生成日志ls: /testing/hello.txt: No such file or directory
因为我最终希望以编程方式将其用作更复杂的工作流程的一部分,所以实际上确实需要将其作为工作而不是部署。我希望那是可能的。我正在使用kubectl启动的仅用于测试的当前配置文件是:
apiVersion: batch/v1
kind: Job
metadata:
name: kio
namespace: kmlflow
spec:
# ttlSecondsAfterFinished: 5
template:
spec:
containers:
- name: kio-ingester
image: busybox
volumeMounts:
- name: test-volume
mountPath: /testing
imagePullPolicy: IfNotPresent
command: ["ls"]
args: ["-l", "/testing/hello.txt"]
volumes:
- name: test-volume
hostPath:
# directory location on host
path: /tmp
# this field is optional
# type: Directory
restartPolicy: Never
backoffLimit: 4
最佳答案
看起来好像在安装卷时,无法访问现有数据。
您将需要使用init容器来预填充卷中的数据。
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: my-app
image: my-app:latest
volumeMounts:
- name: config-data
mountPath: /data
initContainers:
- name: config-data
image: busybox
command: ["echo","-n","{'address':'10.0.1.192:2379/db'}", ">","/data/config"]
volumeMounts:
- name: config-data
mountPath: /data
volumes:
- name: config-data
hostPath: {}
关于kubernetes - 如何允许Kubernetes Job访问主机上的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52930940/
我想做的是分派(dispatch)一个 Job,然后在前一个 Job 完成后继续分派(dispatch)同一个 Job,这样就可以连续循环分派(dispatch) Job。如选项一所示,这以前是与数据
我想知道当一个过程通过一个作业执行时会发生什么,在它完成之前是作业调用该过程的下一次执行的时间。这是我创建的工作: DECLARE X NUMBER; BEGIN SYS.DB
我使用以下代码显示超时为 120 秒的 PowerShell 作业的结果。我想通过合并 Write-Progress(基于完成的作业数)来增强此代码。我尝试使用 this example然而,作为引用
我使用以下代码显示超时为 120 秒的 PowerShell 作业的结果。我想通过合并 Write-Progress(基于完成的作业数)来增强此代码。我尝试使用 this example然而,作为引用
这个关于 ECMAScript 规范(ECMA-262 第 8 版)的问题 这些天,我对作业和作业队列有点困惑。 这里有一些问题。 1:在ECMA-262中,有两种作业队列。一个是 ScriptJob
子进程是作业的一部分,由创建作业的进程启动。父进程尚未设置作业属性以允许脱离作业。需要在 JOB 上设置“JOB_OBJECT_LIMIT_BREAKAWAY_OK”标志以允许子进程脱离作业,但未设置
有没有人有类似于Path's Android Priority Job Queue的iOS作业队列?他们不介意与社区分享?我是 iOS 的新手,所以我不确定平台本身是否提供这样的解决方案。在 Andr
我正在关注 this在 Heroku 上安排我的 Django cron 作业。 程序文件: web: gunicorn tango.wsgi --log-file - clock: python c
UI协同程序指南包含有关如何管理UI协同程序生命周期的section。它说明了我们应该创建一个顶级Job实例,并将复合协程上下文contextJob + UI传递给我们启动的所有协程: launch(
我在 Spark 上创建了一个 Master 和一个 Worker。然后我创建了一个 Spark 流作业并尝试提交它,但在 Master 上它显示了一长串 java 错误 使用此命令启动主控: spa
我必须在 Spring Batch 上设置 jobparemeters,但使用 Spring Boot Batch 则无法轻松做到这一点。 我需要重新运行作业,但如果参数相同,spring-batch
众所周知,Apache Pig 是一种数据流语言。如果我编写了一个 Pig 脚本并且 Pig 决定拆分并运行两个或多个作业来执行手头的任务,那么 Pig 如何存储它从作业 1 传递到作业 2 的数据?
我以为他们指的是 Reducer 但在我的程序中我有 public static class MyMapper extends Mapper 和 public static class MyReduc
我需要创建一个恢复模式。 在我的模式中,我只能在给定的时间窗口内启 Action 业。 如果作业失败,它只会在下一个时间窗口重新启动,完成后我想开始为此窗口提前计划的计划作业。 作业之间的唯一区别是时
使用 play 框架 1.2.4 和 scala。我几乎没有类似的游戏工作 @OnApplicationStart class MyOtherJob extends Job { ... } @Ev
作业通知选项“作业成功时”和“作业完成时”有何区别。从表面上看,我假设“作业完成时”选项包含作业成功和作业失败,而“作业成功时”选项仅包含作业成功运行时。这是正确的吗? 最佳答案 作业成功时作业成功完
我正在尝试创建迁移,但由于以下错误而失败: Error from server (BadRequest): error when creating "kubernetes/migration-job.
Cron Job 和 hybris 中的 Job 有什么区别? 两者的创建/实现之间有什么区别? 最佳答案 下图描述了 Hybris 中 Jobs/Cronjobs 工作原理的完整 View
我正在运行多个作业,并且我希望每个作业都有一个单独的作业存储库(内存中实现)。 请在下面找到我尝试过的 bean 定义。请注意,我尝试指定具有作用域原型(prototype)的 bean。 我收到 j
Quartz 中是否有一种机制可以在启动另一个作业时删除现有作业?我需要暂停其他作业的原因是因为新作业需要所有资源可用,只有当其他作业未运行时才会如此。 这是一个示例: 我有 2 份工作:工作 A 和
我是一名优秀的程序员,十分优秀!