Skip to content

Commit 6713768

Browse files
authored
add: specific selector for operator (#390)
Issue #, if available: [#1632](aws-controllers-k8s/community#1632) Description of changes: Improve label selection for service and deployment association with pods. When multiple operators are deployed you may get inconsistent results on the service. Related [s3-controller/pull/94](aws-controllers-k8s/s3-controller#94) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent fd06571 commit 6713768

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

templates/config/controller/deployment.yaml.tpl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
apiVersion: v1
22
kind: Namespace
33
metadata:
4-
labels:
5-
control-plane: controller
64
name: ack-system
75
---
86
apiVersion: apps/v1
@@ -11,16 +9,17 @@ metadata:
119
name: ack-{{ .ServicePackageName }}-controller
1210
namespace: ack-system
1311
labels:
14-
control-plane: controller
12+
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
13+
app.kubernetes.io/part-of: ack-system
1514
spec:
1615
selector:
1716
matchLabels:
18-
control-plane: controller
17+
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
1918
replicas: 1
2019
template:
2120
metadata:
2221
labels:
23-
control-plane: controller
22+
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
2423
spec:
2524
containers:
2625
- command:

templates/config/controller/service.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: ack-system
66
spec:
77
selector:
8-
control-plane: controller
8+
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
99
ports:
1010
- name: metricsport
1111
port: 8080

templates/helm/templates/deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ metadata:
1010
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
1111
k8s-app: {{ include "app.name" . }}
1212
helm.sh/chart: {{ include "chart.name-version" . }}
13-
control-plane: controller
1413
spec:
1514
replicas: 1
1615
selector:

templates/helm/templates/metrics-service.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ metadata:
1111
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
1212
k8s-app: {{ include "app.name" . }}
1313
helm.sh/chart: {{ include "chart.name-version" . }}
14-
control-plane: controller
1514
spec:
1615
selector:
1716
app.kubernetes.io/name: {{ include "app.name" . }}

0 commit comments

Comments
 (0)