Patching of primary containers
This section describes the procedure for patching the following primary containers:
Patching particular pod of primary server
Patching Init containers for all pods of primary server
Patching Sidecar containers for all pods of primary server
Get the environment name using the following command:
kubectl get environments -n <namespace>
Using the following command, check if is present:
kubectl get environment -n <namespace> -o=jsonpath='{$.items[0].spec.primary.serviceImageTag}'
Depending on the output of step 2, perform one of the following steps.
If is present (some content is there in the output) or not present (no content is there in the output). Run the following command by changing the value field (for example,
<version>-patch) to the required image tag:See Table: Primary container keywords and examples for the list of all the primary container keywords and examples.
Depending on the output of step 2, perform one of the following steps.
If is present (some content is there in the output) or not present (no content is there in the output). Run the following command by changing the value field (for example,
<version>-patch) to the required image tag:If is present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/<container keyword>", "value": "<version>-patch"}]'
For example, kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/primary.main", "value": "11.0-patch"}]'
Or
If is not present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/<container keyword>", "value": "<version>-patch"}]'
For example, kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/primary.main", "value": "11.0-patch"}]'
Table: Primary container keywords and examples
Profile name | Main container keyword | Init container keyword | Sidecar container keyword |
|---|---|---|---|
Primary |
For example, |
|
|
Nbatd |
For example, |
For example, |
|
Mqbroker |
For example, |
|
|
Webservice |
For example, |
|
|
Policyjob |
For example, |
|
|
Policyjobmgr |
For example, |
|
|
Requestrouter |
For example, |
| |
Bootstrapper |
For example, |
|
|
Log-viewer |
For example, |
|
Get the environment name using the following command:
kubectl get environments -n <namespace>
Use this when you want to patch a specific Init container for all the profiles (wherever applicable) of the primary server.
:
pod-dependency-initFor example, the pod-dependency-init container patch image:
netbackup/operator:<version>-patchDepending on the output of step 2, perform one of the following steps.
If is present (some content is there in the output) or not present (no content is there in the output). Run the following command by changing the value field (for example,
<version>-patch) to the required image tag:If is present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/<init container keyword>", "value": "<version>-patch"}]'
For example, kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/pod-dependency-init", "value": "11.0-patch"}]'
Or
If is not present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/<init container keyword>", "value": "<version>-patch"}]'
For example. kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/pod-dependency-init", "value": "11.0-patch"}]'
Get the environment name using the following command:
kubectl get environments -n <namespace>
:
Use this when you want to patch a specific Sidecar container for all the profiles (wherever applicable) of the primary server.
Sidecar containers keyword:
fluentbit
pbx
secure-comms
nbhousekeeping
If a specific container is patched with some image (for example,
nbatd.pbx: <version>-patch) and you want to patch that container universally (for example,pbx: <version>-patch1), then you have to first delete the previous entry for that container from the environment.Depending on the output of step 2, perform one of the following steps.
If is present (some content is there in the output) or not present (no content is there in the output). Run the following command by changing the value field (for example,
<version>-patch) to the required image tag:If is present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/<Sidecar containers keyword>", "value": "<version>-patch"}]'
For example, kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag/fluentbit", "value": "11.0-patch"}]'
Or
If is not present:
kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/<Sidecar containers keyword>", "value": "<version>-patch"}]'
For example, kubectl patch environment <env-name> -n <namespace> --type=json --patch '[{"op": "replace", "path": "/spec/primary/serviceImageTag", "value": {}},{"op": "replace", "path": "/spec/primary/serviceImageTag/fluentbit", "value": "11.0-patch"}]'