Skip to content

Commit

Permalink
add: specific selector for operator (#390)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
codekow authored Jan 27, 2023
1 parent fd06571 commit 6713768
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions templates/config/controller/deployment.yaml.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller
name: ack-system
---
apiVersion: apps/v1
Expand All @@ -11,16 +9,17 @@ metadata:
name: ack-{{ .ServicePackageName }}-controller
namespace: ack-system
labels:
control-plane: controller
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
app.kubernetes.io/part-of: ack-system
spec:
selector:
matchLabels:
control-plane: controller
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
replicas: 1
template:
metadata:
labels:
control-plane: controller
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
spec:
containers:
- command:
Expand Down
2 changes: 1 addition & 1 deletion templates/config/controller/service.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: ack-system
spec:
selector:
control-plane: controller
app.kubernetes.io/name: ack-{{ .ServicePackageName }}-controller
ports:
- name: metricsport
port: 8080
Expand Down
1 change: 0 additions & 1 deletion templates/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ metadata:
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
k8s-app: {{ include "app.name" . }}
helm.sh/chart: {{ include "chart.name-version" . }}
control-plane: controller
spec:
replicas: 1
selector:
Expand Down
1 change: 0 additions & 1 deletion templates/helm/templates/metrics-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ metadata:
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
k8s-app: {{ include "app.name" . }}
helm.sh/chart: {{ include "chart.name-version" . }}
control-plane: controller
spec:
selector:
app.kubernetes.io/name: {{ include "app.name" . }}
Expand Down

0 comments on commit 6713768

Please sign in to comment.