- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有无效的 kubectl 作业。我正在调试它并将其解压缩到 yaml 文件中,我可以看到:
apiVersion: batch/v1
kind: Job
metadata:
creationTimestamp: 2020-03-19T21:40:11Z
labels:
app: vault-unseal-app
job-name: vault-unseal-vault-unseal-1584654000
name: vault-unseal-vault-unseal-1584654000
namespace: infrastructure
ownerReferences:
- apiVersion: batch/v1beta1
blockOwnerDeletion: true
controller: true
kind: CronJob
name: vault-unseal-vault-unseal
uid: c9965fdb-4fbb-11e9-80d7-061cf1426d5a
resourceVersion: "163413544"
selfLink: /apis/batch/v1/namespaces/infrastructure/jobs/vault-unseal-vault-unseal-1584654000
uid: 35e63c20-6a2a-11ea-b577-069afd6d30d4
spec:
backoffLimit: 0
completions: 1
parallelism: 1
selector:
matchLabels:
app: vault-unseal-app
template:
metadata:
creationTimestamp: null
labels:
app: vault-unseal-app
job-name: vault-unseal-vault-unseal-1584654000
spec:
containers:
- env:
- name: VAULT_ADDR
value: http://vault-vault:8200
- name: VAULT_SKIP_VERIFY
value: "1"
- name: VAULT_TOKEN
valueFrom:
secretKeyRef:
key: vault_token
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_0
valueFrom:
secretKeyRef:
key: unseal_key_0
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_1
valueFrom:
secretKeyRef:
key: unseal_key_1
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_2
valueFrom:
secretKeyRef:
key: unseal_key_2
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_3
valueFrom:
secretKeyRef:
key: unseal_key_3
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_4
valueFrom:
secretKeyRef:
key: unseal_key_4
name: vault-unseal-vault-unseal
image: blockloop/vault-unseal
imagePullPolicy: Always
name: vault-unseal
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
nodeSelector:
nodePool: ci
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 5
status:
conditions:
- lastProbeTime: 2020-03-19T21:49:11Z
lastTransitionTime: 2020-03-19T21:49:11Z
message: Job has reached the specified backoff limit
reason: BackoffLimitExceeded
status: "True"
type: Failed
failed: 1
startTime: 2020-03-19T21:40:11Z
当我跑
kubectl create -f my_file.yaml
,我收到此错误:
The Job "vault-unseal-vault-unseal-1584654000" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"controller-uid":"35262878-07bb-11eb-9b2c-0abca2a23428", "app":"vault-unseal-app"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: `selector` not auto-generated
有人可以建议如何解决这个问题吗?
.spec.selector
我收到错误:
error: jobs.batch "vault-unseal-vault-unseal-1584654000" is invalid
这就是我的配置在没有
.spec.selector
的情况下的样子:
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: batch/v1
kind: Job
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"batch/v1","kind":"Job","metadata":{"annotations":{},"creationTimestamp":"2020-03-19T21:40:11Z","labels":{"controller-uid":"35e63c20-6a2a-11ea-b577-069afd6d30d4","job-name":"vault-unseal-vault-unseal-1584654000"},"name":"vault-unseal-vault-unseal-1584654000","namespace":"infrastructure","ownerReferences":[{"apiVersion":"batch/v1beta1","blockOwnerDeletion":true,"controller":true,"kind":"CronJob","name":"vault-unseal-vault-unseal","uid":"c9965fdb-4fbb-11e9-80d7-061cf1426d5a"}],"resourceVersion":"163427805","selfLink":"/apis/batch/v1/namespaces/infrastructure/jobs/vault-unseal-vault-unseal-1584654000","uid":"35e63c20-6a2a-11ea-b577-069afd6d30d4"},"spec":{"backoffLimit":20,"completions":1,"parallelism":1,"selector":{"matchLabels":{"controller-uid":"35e63c20-6a2a-11ea-b577-069afd6d30d4"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"controller-uid":"35e63c20-6a2a-11ea-b577-069afd6d30d4","job-name":"vault-unseal-vault-unseal-1584654000"}},"spec":{"containers":[{"env":[{"name":"VAULT_ADDR","value":"http://vault-vault:8200"},{"name":"VAULT_SKIP_VERIFY","value":"1"},{"name":"VAULT_TOKEN","valueFrom":{"secretKeyRef":{"key":"vault_token","name":"vault-unseal-vault-unseal"}}},{"name":"VAULT_UNSEAL_KEY_0","valueFrom":{"secretKeyRef":{"key":"unseal_key_0","name":"vault-unseal-vault-unseal"}}},{"name":"VAULT_UNSEAL_KEY_1","valueFrom":{"secretKeyRef":{"key":"unseal_key_1","name":"vault-unseal-vault-unseal"}}},{"name":"VAULT_UNSEAL_KEY_2","valueFrom":{"secretKeyRef":{"key":"unseal_key_2","name":"vault-unseal-vault-unseal"}}},{"name":"VAULT_UNSEAL_KEY_3","valueFrom":{"secretKeyRef":{"key":"unseal_key_3","name":"vault-unseal-vault-unseal"}}},{"name":"VAULT_UNSEAL_KEY_4","valueFrom":{"secretKeyRef":{"key":"unseal_key_4","name":"vault-unseal-vault-unseal"}}}],"image":"blockloop/vault-unseal","imagePullPolicy":"Always","name":"vault-unseal","resources":{},"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File"}],"dnsPolicy":"ClusterFirst","nodeSelector":{"nodePool":"devs"},"restartPolicy":"OnFailure","schedulerName":"default-scheduler","securityContext":{},"terminationGracePeriodSeconds":5}}},"status":{"conditions":[{"lastProbeTime":"2020-03-19T21:49:11Z","lastTransitionTime":"2020-03-19T21:49:11Z","message":"Job has reached the specified backoff limit","reason":"BackoffLimitExceeded","status":"True","type":"Failed"}],"failed":1,"startTime":"2020-03-19T21:40:11Z"}}
creationTimestamp: 2020-03-19T21:40:11Z
labels:
controller-uid: 35e63c20-6a2a-11ea-b577-069afd6d30d4
job-name: vault-unseal-vault-unseal-1584654000
name: vault-unseal-vault-unseal-1584654000
namespace: infrastructure
ownerReferences:
- apiVersion: batch/v1beta1
blockOwnerDeletion: true
controller: true
kind: CronJob
name: vault-unseal-vault-unseal
uid: c9965fdb-4fbb-11e9-80d7-061cf1426d5a
resourceVersion: "163442526"
selfLink: /apis/batch/v1/namespaces/infrastructure/jobs/vault-unseal-vault-unseal-1584654000
uid: 35e63c20-6a2a-11ea-b577-069afd6d30d4
spec:
backoffLimit: 100
completions: 1
parallelism: 1
template:
metadata:
creationTimestamp: null
labels:
controller-uid: 35e63c20-6a2a-11ea-b577-069afd6d30d4
job-name: vault-unseal-vault-unseal-1584654000
spec:
containers:
- env:
- name: VAULT_ADDR
value: http://vault-vault:8200
- name: VAULT_SKIP_VERIFY
value: "1"
- name: VAULT_TOKEN
valueFrom:
secretKeyRef:
key: vault_token
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_0
valueFrom:
secretKeyRef:
key: unseal_key_0
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_1
valueFrom:
secretKeyRef:
key: unseal_key_1
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_2
valueFrom:
secretKeyRef:
key: unseal_key_2
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_3
valueFrom:
secretKeyRef:
key: unseal_key_3
name: vault-unseal-vault-unseal
- name: VAULT_UNSEAL_KEY_4
valueFrom:
secretKeyRef:
key: unseal_key_4
name: vault-unseal-vault-unseal
image: blockloop/vault-unseal
imagePullPolicy: Always
name: vault-unseal
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
nodeSelector:
nodePool: devs
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 5
status:
conditions:
- lastProbeTime: 2020-03-19T21:49:11Z
lastTransitionTime: 2020-03-19T21:49:11Z
message: Job has reached the specified backoff limit
reason: BackoffLimitExceeded
status: "True"
type: Failed
failed: 1
startTime: 2020-03-19T21:40:11Z
最佳答案
看起来您没有使用 selector
默认情况下,系统会自动为您生成。请记住,创建作业时推荐的选项是不要填写 selector
.它更有可能创建重复的标签+选择器。因此,您应该使用自动生成的,以确保唯一性并使您免于手动管理的必要性。
official docs用一个例子更详细地解释这一点。请注意以下部分:
Normally, when you create a Job object, you do not specify
.spec.selector
. The system defaulting logic adds this field when theJob is created. It picks a selector value that will not overlap withany other jobs.
You need to specify
manualSelector: true
in the new Job since youare not using the selector that the system normally generates for youautomatically.
.spec.manualSelector: true
在工作规范中。这样 API 服务器就不会自动生成标签,您可以自己设置它们。
spec.Completions
spec.Selector
和
spec.Template
是不可变字段,不允许更新。为了在那里进行更改,您需要创建一个新作业。
In addition to required fields for a Pod, a pod template in a Job mustspecify appropriate labels (see pod selector) and an appropriaterestart policy.
关于kubernetes - 作业无效 : `selector` not auto-generated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64223630/
我想知道这两者之间有什么不同 .myClass/DomElement .myotherclassinsidethatelement 和 .myClass/DomElement > .myothercl
使用 jQuery on() 版本 1.7。我通常这样绑定(bind)我的事件: $(".foo").on("click", function() { console.log("foo cli
我想找到与选择器匹配的所有元素,但如果它已经包含在匹配元素中则不查找。 $('#container').find('.child').not('.child .child'); 请注意,.child
我有一个看起来像这样的无序列表,但更广泛: Parent Category 2 Parent Category 2 Parent Category 3
这个问题在这里已经有了答案: CSS negation pseudo-class :not() for parent/ancestor elements (2 个答案) 关闭 4 年前。
我希望使用 CSS :not() 来定位 before 选择器。这可能吗? 示例: https://jsfiddle.net/uuq62b8d/ a.button:before { content
这有什么区别: $.each($('#myTable input[name="deleteItem[]"]:checked').do_something()); 还有这个: $('#myTable i
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
我正在使用 UL LI 列表和 jQuery 创建一棵树。我使用了 jQuery 选择器 jQuery(li:has(ul)) 查找所有具有子节点的列表节点,然后向其添加单击事件。 jQuery(li
我真的不知道如何命名这两种方法,所以请原谅我这样调用它们。 字符串选择器 $("#myList li").eq(3); 函数选择器 $("#myList li:eq(3)"); 据我所知,他们都做同样
我有以下代码: .. 我正在使用以下 CSS 来排除具有“main-l tbl”类的表: table:not(.main-l .views-table) { .. } 我注
这个问题已经有答案了: 已关闭12 年前。 Possible Duplicate: What is the difference between $ and jQuery 我注意到使用“jQuery(
我有许多 css 选择器和许多选择器异常,所以我使用 :not 将它们排除在外... 示例(只是一些我不需要的选择器): [class*="-dashboard-"]:not([class$="-bi
CADisplayLink 有这个方法是有道理的,但我很好奇为什么 UIScreen 也会有它。 最佳答案 文档说屏幕提供的显示链接与该屏幕相关联。但是,查看官方文档,与任何屏幕都没有明显的关系;显示
我在这里阅读了关于 toArray() 的文档,并在控制台中对其进行了测试。我找不到在选择器上调用 toArray() 和调用选择器本身之间的区别。 两种方式都得到了完全相同的结果,这是一个与选择器匹
我有一个问题,为什么这两个代码片段不同。 $('#ctl00_DDMenu1_HyperLink1') //jQuery(a#ctl00_DDMenu1_HyperLink1 Default.asp
我想通过以下方式模拟我可以在 jQuery 中实现的目标$('.someClass:not(.hidden)') 我试过下面的代码。 $crawler->filter('someClass:not(.
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我想通过以下方式模拟我可以在 jQuery 中实现的目标$('.someClass:not(.hidden)') 我试过下面的代码。 $crawler->filter('someClass:not(.
我想根据 Iterator::next 中当前枚举变体的某些属性更改枚举变体。我有两次尝试,都没有编译: enum Test { A(Vec), B, } impl Iterator
我是一名优秀的程序员,十分优秀!