From 16e8de1229b98a9ccca3f12305f0327a0ab97159 Mon Sep 17 00:00:00 2001 From: Anthony Treuillier Date: Fri, 13 Sep 2024 09:43:48 +0200 Subject: [PATCH] refactor(helm): chart Helm out-of-date (#18) Signed-off-by: Anthony TREUILLIER --- chart/.helmignore | 23 ----- chart/Chart.yaml | 21 ----- chart/crds/rrset-crd.yaml | 85 ------------------ chart/crds/zone-crd.yaml | 102 ---------------------- chart/templates/_helpers.tpl | 62 ------------- chart/templates/deployment.yaml | 52 ----------- chart/templates/leader-election-rbac.yaml | 53 ----------- chart/templates/manager-rbac.yaml | 74 ---------------- chart/templates/metrics-service.yaml | 14 --- chart/templates/rrset-editor-rbac.yaml | 25 ------ chart/templates/rrset-viewer-rbac.yaml | 21 ----- chart/templates/serviceaccount.yaml | 8 -- chart/templates/zone-editor-rbac.yaml | 25 ------ chart/templates/zone-viewer-rbac.yaml | 21 ----- chart/values.yaml | 33 ------- 15 files changed, 619 deletions(-) delete mode 100644 chart/.helmignore delete mode 100644 chart/Chart.yaml delete mode 100644 chart/crds/rrset-crd.yaml delete mode 100644 chart/crds/zone-crd.yaml delete mode 100644 chart/templates/_helpers.tpl delete mode 100644 chart/templates/deployment.yaml delete mode 100644 chart/templates/leader-election-rbac.yaml delete mode 100644 chart/templates/manager-rbac.yaml delete mode 100644 chart/templates/metrics-service.yaml delete mode 100644 chart/templates/rrset-editor-rbac.yaml delete mode 100644 chart/templates/rrset-viewer-rbac.yaml delete mode 100644 chart/templates/serviceaccount.yaml delete mode 100644 chart/templates/zone-editor-rbac.yaml delete mode 100644 chart/templates/zone-viewer-rbac.yaml delete mode 100644 chart/values.yaml diff --git a/chart/.helmignore b/chart/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/chart/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/chart/Chart.yaml b/chart/Chart.yaml deleted file mode 100644 index 94ba2e4..0000000 --- a/chart/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: v2 -name: powerdns-operator -description: A Helm chart for Kubernetes -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -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.1.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 -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "0.1.0" diff --git a/chart/crds/rrset-crd.yaml b/chart/crds/rrset-crd.yaml deleted file mode 100644 index b48c441..0000000 --- a/chart/crds/rrset-crd.yaml +++ /dev/null @@ -1,85 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: rrsets.dns.cav.enablers.ob -spec: - group: dns.cav.enablers.ob - names: - kind: RRset - listKind: RRsetList - plural: rrsets - singular: rrset - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .spec.zoneIdRef.name - name: Zone - type: string - - jsonPath: .spec.type - name: Type - type: string - - jsonPath: .spec.ttl - name: TTL - type: integer - - jsonPath: .spec.records - name: Records - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: RRset is the Schema for the rrsets API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: RRsetSpec defines the desired state of RRset - properties: - comment: - type: string - records: - items: - type: string - type: array - ttl: - format: int32 - type: integer - type: - type: string - zoneIdRef: - properties: - name: - type: string - required: - - name - type: object - required: - - records - - ttl - - type - - zoneIdRef - type: object - status: - description: RRsetStatus defines the observed state of RRset - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/chart/crds/zone-crd.yaml b/chart/crds/zone-crd.yaml deleted file mode 100644 index 8e50d99..0000000 --- a/chart/crds/zone-crd.yaml +++ /dev/null @@ -1,102 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: zones.dns.cav.enablers.ob -spec: - group: dns.cav.enablers.ob - names: - kind: Zone - listKind: ZoneList - plural: zones - singular: zone - scope: Cluster - versions: - - additionalPrinterColumns: - - jsonPath: .status.serial - name: Serial - type: integer - - jsonPath: .status.id - name: ID - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: Zone is the Schema for the zones API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: ZoneSpec defines the desired state of Zone - properties: - kind: - type: string - nameservers: - items: - type: string - type: array - required: - - kind - - nameservers - type: object - status: - description: ZoneStatus defines the observed state of Zone - properties: - catalog: - type: string - dnssec: - type: boolean - edited_serial: - format: int32 - type: integer - id: - description: |- - INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - Important: Run "make" to regenerate code after modifying this file - type: string - kind: - type: string - masters: - items: - type: string - type: array - name: - type: string - notified_serial: - format: int32 - type: integer - serial: - format: int32 - type: integer - required: - - catalog - - dnssec - - edited_serial - - id - - kind - - masters - - name - - notified_serial - - serial - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl deleted file mode 100644 index 78d2379..0000000 --- a/chart/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "chart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 28 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "chart.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 28 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 28 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 28 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "chart.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "chart.labels" -}} -helm.sh/chart: {{ include "chart.chart" . }} -{{ include "chart.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "chart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "chart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "chart.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "chart.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml deleted file mode 100644 index 5fe15b5..0000000 --- a/chart/templates/deployment.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "chart.fullname" . }}-controller-manager - labels: - control-plane: controller-manager - {{- include "chart.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.controllerManager.replicas }} - selector: - matchLabels: - control-plane: controller-manager - {{- include "chart.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - control-plane: controller-manager - {{- include "chart.selectorLabels" . | nindent 8 }} - annotations: - kubectl.kubernetes.io/default-container: manager - spec: - containers: - - args: {{- toYaml .Values.controllerManager.manager.args | nindent 8 }} - command: - - /manager - env: - - name: KUBERNETES_CLUSTER_DOMAIN - value: {{ quote .Values.kubernetesClusterDomain }} - image: {{ .Values.controllerManager.manager.image.repository }}:{{ .Values.controllerManager.manager.image.tag - | default .Chart.AppVersion }} - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - name: manager - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - resources: {{- toYaml .Values.controllerManager.manager.resources | nindent 10 - }} - securityContext: {{- toYaml .Values.controllerManager.manager.containerSecurityContext - | nindent 10 }} - imagePullSecrets: {{ .Values.imagePullSecrets | default list | toJson }} - securityContext: - runAsNonRoot: true - serviceAccountName: {{ include "chart.fullname" . }}-controller-manager - terminationGracePeriodSeconds: 10 \ No newline at end of file diff --git a/chart/templates/leader-election-rbac.yaml b/chart/templates/leader-election-rbac.yaml deleted file mode 100644 index 822b5fe..0000000 --- a/chart/templates/leader-election-rbac.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: {{ include "chart.fullname" . }}-leader-election-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - patch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ include "chart.fullname" . }}-leader-election-rolebinding - labels: - {{- include "chart.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: '{{ include "chart.fullname" . }}-leader-election-role' -subjects: -- kind: ServiceAccount - name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/manager-rbac.yaml b/chart/templates/manager-rbac.yaml deleted file mode 100644 index 3bbf64a..0000000 --- a/chart/templates/manager-rbac.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "chart.fullname" . }}-manager-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets/finalizers - verbs: - - update -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets/status - verbs: - - get - - patch - - update -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones/finalizers - verbs: - - update -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones/status - verbs: - - get - - patch - - update ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: {{ include "chart.fullname" . }}-manager-rolebinding - labels: - {{- include "chart.labels" . | nindent 4 }} -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: '{{ include "chart.fullname" . }}-manager-role' -subjects: -- kind: ServiceAccount - name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/metrics-service.yaml b/chart/templates/metrics-service.yaml deleted file mode 100644 index 437ea93..0000000 --- a/chart/templates/metrics-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "chart.fullname" . }}-controller-manager-metrics-service - labels: - control-plane: controller-manager - {{- include "chart.labels" . | nindent 4 }} -spec: - type: {{ .Values.metricsService.type }} - selector: - control-plane: controller-manager - {{- include "chart.selectorLabels" . | nindent 4 }} - ports: - {{- .Values.metricsService.ports | toYaml | nindent 2 }} \ No newline at end of file diff --git a/chart/templates/rrset-editor-rbac.yaml b/chart/templates/rrset-editor-rbac.yaml deleted file mode 100644 index 8c0c586..0000000 --- a/chart/templates/rrset-editor-rbac.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "chart.fullname" . }}-rrset-editor-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets/status - verbs: - - get \ No newline at end of file diff --git a/chart/templates/rrset-viewer-rbac.yaml b/chart/templates/rrset-viewer-rbac.yaml deleted file mode 100644 index 22f4ae7..0000000 --- a/chart/templates/rrset-viewer-rbac.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "chart.fullname" . }}-rrset-viewer-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets - verbs: - - get - - list - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - rrsets/status - verbs: - - get \ No newline at end of file diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml deleted file mode 100644 index d94867d..0000000 --- a/chart/templates/serviceaccount.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "chart.fullname" . }}-controller-manager - labels: - {{- include "chart.labels" . | nindent 4 }} - annotations: - {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} \ No newline at end of file diff --git a/chart/templates/zone-editor-rbac.yaml b/chart/templates/zone-editor-rbac.yaml deleted file mode 100644 index df22b58..0000000 --- a/chart/templates/zone-editor-rbac.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "chart.fullname" . }}-zone-editor-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones/status - verbs: - - get \ No newline at end of file diff --git a/chart/templates/zone-viewer-rbac.yaml b/chart/templates/zone-viewer-rbac.yaml deleted file mode 100644 index 8c68625..0000000 --- a/chart/templates/zone-viewer-rbac.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: {{ include "chart.fullname" . }}-zone-viewer-role - labels: - {{- include "chart.labels" . | nindent 4 }} -rules: -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones - verbs: - - get - - list - - watch -- apiGroups: - - dns.cav.enablers.ob - resources: - - zones/status - verbs: - - get \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml deleted file mode 100644 index ef65a7b..0000000 --- a/chart/values.yaml +++ /dev/null @@ -1,33 +0,0 @@ -controllerManager: - manager: - args: - - --leader-elect - - --health-probe-bind-address=:8081 - - --metrics-bind-address=0 - containerSecurityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - image: - repository: controller - tag: latest - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi - replicas: 1 - serviceAccount: - annotations: {} -imagePullSecrets: [] -kubernetesClusterDomain: cluster.local -metricsService: - ports: - - name: http - port: 8080 - protocol: TCP - targetPort: 8080 - type: ClusterIP