mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-06 11:11:15 -03:30
support asymmetric encryption algorithms in ClusterConfigration (#11757)
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
This commit is contained in:
@@ -37,6 +37,7 @@ patches:
|
||||
apiVersion: kubeadm.k8s.io/v1beta4
|
||||
kind: ClusterConfiguration
|
||||
clusterName: {{ cluster_name }}
|
||||
encryptionAlgorithm: {{ kube_asymmetric_encryption_algorithm }}
|
||||
etcd:
|
||||
{% if etcd_deployment_type != "kubeadm" %}
|
||||
external:
|
||||
|
||||
@@ -30,7 +30,10 @@
|
||||
run_once: true
|
||||
|
||||
- name: Calculate kubeadm CA cert hash
|
||||
shell: set -o pipefail && openssl x509 -pubkey -in {{ kube_cert_dir }}/ca.crt | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -hex | sed 's/^.* //'
|
||||
shell: |
|
||||
set -o pipefail && openssl x509 -pubkey -in {{ kube_cert_dir }}/ca.crt | \
|
||||
openssl {% if 'RSA' in kube_asymmetric_encryption_algorithm %}rsa{% elif 'ECDSA' in kube_asymmetric_encryption_algorithm %}ec{% else %}rsa{% endif %} -pubin -outform der 2>/dev/null | \
|
||||
openssl dgst -sha256 -hex | sed 's/^.* //'
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: kubeadm_ca_hash
|
||||
|
||||
@@ -62,6 +62,11 @@ kubeadm_join_phases_skip: >-
|
||||
# Set to true to remove the role binding to anonymous users created by kubeadm
|
||||
remove_anonymous_access: false
|
||||
|
||||
# Supported asymmetric encryption algorithm types for the cluster's keys and certificates.
|
||||
# can be one of RSA-2048(default), RSA-3072, RSA-4096, ECDSA-P256
|
||||
# ref: https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-ClusterConfiguration
|
||||
kube_asymmetric_encryption_algorithm: "RSA-2048"
|
||||
|
||||
# A string slice of values which specify the addresses to use for NodePorts.
|
||||
# Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).
|
||||
# The default empty string slice ([]) means to use all local addresses.
|
||||
|
||||
Reference in New Issue
Block a user