diff --git a/charts/nirmata-kube-controller/Chart.yaml b/charts/nirmata-kube-controller/Chart.yaml index 9499bcb2..17a56df9 100644 --- a/charts/nirmata-kube-controller/Chart.yaml +++ b/charts/nirmata-kube-controller/Chart.yaml @@ -15,13 +15,13 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.7-rc3 +version: 0.1.7-rc4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v3.10.7" +appVersion: "v3.10.9" maintainers: - name: Nirmata diff --git a/charts/nirmata-kube-controller/templates/_helpers.tpl b/charts/nirmata-kube-controller/templates/_helpers.tpl new file mode 100644 index 00000000..31d1d4c8 --- /dev/null +++ b/charts/nirmata-kube-controller/templates/_helpers.tpl @@ -0,0 +1,3 @@ +{{- define "controller.imagePullSecret" }} +{{- printf "{\"auths\":{\"%s\":{\"auth\":\"%s\"}}}" .imageRegistry (printf "%s:%s" .registryUserName .registryPassword | b64enc) | b64enc }} +{{- end }} \ No newline at end of file diff --git a/charts/nirmata-kube-controller/templates/apiTokenSecret.yaml b/charts/nirmata-kube-controller/templates/apiTokenSecret.yaml new file mode 100644 index 00000000..5bb8bda1 --- /dev/null +++ b/charts/nirmata-kube-controller/templates/apiTokenSecret.yaml @@ -0,0 +1,10 @@ + +{{ if .Values.apiToken }} +apiVersion: v1 +kind: Secret +metadata: + name: nirmata-api-token + namespace: nirmata +data: + apiKey: {{ .Values.apiToken | b64enc }} +{{ end }} \ No newline at end of file diff --git a/charts/nirmata-kube-controller/templates/imagePullSecret.yaml b/charts/nirmata-kube-controller/templates/imagePullSecret.yaml new file mode 100644 index 00000000..1b3f97e2 --- /dev/null +++ b/charts/nirmata-kube-controller/templates/imagePullSecret.yaml @@ -0,0 +1,11 @@ +{{ if and .Values.global.imageRegistry .Values.global.registryUserName .Values.global.registryPassword }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: nirmata-controller-registry-secret + namespace: {{ .Values.namespace }} +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: {{ template "controller.imagePullSecret" .Values.global }} +{{ end }} \ No newline at end of file diff --git a/charts/nirmata-kube-controller/templates/nirmata-kube-controller.yaml b/charts/nirmata-kube-controller/templates/nirmata-kube-controller.yaml index 5512d8e5..52ca064c 100644 --- a/charts/nirmata-kube-controller/templates/nirmata-kube-controller.yaml +++ b/charts/nirmata-kube-controller/templates/nirmata-kube-controller.yaml @@ -390,18 +390,12 @@ spec: - 10m - -cluster-name - {{ .Values.cluster.name }} - {{- if .Values.apiToken }} - - -api-token - - {{ .Values.apiToken }} - {{- end }} {{ range $key, $value := .Values.cluster.labels }} - "-cluster-labels" - "{{ $key }}:{{ $value }}" {{ end }} - {{- if .Values.apiTokenSecret }} - -api-token-secret - - {{ .Values.apiTokenSecret }} - {{- end }} + - nirmata-api-token command: - /nirmata-kube-controller env: diff --git a/charts/nirmata-kube-controller/values.yaml b/charts/nirmata-kube-controller/values.yaml index 3c1e2774..b8bdd74d 100644 --- a/charts/nirmata-kube-controller/values.yaml +++ b/charts/nirmata-kube-controller/values.yaml @@ -3,9 +3,12 @@ # # Declare variables to be passed into your templates. nirmataURL: "wss://nirmata.io/tunnels" +namespace: "nirmata" global: imageRegistry: ghcr.io imageRepository: nirmata + registryUserName: + registryPassword: kubeController: imageRegistry: @@ -22,23 +25,10 @@ cluster: type: default-policy-manager-type labels: # key: value + # key2: value2 -# Use either apiToken or apiTokenSecret to specify the api token in NPM +apiToken: "" -# to use the apiTokenSecret, please create a secret with key 'apiKey' -# here's the example -# apiVersion: v1 -# kind: Secret -# metadata: -# name: nirmata-api-token -# namespace: nirmata -# data: -# apiKey: "{base64 encoded api token}" - -# apiTokenSecret: "nirmata-api-token" - -# to use apiToken, please specify the token directly, no base64 encode needed -# apiToken: "" features: policyExceptions: enabled: false