Skip to content

Commit

Permalink
Merge pull request #60 from syself/add-ccm-hcloud-test
Browse files Browse the repository at this point in the history
🌱 added ccm-hcloud-test (removed ccm-hetzner-test)
  • Loading branch information
guettli authored May 4, 2023
2 parents b5699b9 + 435563e commit f484484
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 73 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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: [email protected]
Expand Down
Original file line number Diff line number Diff line change
@@ -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 }}

Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
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 }}
annotations:
{{- 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:
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
14 changes: 14 additions & 0 deletions charts/ccm-hcloud-test/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -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 -}}
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Original file line number Diff line number Diff line change
@@ -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: ""
Expand All @@ -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
Expand All @@ -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
Expand Down
16 changes: 0 additions & 16 deletions charts/ccm-hetzner-test/templates/secret.yaml

This file was deleted.

0 comments on commit f484484

Please sign in to comment.