Skip to content

Commit

Permalink
add secret support for tfo-api chart
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaguilar committed Apr 10, 2024
1 parent 25867a7 commit 7a9ea02
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/terraform-operator-api/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: 0.8.1
description: A Helm chart to deploy the terraform-operator-api
name: terraform-operator-api
version: 1.0.15
version: 1.1.0
6 changes: 4 additions & 2 deletions charts/terraform-operator-api/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# terraform-operator-api

![Version: 1.0.15](https://img.shields.io/badge/Version-1.0.15-informational?style=flat-square) ![AppVersion: 0.8.1](https://img.shields.io/badge/AppVersion-0.8.1-informational?style=flat-square)
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![AppVersion: 0.8.1](https://img.shields.io/badge/AppVersion-0.8.1-informational?style=flat-square)

A Helm chart to deploy the terraform-operator-api

Expand All @@ -16,12 +16,14 @@ $ helm install galleybytes/terraform-operator-api --namespace tf-system
| Key | Description | Default |
|---|---|---|
| args | `list` Optional args to include for the command | `["use-service-host"]` |
| env | `list` Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#envvar-v1-core. | `[]` |
| env | `list` Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envvar-v1-core. | `[]` |
| envFrom | `list` List of sources to populate environment variables in the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envfromsource-v1-core | `[]` |
| image.tag | `string` | `"0.8.1"` |
| server.port | `int` The port the runtime exposes to connect to the webserver | `5555` |
| 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"` |
| secret | `object` Map of environment variables (C_IDENTIFIERS) that will be added to deployment | `{}` |
| resources | `object` CPU/Memory request and limit configuration | `{}` |
| nodeSelector | `object` node labels for pod assignment | `{}` |
| tolerations | `list` List of node taints to tolerate | `[]` |
Expand Down
10 changes: 9 additions & 1 deletion charts/terraform-operator-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ spec:
args:
{{- toYaml . | nindent 8 }}
{{ end -}}
envFrom:
{{- with .Values.envFrom }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.secret }}
- secretRef:
name: {{ .Release.Name }}
{{- end }}
env:
- name: SERVICE_NAME
value: {{ .Release.Name }}
Expand Down Expand Up @@ -57,4 +65,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/terraform-operator-api/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.secret -}}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
type: Opaque
data:
{{- range $key, $value := .Values.secret }}
{{ $key }}: {{ $value | b64enc | quote }}
{{- end }}
{{- end }}

9 changes: 8 additions & 1 deletion charts/terraform-operator-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
args:
- use-service-host

# -- Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#envvar-v1-core.
# -- Env defined like k8s EnvVar https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envvar-v1-core.
env: []
# - name: DASHBOARD
# value: https://<dashboard-host>
Expand All @@ -12,6 +12,10 @@ env: []
# value: isa
# - name: ADMIN_PASSWORD
# value: $2a$10$2ap6bphr5ZBkEMTBb/ZoT.zrY7lUwzCW2u1n5tIeVugtVpjMRW9Fe
#

# -- List of sources to populate environment variables in the container. See https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#envfromsource-v1-core
envFrom: []

# Image options
image:
Expand All @@ -32,6 +36,9 @@ service:
# -- service type is one of ClusterIP | LoadBalancer | NodePort
type: ClusterIP

# -- Map of environment variables (C_IDENTIFIERS) that will be added to deployment
secret: {}


# -- CPU/Memory request and limit configuration
resources: {}
Expand Down

0 comments on commit 7a9ea02

Please sign in to comment.