我有部署,我想替换“路径”值在活性探测部分。什么是正确的道路,这在库斯托梅斯?
- patch: |-
- op: replace
path: ??????????
value:
https://xyz.staging.something.eu/ping apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-http
spec:
containers:
- name: liveness
image: k8s.gcr.io/liveness
args:
- /server
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 3
periodSeconds: 3发布于 2022-05-05 15:47:28
我正在尝试语法containers[name=xx]及其在containers/0工作时的失败。我不知道我是否遗漏了什么或者这是不被支持的,找不到更多关于这个语法的例子。
详情如下:
使用kustomize版本进行检查:
test.yaml:
---
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: test-container
env:
- name: environment
value: stage
- name: api_port
value: "8080"
image: docker.io/bitname/posgresql:latest
...
...kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
...
...
patchesJson6902:
- target:
version: v1
kind: Pod
name: test-pod
path: replace.yamlreplace.yaml
- op: replace
path: "/spec/containers[name=test-container]/env/0/value"
value: "dev"
# doesn't work: `Error: replace operation does not apply: doc is missing path" /spec/containers[name=test-container]/env/0/value: missing value
- op: replace
path: "/spec/containers/0/env/0/value"
value: "dev"
# works as expected谢谢!
https://stackoverflow.com/questions/70533680
复制相似问题