diff --git a/helm-charts/Chart.yaml b/helm-charts/Chart.yaml index ba99ac2..4b59447 100644 --- a/helm-charts/Chart.yaml +++ b/helm-charts/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.0 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm-charts/index.yaml b/helm-charts/index.yaml index 57b204a..678365c 100644 --- a/helm-charts/index.yaml +++ b/helm-charts/index.yaml @@ -3,12 +3,12 @@ entries: pulp-operator: - apiVersion: v2 appVersion: 1.1.0 - created: "2025-10-06T16:43:58.370246643-03:00" + created: "2025-11-17T17:22:57.554355509+01:00" description: A Helm chart to install pulp-operator - digest: f99394c966f05f6055d3071d8a85b7d7858d86bf8cb53fb93f76ce333649f40e + digest: 565842bb27b0d73550b716fdbc42f4b90e7380e983f0f048d48507357c892be9 name: pulp-operator type: application urls: - - https://github.com/pulp/pulp-k8s-resources/releases/download/1.1.0/pulp-operator-0.4.0.tgz - version: 0.4.0 -generated: "2025-10-06T16:43:58.365471552-03:00" + - pulp-operator-0.5.0.tgz + version: 0.5.0 +generated: "2025-11-17T17:22:57.552230729+01:00" diff --git a/helm-charts/pulp-operator-0.5.0.tgz b/helm-charts/pulp-operator-0.5.0.tgz new file mode 100644 index 0000000..f6bffe9 Binary files /dev/null and b/helm-charts/pulp-operator-0.5.0.tgz differ diff --git a/helm-charts/templates/_helpers.tpl b/helm-charts/templates/_helpers.tpl index 2d11330..4bad4d8 100644 --- a/helm-charts/templates/_helpers.tpl +++ b/helm-charts/templates/_helpers.tpl @@ -15,3 +15,37 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{- end -}} {{- end -}} + +{{/* +Expand the name of the chart. +*/}} +{{- define "pulp-operator.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "pulp-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "pulp-operator.labels" -}} +helm.sh/chart: {{ include "pulp-operator.chart" . }} +{{ include "pulp-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "pulp-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pulp-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/helm-charts/templates/configmaps.yaml b/helm-charts/templates/configmaps.yaml index a18836b..c1286b8 100644 --- a/helm-charts/templates/configmaps.yaml +++ b/helm-charts/templates/configmaps.yaml @@ -4,6 +4,12 @@ kind: ConfigMap metadata: name: {{ include "pulp-operator.fullname" . }}-manager-config namespace: {{ .Values.operatorNamespace | default .Values.namespace }} + labels: + app: pulp-operator + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + {{- include "pulp-operator.labels" . | nindent 4 }} data: controller_manager_config.yaml: | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 diff --git a/helm-charts/templates/deployments.yaml b/helm-charts/templates/deployments.yaml index c434bc4..4729893 100644 --- a/helm-charts/templates/deployments.yaml +++ b/helm-charts/templates/deployments.yaml @@ -3,10 +3,13 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app.kubernetes.io/component: operator - app.kubernetes.io/name: {{ .Chart.Name }} + app: {{ template "pulp-operator.fullname" . }} control-plane: controller-manager + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" owner: pulp-dev + app.kubernetes.io/component: operator + app.kubernetes.io/name: {{ .Chart.Name }} + {{- include "pulp-operator.labels" . | nindent 4 }} name: {{ include "pulp-operator.fullname" . }}-controller-manager namespace: {{ .Values.operatorNamespace | default .Values.namespace }} spec: @@ -20,6 +23,9 @@ spec: metadata: annotations: kubectl.kubernetes.io/default-container: manager + {{- if .Values.operator.annotations }} + {{ toYaml .Values.operator.annotations | indent 8 }} + {{- end }} labels: app.kubernetes.io/component: operator app.kubernetes.io/name: {{ .Chart.Name }} diff --git a/helm-charts/templates/serviceaccounts.yaml b/helm-charts/templates/serviceaccounts.yaml index 62c65f9..88b821b 100644 --- a/helm-charts/templates/serviceaccounts.yaml +++ b/helm-charts/templates/serviceaccounts.yaml @@ -4,3 +4,15 @@ kind: ServiceAccount metadata: name: {{ include "pulp-operator.fullname" . }}-controller-manager namespace: {{ .Values.operatorNamespace | default .Values.namespace }} + labels: + app: {{ template "pulp-operator.fullname" . }} + control-plane: controller-manager + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + owner: pulp-dev + app.kubernetes.io/component: operator + app.kubernetes.io/name: {{ .Chart.Name }} + owner: pulp-dev + {{- include "pulp-operator.labels" . | nindent 4 }} +{{- if .Values.serviceAccount.annotations }} + annotations: {{ toYaml .Values.serviceAccount.annotations | nindent 4 }} +{{- end }} diff --git a/helm-charts/templates/services.yaml b/helm-charts/templates/services.yaml index 5fce977..6137f3a 100644 --- a/helm-charts/templates/services.yaml +++ b/helm-charts/templates/services.yaml @@ -3,7 +3,13 @@ apiVersion: v1 kind: Service metadata: labels: + app: {{ template "pulp-operator.fullname" . }} control-plane: controller-manager + chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + app.kubernetes.io/name: {{ .Chart.Name }} + {{- include "pulp-operator.labels" . | nindent 4 }} name: {{ include "pulp-operator.fullname" . }}-controller-manager-metrics-service namespace: {{ .Values.operatorNamespace | default .Values.namespace }} spec: @@ -13,4 +19,5 @@ spec: protocol: TCP targetPort: https selector: + app: {{ template "pulp-operator.fullname" . }} control-plane: controller-manager diff --git a/helm-charts/values.yaml b/helm-charts/values.yaml index 1961294..9abe4d2 100644 --- a/helm-charts/values.yaml +++ b/helm-charts/values.yaml @@ -20,6 +20,9 @@ nodeSelector: {} affinity: {} tolerations: {} +serviceAccount: + annotations: {} + operator: securityContext: allowPrivilegeEscalation: false