Add ability to use custom cert secret instead of init container provisioned self-signed certs

This commit is contained in:
Chad Swenson 2017-11-13 13:59:31 -06:00
parent 0c6f172e75
commit a89ee8c406
4 changed files with 16 additions and 5 deletions

View file

@ -54,6 +54,12 @@ dashboard_memory_requests: 64M
# SSL
etcd_cert_dir: "/etc/ssl/etcd/ssl"
canal_cert_dir: "/etc/canal/certs"
# Set dashboard_use_custom_certs to true if overriding dashboard_certs_secret_name with a secret that
# contains dashboard_tls_key_file and dashboard_tls_cert_file instead of using the initContainer provisioned certs
dashboard_use_custom_certs: false
dashboard_certs_secret_name: kubernetes-dashboard-certs
dashboard_tls_key_file: dashboard.key
dashboard_tls_cert_file: dashboard.crt
rbac_resources:
- sa

View file

@ -5,7 +5,8 @@
kubectl: "{{bin_dir}}/kubectl"
resource: "{{ item }}"
state: absent
with_items: ['ClusterRoleBinding']
with_items:
- 'ClusterRoleBinding'
tags:
- upgrade

View file

@ -15,7 +15,9 @@
kubectl: "{{bin_dir}}/kubectl"
resource: "{{ item }}"
state: absent
with_items: ['deploy', 'svc']
with_items:
- 'deploy'
- 'svc'
tags:
- upgrade

View file

@ -127,12 +127,14 @@ spec:
labels:
k8s-app: kubernetes-dashboard
spec:
{% if not dashboard_use_custom_certs %}
initContainers:
- name: kubernetes-dashboard-init
image: {{ dashboard_init_image_repo }}:{{ dashboard_init_image_tag }}
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
{% endif %}
containers:
- name: kubernetes-dashboard
image: {{ dashboard_image_repo }}:{{ dashboard_image_tag }}
@ -148,8 +150,8 @@ spec:
- containerPort: 8443
protocol: TCP
args:
- --tls-key-file=/certs/dashboard.key
- --tls-cert-file=/certs/dashboard.crt
- --tls-key-file=/certs/{{ dashboard_tls_key_file }}
- --tls-cert-file=/certs/{{ dashboard_tls_cert_file }}
- --authentication-mode=token{% if kube_basic_auth|default(false) %},basic{% endif %}
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
@ -172,7 +174,7 @@ spec:
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
secretName: {{ dashboard_certs_secret_name }}
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard