diff --git a/termix/Chart.yaml b/termix/Chart.yaml new file mode 100644 index 0000000..4691fd1 --- /dev/null +++ b/termix/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: termix +description: Termix Helm chart +type: application +version: 0.1.0 +appVersion: "1.11.2" +annotations: + version-source: dockerhub-dev:bugattiguy527/termix:^release-[0-9]+\.[0-9]+\.[0-9]+$ + version-pattern: "s|^release-||" diff --git a/termix/templates/deployment.yaml b/termix/templates/deployment.yaml new file mode 100644 index 0000000..7081cb8 --- /dev/null +++ b/termix/templates/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: terminal + app.kubernetes.io/part-of: home-automation + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} + version-pattern: {{ index .Chart.Annotations "version-pattern" | quote }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:release-{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.port }} + name: http + env: + - name: PORT + value: {{ .Values.port | quote }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: data + mountPath: /app/data + volumes: + - name: data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-data diff --git a/termix/templates/ingress.yaml b/termix/templates/ingress.yaml new file mode 100644 index 0000000..6a80701 --- /dev/null +++ b/termix/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.port }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/termix/templates/pvc.yaml b/termix/templates/pvc.yaml new file mode 100644 index 0000000..5cdf35f --- /dev/null +++ b/termix/templates/pvc.yaml @@ -0,0 +1,13 @@ +{{- if .Values.persistence.enabled }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-data +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.persistence.storageClass }} + resources: + requests: + storage: {{ .Values.persistence.size }} +{{- end }} diff --git a/termix/templates/service.yaml b/termix/templates/service.yaml new file mode 100644 index 0000000..4ef2e54 --- /dev/null +++ b/termix/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.port }} + targetPort: {{ .Values.port }} + protocol: TCP diff --git a/termix/values.yaml b/termix/values.yaml new file mode 100644 index 0000000..c812145 --- /dev/null +++ b/termix/values.yaml @@ -0,0 +1,27 @@ +# Default values for Termix Helm Chart +image: + repository: bugattiguy527/termix + pullPolicy: Always + +port: 8080 + +resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" + +persistence: + enabled: true + storageClass: local-path + size: 1Gi + +ingresses: {} + # https: + # host: termix.example.com + # annotations: {} + # tls: + # - hosts: + # - termix.example.com