Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt ASO-specific label to replace default control-plane: controller-manager #4465

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/add-openshift-cert-handling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
protocol: TCP
targetPort: 9443
selector:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
sessionAffinity: None
type: ClusterIP
EOF
35 changes: 35 additions & 0 deletions v2/charts/azure-service-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "azure-service-operator.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "azure-service-operator.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "azure-service-operator.labels" -}}
helm.sh/chart: {{ include "azure-service-operator.chart" . }}
{{ include "azure-service-operator.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "azure-service-operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "azure-service-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}


{{/*
Create the name of the service account to use
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: v2.11.0
control-plane: controller-manager
{{- include "azure-service-operator.labels" . | nindent 4 }}
name: azureserviceoperator-controller-manager
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
control-plane: controller-manager
{{- include "azure-service-operator.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
Expand All @@ -28,12 +26,7 @@ spec:
{{- if .Values.aadPodIdentity.enable }}
aadpodidbinding: aso-manager-binding
{{- end }}
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: v2.11.0
control-plane: controller-manager
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "azure-service-operator.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
- {}
podSelector:
matchLabels:
control-plane: controller-manager
{{- include "azure-service-operator.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
---
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
cidr: {{ .Values.networkPolicies.sqlCIDR }}
podSelector:
matchLabels:
control-plane: controller-manager
{{- include "azure-service-operator.selectorLabels" . | nindent 6 }}
policyTypes:
- Egress
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: v2.11.0
control-plane: controller-manager
{{- include "azure-service-operator.labels" . | nindent 4 }}
name: azureserviceoperator-controller-manager-metrics-service
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: metrics
port: 8443
selector:
control-plane: controller-manager
{{- include "azure-service-operator.selectorLabels" . | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: v2.11.0
{{- include "azure-service-operator.labels" . | nindent 4 }}
name: azureserviceoperator-webhook-service
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 443
targetPort: {{ .Values.webhook.port }}
selector:
control-plane: controller-manager
{{- include "azure-service-operator.selectorLabels" . | nindent 6 }}
{{- end }}
6 changes: 1 addition & 5 deletions v2/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,17 @@ metadata:
name: controller-manager
namespace: system
labels:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: ${VERSION}
spec:
selector:
matchLabels:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
replicas: 1
revisionHistoryLimit: 10
template:
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: ${VERSION}
annotations:
kubectl.kubernetes.io/default-container: manager
spec:
Expand Down
4 changes: 1 addition & 3 deletions v2/config/manager/manager_metrics_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: ${VERSION}
name: controller-manager-metrics-service
namespace: system
spec:
ports:
- name: metrics
port: 8443
selector:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator
3 changes: 1 addition & 2 deletions v2/config/webhook/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ metadata:
namespace: system
labels:
app.kubernetes.io/name: azure-service-operator
app.kubernetes.io/version: ${VERSION}
spec:
ports:
- port: 443
targetPort: 9443
selector:
control-plane: controller-manager
app.kubernetes.io/name: azure-service-operator