From 9f01effadc24b17dcfd9767846b47efa9597d2ca Mon Sep 17 00:00:00 2001 From: ERIK Date: Thu, 28 Nov 2024 16:28:59 +0800 Subject: [PATCH] add encryptionAlgorithm for ClusterConfigration (#11751) Signed-off-by: bo.jiang --- roles/kubernetes/control-plane/defaults/main/main.yml | 5 +++++ .../control-plane/templates/kubeadm-config.v1beta4.yaml.j2 | 1 + 2 files changed, 6 insertions(+) diff --git a/roles/kubernetes/control-plane/defaults/main/main.yml b/roles/kubernetes/control-plane/defaults/main/main.yml index d3a28bc2154..00da94347d7 100644 --- a/roles/kubernetes/control-plane/defaults/main/main.yml +++ b/roles/kubernetes/control-plane/defaults/main/main.yml @@ -236,3 +236,8 @@ kube_apiserver_tracing_sampling_rate_per_million: 100 # Enable kubeadm file discovery if anonymous access has been removed kubeadm_use_file_discovery: "{{ remove_anonymous_access }}" + +# 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" diff --git a/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta4.yaml.j2 b/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta4.yaml.j2 index 1d5ac1d8f8f..be03b489f54 100644 --- a/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta4.yaml.j2 +++ b/roles/kubernetes/control-plane/templates/kubeadm-config.v1beta4.yaml.j2 @@ -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: