diff --git a/charts/ccm-hetzner-test/.helmignore b/charts/ccm-hcloud-test/.helmignore similarity index 100% rename from charts/ccm-hetzner-test/.helmignore rename to charts/ccm-hcloud-test/.helmignore diff --git a/charts/ccm-hetzner-test/Chart.yaml b/charts/ccm-hcloud-test/Chart.yaml similarity index 70% rename from charts/ccm-hetzner-test/Chart.yaml rename to charts/ccm-hcloud-test/Chart.yaml index 4903079..558c86f 100644 --- a/charts/ccm-hetzner-test/Chart.yaml +++ b/charts/ccm-hcloud-test/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -name: ccm-hetzner-test +name: ccm-hcloud-test description: Helm Chart for Hcloud Cloud Controller Manager type: application -home: https://github.com/syself/charts/tree/main/charts/ccm-hetzner-test +home: https://github.com/syself/charts/tree/main/charts/ccm-hcloud-test maintainers: - name: Syself email: info@syself.com diff --git a/charts/ccm-hetzner-test/templates/_helpers.tpl b/charts/ccm-hcloud-test/templates/_helpers.tpl similarity index 72% rename from charts/ccm-hetzner-test/templates/_helpers.tpl rename to charts/ccm-hcloud-test/templates/_helpers.tpl index 0e52db0..6d07b13 100644 --- a/charts/ccm-hetzner-test/templates/_helpers.tpl +++ b/charts/ccm-hcloud-test/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "ccm-hetzner-test.name" -}} +{{- define "ccm-hcloud-test.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 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 "ccm-hetzner-test.fullname" -}} +{{- define "ccm-hcloud-test.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,17 +26,17 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "ccm-hetzner-test.chart" -}} +{{- define "ccm-hcloud-test.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "ccm-hetzner-test.labels" -}} -helm.sh/chart: {{ include "ccm-hetzner-test.chart" . }} +{{- define "ccm-hcloud-test.labels" -}} +helm.sh/chart: {{ include "ccm-hcloud-test.chart" . }} app: ccm -{{ include "ccm-hetzner-test.selectorLabels" . }} +{{ include "ccm-hcloud-test.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -46,17 +46,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "ccm-hetzner-test.selectorLabels" -}} -app.kubernetes.io/name: {{ include "ccm-hetzner-test.name" . }} +{{- define "ccm-hcloud-test.selectorLabels" -}} +app.kubernetes.io/name: {{ include "ccm-hcloud-test.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "ccm-hetzner-test.serviceAccountName" -}} +{{- define "ccm-hcloud-test.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "ccm-hetzner-test.fullname" .) .Values.serviceAccount.name }} +{{- default (include "ccm-hcloud-test.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/ccm-hetzner-test/templates/deployment.yaml b/charts/ccm-hcloud-test/templates/deployment.yaml similarity index 70% rename from charts/ccm-hetzner-test/templates/deployment.yaml rename to charts/ccm-hcloud-test/templates/deployment.yaml index fd14135..d379fd6 100644 --- a/charts/ccm-hetzner-test/templates/deployment.yaml +++ b/charts/ccm-hcloud-test/templates/deployment.yaml @@ -1,16 +1,16 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "ccm-hetzner-test.fullname" . }} + name: {{ include "ccm-hcloud-test.fullname" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "ccm-hetzner-test.labels" . | nindent 4 }} + {{- include "ccm-hcloud-test.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} revisionHistoryLimit: 5 selector: matchLabels: - {{- include "ccm-hetzner-test.selectorLabels" . | nindent 6 }} + {{- include "ccm-hcloud-test.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -18,14 +18,14 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "ccm-hetzner-test.selectorLabels" . | nindent 8 }} + {{- include "ccm-hcloud-test.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} dnsPolicy: Default - serviceAccountName: {{ include "ccm-hetzner-test.serviceAccountName" . }} + serviceAccountName: {{ include "ccm-hcloud-test.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} tolerations: @@ -58,7 +58,7 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: - - "/bin/hetzner-cloud-controller-manager" + - "/bin/hcloud-cloud-controller-manager" - "--cloud-provider=hcloud" - "--leader-elect={{ .Values.env.leaderElect }}" - "--allow-untagged-cloud" @@ -77,29 +77,11 @@ spec: valueFrom: secretKeyRef: {{- if .Values.secret.create }} - name: {{ include "ccm-hetzner-test.fullname" . }} + name: {{ include "ccm-hcloud-test.fullname" . }} {{- else }} name: {{ .Values.secret.name }} {{- end }} - key: {{ .Values.secret.key.token }} - - name: ROBOT_USER_NAME - valueFrom: - secretKeyRef: - {{- if .Values.secret.create }} - name: {{ include "ccm-hetzner-test.fullname" . }} - {{- else }} - name: {{ .Values.secret.name }} - {{- end }} - key: {{ .Values.secret.key.robotUserName }} - - name: ROBOT_PASSWORD - valueFrom: - secretKeyRef: - {{- if .Values.secret.create }} - name: {{ include "ccm-hetzner-test.fullname" . }} - {{- else }} - name: {{ .Values.secret.name }} - {{- end }} - key: {{ .Values.secret.key.robotPassword }} + key: {{ .Values.secret.tokenKeyName }} - name: HCLOUD_DEBUG value: "{{ .Values.env.debug }}" - name: HCLOUD_LOAD_BALANCERS_ENABLED @@ -109,11 +91,11 @@ spec: valueFrom: secretKeyRef: {{- if .Values.secret.create }} - name: {{ include "ccm-hetzner-test.fullname" . }} + name: {{ include "ccm-hcloud-test.fullname" . }} {{- else }} name: {{ .Values.secret.name }} {{- end }} - key: {{ .Values.secret.key.network }} + key: {{ .Values.secret.networkKeyName }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/ccm-hetzner-test/templates/pdb.yaml b/charts/ccm-hcloud-test/templates/pdb.yaml similarity index 68% rename from charts/ccm-hetzner-test/templates/pdb.yaml rename to charts/ccm-hcloud-test/templates/pdb.yaml index 17500b2..8f8e45c 100644 --- a/charts/ccm-hetzner-test/templates/pdb.yaml +++ b/charts/ccm-hcloud-test/templates/pdb.yaml @@ -2,12 +2,12 @@ apiVersion: policy/v1 kind: PodDisruptionBudget metadata: - name: {{ include "ccm-hetzner-test.fullname" . }} + name: {{ include "ccm-hcloud-test.fullname" . }} namespace: {{ .Release.Namespace }} spec: minAvailable: {{ .Values.pdb.minAvailable }} maxUnavailable: {{ .Values.pdb.maxUnavailable }} selector: matchLabels: - {{- include "ccm-hetzner-test.selectorLabels" . | nindent 6 }} + {{- include "ccm-hcloud-test.selectorLabels" . | nindent 6 }} {{- end }} \ No newline at end of file diff --git a/charts/ccm-hcloud-test/templates/secret.yaml b/charts/ccm-hcloud-test/templates/secret.yaml new file mode 100644 index 0000000..e4036db --- /dev/null +++ b/charts/ccm-hcloud-test/templates/secret.yaml @@ -0,0 +1,14 @@ +{{- if .Values.secret.create -}} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "ccm-hcloud-test.fullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "ccm-hcloud-test.labels" . | nindent 4 }} +stringData: + {{ .Values.secret.tokenKeyName }}: {{ .Values.env.hcloudApiToken | b64enc }} +{{- if .Values.privateNetwork.enabled }} + {{ .Values.secret.networkKeyName }}: {{ .Values.privateNetwork.network.id | b64enc }} +{{- end -}} +{{- end -}} diff --git a/charts/ccm-hetzner-test/templates/serviceaccount.yaml b/charts/ccm-hcloud-test/templates/serviceaccount.yaml similarity index 64% rename from charts/ccm-hetzner-test/templates/serviceaccount.yaml rename to charts/ccm-hcloud-test/templates/serviceaccount.yaml index cc51c61..9cfe799 100644 --- a/charts/ccm-hetzner-test/templates/serviceaccount.yaml +++ b/charts/ccm-hcloud-test/templates/serviceaccount.yaml @@ -2,10 +2,10 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "ccm-hetzner-test.serviceAccountName" . }} + name: {{ include "ccm-hcloud-test.serviceAccountName" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "ccm-hetzner-test.labels" . | nindent 4 }} + {{- include "ccm-hcloud-test.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -14,16 +14,16 @@ metadata: kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: {{ include "ccm-hetzner-test.serviceAccountName" . }} + name: {{ include "ccm-hcloud-test.serviceAccountName" . }} namespace: {{ .Release.Namespace }} labels: - {{- include "ccm-hetzner-test.labels" . | nindent 4 }} + {{- include "ccm-hcloud-test.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount - name: {{ include "ccm-hetzner-test.serviceAccountName" . }} + name: {{ include "ccm-hcloud-test.serviceAccountName" . }} namespace: {{ .Release.Namespace }} {{- end }} \ No newline at end of file diff --git a/charts/ccm-hetzner-test/values.yaml b/charts/ccm-hcloud-test/values.yaml similarity index 69% rename from charts/ccm-hetzner-test/values.yaml rename to charts/ccm-hcloud-test/values.yaml index 598ee53..721c658 100644 --- a/charts/ccm-hetzner-test/values.yaml +++ b/charts/ccm-hcloud-test/values.yaml @@ -1,14 +1,14 @@ -# Default values for ccm-hetzner-test. +# Default values for ccm-hcloud-test. # This is a YAML-formatted file. # Declare variables to be passed into your templates. replicaCount: 1 image: - repository: ghcr.io/syself/hetzner-cloud-controller-manager + repository: docker.io/hetznercloud/hcloud-cloud-controller-manager pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "" + tag: "v0.14.0-beta.3" imagePullSecrets: [] nameOverride: "" @@ -19,8 +19,6 @@ env: loadBalancers: true leaderElect: true hcloudApiToken: # HCloud API Token, fill this only if you don't have a secret already with the token. And set secret.create=true - robotUser: # Robot User, fill this only if you don't have a secret already with the token. And set secret.create=true - robotPassword: # Robot Password, fill this only if you don't have a secret already with the token. And set secret.create=true privateNetwork: enabled: false @@ -31,11 +29,8 @@ privateNetwork: secret: create: false name: hetzner # Name of an existing secret - key: - token: hcloud # Name of an existing key for the hcloud-token in the above specified secret - robotUserName: robot-user - robotPassword: robot-password - network: network # Name of an existing key for the hcloud-network in the above specified secret + tokenKeyName: hcloud # Name of an existing key for the hcloud-token in the above specified secret + networkKeyName: network # Name of an existing key for the hcloud-network in the above specified secret pdb: enabled: true diff --git a/charts/ccm-hetzner-test/templates/secret.yaml b/charts/ccm-hetzner-test/templates/secret.yaml deleted file mode 100644 index 5b9706d..0000000 --- a/charts/ccm-hetzner-test/templates/secret.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if .Values.secret.create -}} -apiVersion: v1 -kind: Secret -metadata: - name: {{ include "ccm-hetzner-test.fullname" . }} - namespace: {{ .Release.Namespace }} - labels: - {{- include "ccm-hetzner-test.labels" . | nindent 4 }} -stringData: - {{ .Values.secret.key.token }}: {{ .Values.env.hcloudApiToken | b64enc }} - {{ .Values.secret.key.robotUserName }}: {{ .Values.env.robotUser | b64enc }} - {{ .Values.secret.key.robotPassword }}: {{ .Values.env.robotPassword | b64enc }} -{{- if .Values.privateNetwork.enabled }} - {{ .Values.secret.networkKeyName }}: {{ .Values.privateNetwork.network.id | b64enc }} -{{- end -}} -{{- end -}}