diff --git a/templates/sync-workspace-deployment.yaml b/templates/sync-workspace-deployment.yaml index 73557a2..445054f 100644 --- a/templates/sync-workspace-deployment.yaml +++ b/templates/sync-workspace-deployment.yaml @@ -4,7 +4,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "terraform.fullname" . }}-sync-workspace - namespace: {{ .Release.Namespace }} + namespace: {{ default .Release.Namespace .Values.global.namespace }} labels: app: {{ template "terraform.name" . }} chart: {{ template "terraform.chart" . }} diff --git a/templates/sync-workspace-role.yaml b/templates/sync-workspace-role.yaml index 4a1d770..a9c59ca 100644 --- a/templates/sync-workspace-role.yaml +++ b/templates/sync-workspace-role.yaml @@ -5,11 +5,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: {{ $kind }} metadata: name: {{ template "terraform.fullname" . }}-sync-workspace + namespace: {{ default .Release.Namespace .Values.global.namespace }} labels: app: {{ template "terraform.name" . }} chart: {{ template "terraform.chart" . }} heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + release: {{ .Release.Name }} rules: - apiGroups: - "" diff --git a/templates/sync-workspace-rolebinding.yaml b/templates/sync-workspace-rolebinding.yaml index d811b31..52dc40e 100644 --- a/templates/sync-workspace-rolebinding.yaml +++ b/templates/sync-workspace-rolebinding.yaml @@ -5,11 +5,12 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: {{ ternary "RoleBinding" "ClusterRoleBinding" (eq $kind "Role") }} metadata: name: {{ template "terraform.fullname" . }}-sync-workspace + namespace: {{ default .Release.Namespace .Values.global.namespace }} labels: app: {{ template "terraform.name" . }} chart: {{ template "terraform.chart" . }} heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + release: {{ .Release.Name }} subjects: - kind: ServiceAccount name: {{ template "terraform.fullname" . }}-sync-workspace diff --git a/templates/sync-workspace-secret.yaml b/templates/sync-workspace-secret.yaml index 721dfdb..8fbd2e6 100644 --- a/templates/sync-workspace-secret.yaml +++ b/templates/sync-workspace-secret.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: cacert - namespace: {{ .Release.Namespace }} + namespace: {{ default .Release.Namespace .Values.global.namespace }} type: Opaque data: ca_file: |- diff --git a/templates/sync-workspace-serviceaccount.yaml b/templates/sync-workspace-serviceaccount.yaml index 7f309ec..2943d4a 100644 --- a/templates/sync-workspace-serviceaccount.yaml +++ b/templates/sync-workspace-serviceaccount.yaml @@ -3,9 +3,10 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ template "terraform.fullname" . }}-sync-workspace + namespace: {{ default .Release.Namespace .Values.global.namespace }} labels: app: {{ template "terraform.name" . }} chart: {{ template "terraform.chart" . }} heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -{{- end }} \ No newline at end of file + release: {{ .Release.Name }} +{{- end }} diff --git a/values.yaml b/values.yaml index 42722e8..1e1ae96 100644 --- a/values.yaml +++ b/values.yaml @@ -8,6 +8,9 @@ global: # opt-in is required, such as by setting `syncWorkspace.enabled` to true. enabled: true + # Used to override Release.Namespace + namespace: null + # imageK8S is the name (and tag) of the terraform-k8s Docker image that # is used for functionality such as workspace sync. This can be overridden # per component. @@ -50,12 +53,12 @@ syncWorkspace: # logLevel: error # Name and key of Kubernetes secret containing the Terraform CLI Configuration - # Must have Terraform Cloud Team API Token + # Must have Terraform Cloud Team API Token terraformRC: secretName: terraformrc secretKey: credentials - # Name of Kubernetes secret containing keys and values of sensitive variables + # Name of Kubernetes secret containing keys and values of sensitive variables sensitiveVariables: secretName: workspacesecrets @@ -69,7 +72,7 @@ tests: # moduleSource: git::https://github.com/hashicorp/terraform-helm.git//test/module # If the TFE instance the operator talks to is using a private CA then CACerts -# can be used to install a custom CA bundle in the operator's container that +# can be used to install a custom CA bundle in the operator's container that # will allow it to communicate with TFE. # # CACerts can be set like this: