dex-aio - missing idp-ca.crt for refresh token

Once the id_token expires, kubectl uses the refresh token to obtain new
id_token and refresh token. This process requires the attribute
idp-certificate-authority under users.user.auth-provider.config in the
kubeconfig file, which was missing when this file was generated.

This patchset adds the attribute in values.yaml that will be used to
generate the config.yaml file for the authenticator container, which
will include the instructions for including the missing
idp-certificate-authority and associated certificate in the kubeconfig
file.

Also, added the namespace for the templates as dex needs to be deployed
in the same namespace as the target-cluster management resources, e.g.,
target-infra.

Relates-to: #6

Change-Id: Ie871d1d47f160da035fdfa80016699c519d4c2dd
This commit is contained in:
Shiba, Sidney 2021-06-30 15:17:48 +00:00 committed by Sidney Shiba
parent 874c60e4ce
commit f945f6a916
10 changed files with 11 additions and 4 deletions

View File

@ -4,6 +4,7 @@ apiVersion: cert-manager.io/v1alpha2
kind: Certificate kind: Certificate
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
spec: spec:
secretName: {{ template "helpers.labels.fullname" . }}-tls secretName: {{ template "helpers.labels.fullname" . }}-tls

View File

@ -12,7 +12,7 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Values.namespace | default .Release.Namespace }}
... ...
{{- end -}} {{- end -}}
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "ClusterRoleBinding-dex" ) }} {{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "ClusterRoleBinding-dex" ) }}

View File

@ -4,6 +4,7 @@ apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
data: data:
{{- range $key, $value := .Values.config }} {{- range $key, $value := .Values.config }}

View File

@ -4,6 +4,7 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
annotations: annotations:
scheduler.alpha.kubernetes.io/critical-pod: '' scheduler.alpha.kubernetes.io/critical-pod: ''

View File

@ -4,6 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
rules: rules:
- apiGroups: - apiGroups:

View File

@ -5,7 +5,7 @@ kind: RoleBinding
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
namespace: {{ .Release.Namespace }} namespace: {{ .Values.namespace | default .Release.Namespace }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role
@ -13,7 +13,7 @@ roleRef:
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Release.Namespace }} namespace: {{ .Values.namespace | default .Release.Namespace }}
... ...
{{- end -}} {{- end -}}
{{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "RoleBinding-dex" ) }} {{- include "helpers.template.overlay" ( dict "Global" $ "template_definition" "RoleBinding-dex" ) }}

View File

@ -4,6 +4,7 @@ apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
data: data:
ldap-bindpw: "{{ b64enc ( .Values.params.ldap.bind_password ) }}" ldap-bindpw: "{{ b64enc ( .Values.params.ldap.bind_password ) }}"

View File

@ -4,6 +4,7 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
spec: spec:
type: NodePort type: NodePort

View File

@ -4,6 +4,7 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ template "helpers.labels.fullname" . }} name: {{ template "helpers.labels.fullname" . }}
namespace: {{ .Values.namespace | default .Release.Namespace }}
labels: {{- include "helpers.labels.labels" . | nindent 4 }} labels: {{- include "helpers.labels.labels" . | nindent 4 }}
... ...
{{- end -}} {{- end -}}

View File

@ -28,7 +28,6 @@ node_labels:
key: node-role.kubernetes.io/master key: node-role.kubernetes.io/master
value: "" value: ""
params: params:
site: site:
name: PDL1 name: PDL1
@ -165,6 +164,7 @@ config:
web_path_prefix: "/ui" web_path_prefix: "/ui"
tls_cert: "/var/run/secrets/airshipit.org/tls/crt/tls.crt" tls_cert: "/var/run/secrets/airshipit.org/tls/crt/tls.crt"
tls_key: "/var/run/secrets/airshipit.org/tls/key/tls.key" tls_key: "/var/run/secrets/airshipit.org/tls/key/tls.key"
idp_ca_uri: "http://{{ .Values.params.endpoints.hostname }}:{{ .Values.params.endpoints.port.http }}/ca.crt"
debug: true debug: true
clusters: clusters:
- client_id: "{{ .Values.params.oidc.client_id }}" - client_id: "{{ .Values.params.oidc.client_id }}"