This is part of my deployment:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- env:
- name: CPUS
value: "1"
This is part of my OverridePolicy:
apiVersion: policy.karmada.io/v1alpha1
kind: OverridePolicy
spec:
overrideRules:
- targetCluster:
clusterNames:
- sharb-x
overriders:
plaintext:
- path: /spec/template/spec/containers/0/env
operator: add
value:
- name: TEST
value: captain-test
I wish my cluster sharb-x deployment may be:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- env:
- name: CPUS
value: "1"
- name: TEST
value: captain-test
But actual is:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- env:
- name: TEST
value: captain-test
CPUS env is missing.
So how can I add or replace container env in OverridePolicy and keep other envs alive?
Thanks!
Environment:
- Karmada version: v1.4.1-with-lua
- Kubernetes version: 1.19
- Others:
This is part of my deployment:
This is part of my OverridePolicy:
I wish my cluster sharb-x deployment may be:
But actual is:
CPUSenv is missing.So how can I add or replace container env in OverridePolicy and keep other envs alive?
Thanks!
Environment: