diff --git a/charts/terraform-operator-dashboard/Chart.yaml b/charts/terraform-operator-dashboard/Chart.yaml new file mode 100644 index 0000000..6dc6a03 --- /dev/null +++ b/charts/terraform-operator-dashboard/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: 1.0.0 +description: A Helm chart to deploy the terraform-operator-dashboard +name: terraform-operator-dashboard +version: 1.0.0 diff --git a/charts/terraform-operator-dashboard/README.md b/charts/terraform-operator-dashboard/README.md new file mode 100644 index 0000000..cc59779 --- /dev/null +++ b/charts/terraform-operator-dashboard/README.md @@ -0,0 +1,27 @@ +# terraform-operator-dashboard + +![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) + +A Helm chart to deploy the terraform-operator-dashboard + +## TL;DR; + +```console +$ helm repo add galleybytes https://galleybytes.github.io/helm-charts +$ helm install galleybytes/terraform-operator-dashboard --namespace tf-system +``` + +## Values + +| Key | Description | Default | +|---|---|---| +| env | `list` Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#envvar-v1-core. | `[{"name":"API_HOST","value":"http://terraform-operator-api"}]` | +| image.tag | `string` | `"1.0.0-alpha-20231020t083321"` | +| server.port | `int` The port the runtime exposes to connect to the webserver | `8080` | +| service.annotations | `object` Service annotations key/values for the service resource | `{}` | +| service.port | `int` the http or https port clients will use to access the `server.port` | `80` | +| service.type | `string` service type is one of ClusterIP | LoadBalancer | NodePort | `"ClusterIP"` | +| resources | `object` CPU/Memory request and limit configuration | `{}` | +| nodeSelector | `object` node labels for pod assignment | `{}` | +| tolerations | `list` List of node taints to tolerate | `[]` | +| affinity | `object` node/pod affinities | `{}` | diff --git a/charts/terraform-operator-dashboard/hack/README.md.gotmpl b/charts/terraform-operator-dashboard/hack/README.md.gotmpl new file mode 100644 index 0000000..9bb6fb7 --- /dev/null +++ b/charts/terraform-operator-dashboard/hack/README.md.gotmpl @@ -0,0 +1,30 @@ +{{ template "chart.header" . }} +{{ template "chart.deprecationWarning" . }} + +{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} + +{{ template "chart.description" . }} + +## TL;DR; + +```console +$ helm repo add galleybytes https://galleybytes.github.io/helm-charts +$ helm install galleybytes/terraform-operator-dashboard --namespace tf-system +``` + + +{{ template "chart.homepageLine" . }} + +{{ template "chart.maintainersSection" . }} + +{{ template "chart.sourcesSection" . }} + +{{ template "chart.requirementsSection" . }} + +## Values + +| Key | Description | Default | +|---|---|---| +{{- range .Values }} +| {{ .Key }} | `{{ .Type }}` {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | +{{- end }} diff --git a/charts/terraform-operator-dashboard/templates/deployment.yaml b/charts/terraform-operator-dashboard/templates/deployment.yaml new file mode 100644 index 0000000..836ce65 --- /dev/null +++ b/charts/terraform-operator-dashboard/templates/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} +spec: + selector: + matchLabels: + service: terraform-operator + component: dashboard + replicas: {{ .Values.replicaCount | default 1 }} + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + template: + metadata: + labels: + service: terraform-operator + component: dashboard + spec: + serviceAccount: {{ .Release.Name }} + containers: + - {{ with .Values.args -}} + args: + {{- toYaml . | nindent 8 }} + {{ end -}} + env: + {{- range .Values.env }} + - name: {{ .name }} + value: {{ .value }} + {{- end }} + image: ghcr.io/galleybytes/terraform-operator-dashboard:{{ .Values.image.tag }} + imagePullPolicy: IfNotPresent + name: dashboard + ports: + - containerPort: {{ .Values.server.port }} + protocol: TCP + {{- with .Values.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{- end }} + restartPolicy: Always + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} \ No newline at end of file diff --git a/charts/terraform-operator-dashboard/templates/service.yaml b/charts/terraform-operator-dashboard/templates/service.yaml new file mode 100644 index 0000000..acdc745 --- /dev/null +++ b/charts/terraform-operator-dashboard/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + {{- range $key, $value := .Values.service.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + labels: + service: terraform-operator + component: dashboard + name: {{ .Release.Name }} +spec: + ports: + - name: http + port: {{ .Values.service.port }} + protocol: TCP + targetPort: {{ .Values.server.port }} + + selector: + service: terraform-operator + component: dashboard + type: {{ .Values.service.type }} diff --git a/charts/terraform-operator-dashboard/values.yaml b/charts/terraform-operator-dashboard/values.yaml new file mode 100644 index 0000000..740d895 --- /dev/null +++ b/charts/terraform-operator-dashboard/values.yaml @@ -0,0 +1,34 @@ +# -- Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#envvar-v1-core. +env: +- name: API_HOST + value: http://terraform-operator-api # When deployed in same namespace as tfo-api + +image: + # The container image tag + tag: 1.0.0-alpha-20231020t083321 + +# - Options for the api-webserver +server: + # -- The port the runtime exposes to connect to the webserver + port: 8080 + +# - Service options to expose the API +service: + # -- Service annotations key/values for the service resource + annotations: {} + # -- the http or https port clients will use to access the `server.port` + port: 80 + # -- service type is one of ClusterIP | LoadBalancer | NodePort + type: ClusterIP + +# -- CPU/Memory request and limit configuration +resources: {} + +# -- node labels for pod assignment +nodeSelector: {} + +# -- List of node taints to tolerate +tolerations: [] + +# -- node/pod affinities +affinity: {}