File tree Expand file tree Collapse file tree
infra/feast-operator/config/overlays Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,19 +6,12 @@ namespace: opendatahub
66
77resources :
88 - ../../default
9+ - selector_migration_job.yaml
910
1011
1112patches :
1213 # patch to remove default `system` namespace in ../../manager/manager.yaml
1314 - path : delete-namespace.yaml
14- # Remove app.kubernetes.io/name from the Deployment selector to avoid
15- # immutable spec.selector errors on upgrade. The label remains in the
16- # pod template so the metrics Service selector still targets only
17- # feast-operator pods.
18- - path : remove_selector_label_patch.yaml
19- target :
20- kind : Deployment
21- name : controller-manager
2215
2316configMapGenerator :
2417 - name : feast-operator-parameters
@@ -70,3 +63,13 @@ replacements:
7063 name : controller-manager
7164 fieldPaths :
7265 - spec.template.spec.containers.[name=manager].env.[name=OIDC_ISSUER_URL].value
66+ - source :
67+ kind : ConfigMap
68+ name : feast-operator-parameters
69+ fieldPath : data.RELATED_IMAGE_CRON_JOB
70+ targets :
71+ - select :
72+ kind : Job
73+ name : selector-migration
74+ fieldPaths :
75+ - spec.template.spec.containers.[name=migrate].image
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : selector-migration
5+ namespace : system
6+ labels :
7+ app.kubernetes.io/name : feast-operator
8+ app.kubernetes.io/managed-by : kustomize
9+ spec :
10+ ttlSecondsAfterFinished : 300
11+ backoffLimit : 3
12+ template :
13+ metadata :
14+ labels :
15+ app.kubernetes.io/name : feast-operator
16+ spec :
17+ serviceAccountName : controller-manager
18+ restartPolicy : Never
19+ securityContext :
20+ runAsNonRoot : true
21+ seccompProfile :
22+ type : RuntimeDefault
23+ containers :
24+ - name : migrate
25+ image : origin-cli:latest
26+ securityContext :
27+ allowPrivilegeEscalation : false
28+ capabilities :
29+ drop :
30+ - ALL
31+ resources :
32+ requests :
33+ memory : " 64Mi"
34+ cpu : " 100m"
35+ limits :
36+ memory : " 128Mi"
37+ cpu : " 200m"
38+ command :
39+ - /bin/sh
40+ - -c
41+ - |
42+ set -e
43+ DEPLOY="feast-operator-controller-manager"
44+ NS="$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)"
45+
46+ HAS_LABEL=$(oc get deployment "$DEPLOY" -n "$NS" \
47+ -o jsonpath='{.spec.selector.matchLabels.app\.kubernetes\.io/name}' 2>/dev/null || true)
48+
49+ if [ -z "$HAS_LABEL" ]; then
50+ echo "Deployment $DEPLOY has old or missing selector."
51+ echo "Deleting so it can be recreated with the correct selector..."
52+ oc delete deployment "$DEPLOY" -n "$NS" --ignore-not-found=true
53+ echo "Done. The operator will recreate the Deployment."
54+ else
55+ echo "Deployment selector is already correct, no migration needed."
56+ fi
Original file line number Diff line number Diff line change @@ -6,19 +6,12 @@ namespace: redhat-ods-applications
66
77resources :
88 - ../../default
9+ - selector_migration_job.yaml
910
1011
1112patches :
1213 # patch to remove default `system` namespace in ../../manager/manager.yaml
1314 - path : delete-namespace.yaml
14- # Remove app.kubernetes.io/name from the Deployment selector to avoid
15- # immutable spec.selector errors on upgrade. The label remains in the
16- # pod template so the metrics Service selector still targets only
17- # feast-operator pods.
18- - path : remove_selector_label_patch.yaml
19- target :
20- kind : Deployment
21- name : controller-manager
2215
2316configMapGenerator :
2417 - name : feast-operator-parameters
@@ -70,3 +63,13 @@ replacements:
7063 name : controller-manager
7164 fieldPaths :
7265 - spec.template.spec.containers.[name=manager].env.[name=OIDC_ISSUER_URL].value
66+ - source :
67+ kind : ConfigMap
68+ name : feast-operator-parameters
69+ fieldPath : data.RELATED_IMAGE_CRON_JOB
70+ targets :
71+ - select :
72+ kind : Job
73+ name : selector-migration
74+ fieldPaths :
75+ - spec.template.spec.containers.[name=migrate].image
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : Job
3+ metadata :
4+ name : selector-migration
5+ namespace : system
6+ labels :
7+ app.kubernetes.io/name : feast-operator
8+ app.kubernetes.io/managed-by : kustomize
9+ spec :
10+ ttlSecondsAfterFinished : 300
11+ backoffLimit : 3
12+ template :
13+ metadata :
14+ labels :
15+ app.kubernetes.io/name : feast-operator
16+ spec :
17+ serviceAccountName : controller-manager
18+ restartPolicy : Never
19+ securityContext :
20+ runAsNonRoot : true
21+ seccompProfile :
22+ type : RuntimeDefault
23+ containers :
24+ - name : migrate
25+ image : origin-cli:latest
26+ securityContext :
27+ allowPrivilegeEscalation : false
28+ capabilities :
29+ drop :
30+ - ALL
31+ resources :
32+ requests :
33+ memory : " 64Mi"
34+ cpu : " 100m"
35+ limits :
36+ memory : " 128Mi"
37+ cpu : " 200m"
38+ command :
39+ - /bin/sh
40+ - -c
41+ - |
42+ set -e
43+ DEPLOY="feast-operator-controller-manager"
44+ NS="$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)"
45+
46+ HAS_LABEL=$(oc get deployment "$DEPLOY" -n "$NS" \
47+ -o jsonpath='{.spec.selector.matchLabels.app\.kubernetes\.io/name}' 2>/dev/null || true)
48+
49+ if [ -z "$HAS_LABEL" ]; then
50+ echo "Deployment $DEPLOY has old or missing selector."
51+ echo "Deleting so it can be recreated with the correct selector..."
52+ oc delete deployment "$DEPLOY" -n "$NS" --ignore-not-found=true
53+ echo "Done. The operator will recreate the Deployment."
54+ else
55+ echo "Deployment selector is already correct, no migration needed."
56+ fi
You can’t perform that action at this time.
0 commit comments