diff --git a/helm/alpine/Chart.yaml b/helm/alpine/Chart.yaml new file mode 100644 index 0000000..171f7aa --- /dev/null +++ b/helm/alpine/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: alpine +description: Understanding helm with alpine Linux +type: application +version: 1.0.0 +appVersion: "3.22" diff --git a/helm/alpine/templates/deployment.yaml b/helm/alpine/templates/deployment.yaml new file mode 100644 index 0000000..0cbed55 --- /dev/null +++ b/helm/alpine/templates/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-alpine + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: alpine +spec: + selector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: alpine +{{ if .Values.suspend }} + replicas: 0 +{{ else }} + replicas: 1 +{{ end }} + strategy: + type: Recreate + template: + metadata: + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: alpine + spec: + containers: + - name: alpine + image: alpine:{{ .Chart.AppVersion }} + volumeMounts: + - name: data + mountPath: "/data" + subPath: alpine + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-data diff --git a/helm/alpine/templates/pvc.yaml b/helm/alpine/templates/pvc.yaml new file mode 100644 index 0000000..7793856 --- /dev/null +++ b/helm/alpine/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.pvc.size }} + storageClassName: {{ .Values.pvc.storageClassName }} diff --git a/helm/alpine/values.yaml b/helm/alpine/values.yaml new file mode 100644 index 0000000..4bd9025 --- /dev/null +++ b/helm/alpine/values.yaml @@ -0,0 +1,4 @@ +suspend: false +pvc: + size: 1Gi + storageClassName: ""