【发布时间】:2023-01-13 01:15:36
【问题描述】:
我已经启动并运行了 Kubernetes 部署: (为简洁起见省略了一些字段)
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-server
namespace: argocd
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: argocd-server
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/name: argocd-server
spec:
containers:
- name: argocd-server
image: quay.io/argoproj/argocd:v2.2.5
command:
- argocd-server
我想为现有部署创建一个补丁,以将某些参数添加到容器的 command:
- '--insecure'
- '--basehref'
- /argocd
我阅读了有关 kubectl patch 命令 here 的文档,但我不确定如何实际选择我想要修补的容器(按名称或索引)。
覆盖完整的command:列表(在补丁文件中给出- argocd-server行)会很好,但我想阻止在补丁文件中给出完整的containers:规范。
【问题讨论】:
标签: kubernetes kubectl