Skip to content

Commit 713a0f1

Browse files
authored
Update kustomize/install to bring in line with postgres-operator repo (CrunchyData#101)
Tested with kubectl 18, 20, 21 Issue [sc-14049]
1 parent de6ed6b commit 713a0f1

19 files changed

+70
-19
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
namespace: postgres-operator
2+
3+
commonLabels:
4+
postgres-operator.crunchydata.com/control-plane: postgres-operator
5+
app.kubernetes.io/name: pgo
6+
app.kubernetes.io/version: 5.1.0
7+
8+
bases:
9+
- ../crd
10+
- ../rbac/cluster
11+
- ../manager
12+
13+
images:
14+
- name: postgres-operator
15+
newName: registry.developers.crunchydata.com/crunchydata/postgres-operator
16+
newTag: ubi8-5.1.0-0
17+
18+
patchesJson6902:
19+
- target:
20+
group: apps
21+
version: v1
22+
kind: Deployment
23+
name: pgo
24+
path: manager-selector.yaml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# We add the version as a common label and change it with each release -- see
2+
# kustomize/install/default/kustomization.yaml#commonLabels --
3+
# but we want to remove those labels from the selector so that we are not
4+
# adding/changing selector labels through this.
5+
# See: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/commonlabels/
6+
- op: remove
7+
path: /spec/selector/matchLabels/app.kubernetes.io~1name
8+
9+
- op: remove
10+
path: /spec/selector/matchLabels/app.kubernetes.io~1version

kustomize/install/bases/manager/manager.yaml renamed to kustomize/install/manager/manager.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ spec:
3434
value: "registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.16-2"
3535
- name: RELATED_IMAGE_PGEXPORTER
3636
value: "registry.developers.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-5.1.0-0"
37-
- name: RELATED_IMAGE_PGUPGRADE
38-
value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.1.0-0"
3937
securityContext:
4038
allowPrivilegeEscalation: false
4139
readOnlyRootFilesystem: true
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
resources:
22
- namespace.yaml
3-
4-
bases:
5-
- bases
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
namespace: postgres-operator
22

33
commonLabels:
4+
postgres-operator.crunchydata.com/control-plane: postgres-operator
45
app.kubernetes.io/name: pgo
56
app.kubernetes.io/version: 5.1.0
6-
postgres-operator.crunchydata.com/control-plane: postgres-operator
77

88
bases:
9-
- crd
10-
- rbac/cluster
11-
- manager
9+
- ../crd
10+
- ../rbac/namespace
11+
- ../manager
12+
13+
patches:
14+
- manager-target.yaml
1215

1316
images:
1417
- name: postgres-operator
1518
newName: registry.developers.crunchydata.com/crunchydata/postgres-operator
1619
newTag: ubi8-5.1.0-0
1720

1821
patchesJson6902:
19-
- target:
20-
group: apps
21-
version: v1
22-
kind: Deployment
23-
name: pgo
24-
patch: |-
25-
- op: remove
26-
path: /spec/selector/matchLabels/app.kubernetes.io~1name
27-
- op: remove
28-
path: /spec/selector/matchLabels/app.kubernetes.io~1version
22+
- target:
23+
group: apps
24+
version: v1
25+
kind: Deployment
26+
name: pgo
27+
path: manager-selector.yaml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# We add the version as a common label and change it with each release -- see
2+
# kustomize/install/default/kustomization.yaml#commonLabels --
3+
# but we want to remove those labels from the selector so that we are not
4+
# adding/changing selector labels through this.
5+
# See: https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/commonlabels/
6+
- op: remove
7+
path: /spec/selector/matchLabels/app.kubernetes.io~1name
8+
9+
- op: remove
10+
path: /spec/selector/matchLabels/app.kubernetes.io~1version
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: pgo
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: operator
11+
env:
12+
- name: PGO_TARGET_NAMESPACE
13+
valueFrom: { fieldRef: { apiVersion: v1, fieldPath: metadata.namespace } }

0 commit comments

Comments
 (0)