diff --git a/chart/chart.yaml b/chart/chart.yaml new file mode 100644 index 0000000..129140b --- /dev/null +++ b/chart/chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: dev-machine +description: A Helm chart for deploying the dev environment container +version: 0.1.0 +appVersion: "1.0" diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml new file mode 100644 index 0000000..884d552 --- /dev/null +++ b/chart/templates/deployment.yaml @@ -0,0 +1,30 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-deployment +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Release.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.service.port }} + volumeMounts: + - name: home-volume + mountPath: /home/dev + resources: +{{ toYaml .Values.resources | indent 10 }} + volumes: + - name: home-volume + persistentVolumeClaim: + claimName: {{ .Release.Name }}-pvc diff --git a/chart/templates/pvc.yaml b/chart/templates/pvc.yaml new file mode 100644 index 0000000..d7f1505 --- /dev/null +++ b/chart/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-pvc +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.persistence.size }} + storageClassName: {{ .Values.persistence.storageClass | quote }} diff --git a/chart/templates/svc.yaml b/chart/templates/svc.yaml new file mode 100644 index 0000000..2300bf6 --- /dev/null +++ b/chart/templates/svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 2222 + selector: + app: {{ .Release.Name }} diff --git a/chart/values.yaml b/chart/values.yaml new file mode 100644 index 0000000..8803a80 --- /dev/null +++ b/chart/values.yaml @@ -0,0 +1,17 @@ +replicaCount: 1 + +image: + repository: docker pull ghcr.io/syntax3rror404/k8s-devmachine + tag: b180370a1d42efea8b3c6e630e4eab1cc9207ddd95b8a1f29929ae235e9f3e7c + pullPolicy: IfNotPresent + +service: + type: LoadBalancer + port: 22 + +persistence: + enabled: true + size: 10Gi + storageClass: "longhorn" + +resources: {} \ No newline at end of file