mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-27 22:05:11 -02:30
refactor vault role (#2733)
* Move front-proxy-client certs back to kube mount We want the same CA for all k8s certs * Refactor vault to use a third party module The module adds idempotency and reduces some of the repetitive logic in the vault role Requires ansible-modules-hashivault on ansible node and hvac on the vault hosts themselves Add upgrade test scenario Remove bootstrap-os tags from tasks * fix upgrade issues * improve unseal logic * specify ca and fix etcd check * Fix initialization check bump machine size
This commit is contained in:
@@ -100,3 +100,6 @@ kube_encrypt_secret_data: false
|
||||
kube_encrypt_token: "{{ lookup('password', inventory_dir + '/credentials/kube_encrypt_token.creds length=32 chars=ascii_letters,digits') }}"
|
||||
# Must be either: aescbc, secretbox or aesgcm
|
||||
kube_encryption_algorithm: "aescbc"
|
||||
|
||||
# You may want to use ca.pem depending on your situation
|
||||
kube_front_proxy_ca: "front-proxy-ca.pem"
|
||||
|
||||
@@ -117,8 +117,13 @@ spec:
|
||||
- --feature-gates={{ kube_feature_gates|join(',') }}
|
||||
{% endif %}
|
||||
{% if kube_version | version_compare('v1.9', '>=') %}
|
||||
- --requestheader-client-ca-file={{ kube_cert_dir }}/front-proxy-ca.pem
|
||||
- --requestheader-client-ca-file={{ kube_cert_dir }}/{{ kube_front_proxy_ca }}
|
||||
{# FIXME(mattymo): Vault certs do not work with front-proxy-client #}
|
||||
{% if cert_management == "vault" %}
|
||||
- --requestheader-allowed-names=
|
||||
{% else %}
|
||||
- --requestheader-allowed-names=front-proxy-client
|
||||
{% endif %}
|
||||
- --requestheader-extra-headers-prefix=X-Remote-Extra-
|
||||
- --requestheader-group-headers=X-Remote-Group
|
||||
- --requestheader-username-headers=X-Remote-User
|
||||
|
||||
@@ -128,13 +128,13 @@ vsphere_public_network: "{{ lookup('env', 'VSPHERE_PUBLIC_NETWORK')|default('')
|
||||
|
||||
## When azure is used, you need to also set the following variables.
|
||||
## see docs/azure.md for details on how to get these values
|
||||
#azure_tenant_id:
|
||||
#azure_subscription_id:
|
||||
#azure_aad_client_id:
|
||||
#azure_aad_client_secret:
|
||||
#azure_resource_group:
|
||||
#azure_location:
|
||||
#azure_subnet_name:
|
||||
#azure_security_group_name:
|
||||
#azure_vnet_name:
|
||||
#azure_route_table_name:
|
||||
# azure_tenant_id:
|
||||
# azure_subscription_id:
|
||||
# azure_aad_client_id:
|
||||
# azure_aad_client_secret:
|
||||
# azure_resource_group:
|
||||
# azure_location:
|
||||
# azure_subnet_name:
|
||||
# azure_security_group_name:
|
||||
# azure_vnet_name:
|
||||
# azure_route_table_name:
|
||||
|
||||
@@ -13,6 +13,5 @@
|
||||
|
||||
- import_tasks: set_resolv_facts.yml
|
||||
tags:
|
||||
- bootstrap-os
|
||||
- resolvconf
|
||||
- facts
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
---
|
||||
kube_cert_group: kube-cert
|
||||
kube_vault_mount_path: kube
|
||||
front_proxy_vault_mount_path: front-proxy
|
||||
kube_vault_mount_path: "/kube"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
- k8s-secrets
|
||||
- kube-controller-manager
|
||||
- kube-apiserver
|
||||
- bootstrap-os
|
||||
- apps
|
||||
- network
|
||||
- master
|
||||
@@ -28,7 +27,6 @@
|
||||
when: gen_certs|default(false)
|
||||
tags:
|
||||
- k8s-secrets
|
||||
- bootstrap-os
|
||||
|
||||
- name: Gen_certs | write openssl config
|
||||
template:
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
issue_cert_path: "{{ item }}"
|
||||
issue_cert_role: front-proxy-client
|
||||
issue_cert_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
||||
issue_cert_mount_path: "{{ front_proxy_vault_mount_path }}"
|
||||
issue_cert_mount_path: "{{ kube_vault_mount_path }}"
|
||||
with_items: "{{ kube_front_proxy_clients_certs_needed|d([]) }}"
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
notify: set secret_changed
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
- k8s-secrets
|
||||
- kube-controller-manager
|
||||
- kube-apiserver
|
||||
- bootstrap-os
|
||||
- apps
|
||||
- network
|
||||
- master
|
||||
@@ -57,7 +56,6 @@
|
||||
when: gen_certs|default(false) or gen_tokens|default(false)
|
||||
tags:
|
||||
- k8s-secrets
|
||||
- bootstrap-os
|
||||
|
||||
- name: "Get_tokens | Make sure the tokens directory exits (on {{groups['kube-master'][0]}})"
|
||||
file:
|
||||
|
||||
Reference in New Issue
Block a user