mintel / dex-k8s-authenticator

A Kubernetes Dex Client Authenticator
MIT License
374 stars 146 forks source link

authenticator and dex don't pick the new config automatically #76

Closed praveendhac closed 5 years ago

praveendhac commented 5 years ago

When there is change in authenticator app config or dex server config the pods does not pick the config automatically. Users have to delete the pod so that new pod comes up with latest config.

praveendhac commented 5 years ago

How to commit my changes $ git push --set-upstream origin 76-pods-automatically-pick-configmap remote: Permission to mintel/dex-k8s-authenticator.git denied to praveendhac. fatal: unable to access 'https://github.com/mintel/dex-k8s-authenticator/': The requested URL returned error: 403

praveendhac commented 5 years ago

Below is the fix, need to bump chart versions too.

$ git diff
diff --git a/charts/dex-k8s-authenticator/templates/deployment.yaml b/charts/dex-k8s-authenticator/templates/deployment.yaml
index 53891bf..c4e7d74 100644
--- a/charts/dex-k8s-authenticator/templates/deployment.yaml
+++ b/charts/dex-k8s-authenticator/templates/deployment.yaml
@@ -27,6 +27,8 @@ spec:
         app: {{ template "dex-k8s-authenticator.name" . }}
         env: {{ default "dev" .Values.global.deployEnv }}
         release: {{ .Release.Name }}
+      annotations:
+        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
     spec:
       containers:
       - name: {{ .Chart.Name }}
diff --git a/charts/dex/templates/deployment.yaml b/charts/dex/templates/deployment.yaml
index 1a80d76..eb67191 100644
--- a/charts/dex/templates/deployment.yaml
+++ b/charts/dex/templates/deployment.yaml
@@ -33,6 +33,8 @@ spec:
         app: {{ template "dex.name" . }}
         env: {{ default "dev" .Values.global.deployEnv }}
         release: {{ .Release.Name }}
+      annotations:
+        checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
     spec:
       volumes:
       - name: config
nickmintel commented 5 years ago

@praveendhac thanks, this looks useful I'll add it.

If you did want to submit a patch, you just need fork the repo, make your change on your fork and submit a pull-request via github.

praveendhac commented 5 years ago

FYI, https://github.com/praveendhac/dex-k8s-authenticator/commit/c7d4bbb271cb50353b2a508d9a4c909163890718

nickmintel commented 5 years ago

Thanks @praveendhac this is now merged. I'll create a new release.

nabadger commented 5 years ago

Added v1.1.0 tag (image is building now).

Thanks again