Merge pull request #109 from ClementGautier/kubeadm-config-improvement

Add way to configure KubeProxy configuration
This commit is contained in:
Jeff Geerling 2021-08-16 14:51:16 -05:00 committed by GitHub
commit 7fbb73022a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -65,6 +65,10 @@ NOTE: This is the recommended way to do the kubelet-configuration. Most command-
NOTE: The recommended cgroupDriver depends on your [Container Runtime](https://kubernetes.io/docs/setup/production-environment/container-runtimes). When using this role with containerd instead of docker, this value should be changed to `systemd`. NOTE: The recommended cgroupDriver depends on your [Container Runtime](https://kubernetes.io/docs/setup/production-environment/container-runtimes). When using this role with containerd instead of docker, this value should be changed to `systemd`.
kubernetes_config_kube_proxy_configuration: {}
Options under `kind: KubeProxyConfiguration`.
### Variables to configure kubeadm and kubelet through command-line-options ### Variables to configure kubeadm and kubelet through command-line-options
kubernetes_kubelet_extra_args: "" kubernetes_kubelet_extra_args: ""

View File

@ -48,6 +48,8 @@ kubernetes_config_cluster_configuration:
podSubnet: "{{ kubernetes_pod_network.cidr }}" podSubnet: "{{ kubernetes_pod_network.cidr }}"
kubernetesVersion: "{{ kubernetes_version_kubeadm }}" kubernetesVersion: "{{ kubernetes_version_kubeadm }}"
kubernetes_config_kube_proxy_configuration: {}
kubernetes_apiserver_advertise_address: '' kubernetes_apiserver_advertise_address: ''
kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}' kubernetes_version_kubeadm: 'stable-{{ kubernetes_version }}'
kubernetes_ignore_preflight_errors: 'all' kubernetes_ignore_preflight_errors: 'all'

View File

@ -6,9 +6,15 @@ kind: InitConfiguration
kind: ClusterConfiguration kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta2
{{ kubernetes_config_cluster_configuration | to_nice_yaml }} {{ kubernetes_config_cluster_configuration | to_nice_yaml }}
---
{% if kubernetes_config_kubelet_configuration|length > 0 %} {% if kubernetes_config_kubelet_configuration|length > 0 %}
---
apiVersion: kubelet.config.k8s.io/v1beta1 apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration kind: KubeletConfiguration
{{ kubernetes_config_kubelet_configuration | to_nice_yaml }} {{ kubernetes_config_kubelet_configuration | to_nice_yaml }}
{% endif %} {% endif %}
{% if kubernetes_config_kube_proxy_configuration|length > 0 %}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
{{ kubernetes_config_kube_proxy_configuration | to_nice_yaml }}
{% endif %}