mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-01 17:48:12 -03:30
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56f9af8668 | ||
|
|
29d81f7617 | ||
|
|
2546eb2559 | ||
|
|
47af8b7ea5 | ||
|
|
2cc5f04bad | ||
|
|
d4d03a01f2 | ||
|
|
bdaa33c3bc | ||
|
|
58bea67b68 | ||
|
|
f091b1cfd7 |
@@ -134,6 +134,7 @@ cert_manager_enabled: false
|
|||||||
# -----BEGIN CERTIFICATE-----
|
# -----BEGIN CERTIFICATE-----
|
||||||
# [REPLACE with your CA certificate]
|
# [REPLACE with your CA certificate]
|
||||||
# -----END CERTIFICATE-----
|
# -----END CERTIFICATE-----
|
||||||
|
# cert_manager_leader_election_namespace: kube-system
|
||||||
|
|
||||||
# MetalLB deployment
|
# MetalLB deployment
|
||||||
metallb_enabled: false
|
metallb_enabled: false
|
||||||
|
|||||||
@@ -13,12 +13,6 @@ platforms:
|
|||||||
memory: 1024
|
memory: 1024
|
||||||
groups:
|
groups:
|
||||||
- kube_control_plane
|
- kube_control_plane
|
||||||
- name: centos7
|
|
||||||
box: centos/7
|
|
||||||
cpus: 2
|
|
||||||
memory: 1024
|
|
||||||
groups:
|
|
||||||
- kube_control_plane
|
|
||||||
- name: almalinux8
|
- name: almalinux8
|
||||||
box: almalinux/8
|
box: almalinux/8
|
||||||
cpus: 2
|
cpus: 2
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ download_delegate: "{% if download_localhost %}localhost{% else %}{{ groups['kub
|
|||||||
docker_image_pull_command: "{{ docker_bin_dir }}/docker pull"
|
docker_image_pull_command: "{{ docker_bin_dir }}/docker pull"
|
||||||
docker_image_info_command: "{{ docker_bin_dir }}/docker images -q | xargs -i {{ '{{' }} docker_bin_dir }}/docker inspect -f {% raw %}'{{ '{{' }} if .RepoTags }}{{ '{{' }} join .RepoTags \",\" }}{{ '{{' }} end }}{{ '{{' }} if .RepoDigests }},{{ '{{' }} join .RepoDigests \",\" }}{{ '{{' }} end }}' {% endraw %} {} | tr '\n' ','"
|
docker_image_info_command: "{{ docker_bin_dir }}/docker images -q | xargs -i {{ '{{' }} docker_bin_dir }}/docker inspect -f {% raw %}'{{ '{{' }} if .RepoTags }}{{ '{{' }} join .RepoTags \",\" }}{{ '{{' }} end }}{{ '{{' }} if .RepoDigests }},{{ '{{' }} join .RepoDigests \",\" }}{{ '{{' }} end }}' {% endraw %} {} | tr '\n' ','"
|
||||||
nerdctl_image_info_command: "{{ bin_dir }}/nerdctl -n k8s.io images --format '{% raw %}{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}{% endraw %}' 2>/dev/null | grep -v ^:$ | tr '\n' ','"
|
nerdctl_image_info_command: "{{ bin_dir }}/nerdctl -n k8s.io images --format '{% raw %}{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}{% endraw %}' 2>/dev/null | grep -v ^:$ | tr '\n' ','"
|
||||||
nerdctl_image_pull_command: "{{ bin_dir }}/nerdctl -n k8s.io pull --quiet"
|
nerdctl_image_pull_command: "{{ bin_dir }}/nerdctl -n k8s.io pull --quiet {{ nerdctl_extra_flags }}"
|
||||||
crictl_image_info_command: "{{ bin_dir }}/crictl images --verbose | awk -F ': ' '/RepoTags|RepoDigests/ {print $2}' | tr '\n' ','"
|
crictl_image_info_command: "{{ bin_dir }}/crictl images --verbose | awk -F ': ' '/RepoTags|RepoDigests/ {print $2}' | tr '\n' ','"
|
||||||
crictl_image_pull_command: "{{ bin_dir }}/crictl pull"
|
crictl_image_pull_command: "{{ bin_dir }}/crictl pull"
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ image_info_command_on_localhost: "{{ lookup('vars', image_command_tool_on_localh
|
|||||||
image_arch: "{{host_architecture | default('amd64')}}"
|
image_arch: "{{host_architecture | default('amd64')}}"
|
||||||
|
|
||||||
# Nerdctl insecure flag set
|
# Nerdctl insecure flag set
|
||||||
nerdctl_extra_flags: '{%- if containerd_insecure_registries is defined and containerd_insecure_registries|length>0 -%}\" --insecure-registry"{%- else -%}{%- endif -%}'
|
nerdctl_extra_flags: '{%- if containerd_insecure_registries is defined and containerd_insecure_registries|length>0 -%}--insecure-registry{%- else -%}{%- endif -%}'
|
||||||
|
|
||||||
# Versions
|
# Versions
|
||||||
kubeadm_version: "{{ kube_version }}"
|
kubeadm_version: "{{ kube_version }}"
|
||||||
|
|||||||
@@ -5,44 +5,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- facts
|
- facts
|
||||||
|
|
||||||
# The docker image_info_command might seems weird but we are using raw/endraw and `{{ `{{` }}` to manage the double jinja2 processing
|
|
||||||
# done here and when `image_info_command` is used (first the raw/endraw allow to store the command, then the second processing replace `{{`
|
|
||||||
- name: prep_download | Set image pull/info command for docker
|
|
||||||
set_fact:
|
|
||||||
image_pull_command: "{{ docker_bin_dir }}/docker pull"
|
|
||||||
image_info_command: "{{ docker_bin_dir }}/docker images -q | xargs -i {{ '{{' }} docker_bin_dir }}/docker inspect -f {% raw %}'{{ '{{' }} if .RepoTags }}{{ '{{' }} join .RepoTags \",\" }}{{ '{{' }} end }}{{ '{{' }} if .RepoDigests }},{{ '{{' }} join .RepoDigests \",\" }}{{ '{{' }} end }}' {% endraw %} {} | tr '\n' ','"
|
|
||||||
when: container_manager == 'docker'
|
|
||||||
|
|
||||||
- name: prep_download | Set image pull/info command for containerd
|
|
||||||
set_fact:
|
|
||||||
image_info_command: "{{ bin_dir }}/nerdctl -n k8s.io images --format '{% raw %}{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}{% endraw %}' 2>/dev/null | grep -v ^:$ | tr '\n' ','"
|
|
||||||
image_pull_command: "{{ bin_dir }}/nerdctl -n k8s.io pull --quiet{{ nerdctl_extra_flags }}"
|
|
||||||
when: container_manager == 'containerd'
|
|
||||||
|
|
||||||
- name: prep_download | Set image pull/info command for crio
|
|
||||||
set_fact:
|
|
||||||
image_info_command: "{{ bin_dir }}/crictl images --verbose | awk -F ': ' '/RepoTags|RepoDigests/ {print $2}' | tr '\n' ','"
|
|
||||||
image_pull_command: "{{ bin_dir }}/crictl pull"
|
|
||||||
when: container_manager == 'crio'
|
|
||||||
|
|
||||||
- name: prep_download | Set image pull/info command for docker on localhost
|
|
||||||
set_fact:
|
|
||||||
image_pull_command_on_localhost: "{{ docker_bin_dir }}/docker pull"
|
|
||||||
image_info_command_on_localhost: "{{ docker_bin_dir }}/docker images"
|
|
||||||
when: container_manager_on_localhost == 'docker'
|
|
||||||
|
|
||||||
- name: prep_download | Set image pull/info command for containerd on localhost
|
|
||||||
set_fact:
|
|
||||||
image_info_command_on_localhost: "{{ bin_dir }}/nerdctl -n k8s.io images --format '{% raw %}{{ '{{' }} .Repository {{ '}}' }}:{{ '{{' }} .Tag {{ '}}' }}{% endraw %}' 2>/dev/null | grep -v ^:$ | tr '\n' ','"
|
|
||||||
image_pull_command_on_localhost: "{{ bin_dir }}/nerdctl -n k8s.io pull --quiet{{ nerdctl_extra_flags }}"
|
|
||||||
when: container_manager_on_localhost == 'containerd'
|
|
||||||
|
|
||||||
- name: prep_download | Set image pull/info command for crio on localhost
|
|
||||||
set_fact:
|
|
||||||
image_info_command_on_localhost: "{{ bin_dir }}/crictl images --verbose | awk -F ': ' '/RepoTags|RepoDigests/ {print $2}' | tr '\n' ','"
|
|
||||||
image_pull_command_on_localhost: "{{ bin_dir }}/crictl pull"
|
|
||||||
when: container_manager_on_localhost == 'crio'
|
|
||||||
|
|
||||||
- name: prep_download | On localhost, check if passwordless root is possible
|
- name: prep_download | On localhost, check if passwordless root is possible
|
||||||
command: "true"
|
command: "true"
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ nodelocaldns_secondary_prometheus_port: 9255
|
|||||||
dns_autoscaler_cpu_requests: 20m
|
dns_autoscaler_cpu_requests: 20m
|
||||||
dns_autoscaler_memory_requests: 10Mi
|
dns_autoscaler_memory_requests: 10Mi
|
||||||
dns_autoscaler_deployment_nodeselector: "kubernetes.io/os: linux"
|
dns_autoscaler_deployment_nodeselector: "kubernetes.io/os: linux"
|
||||||
|
# dns_autoscaler_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
|
||||||
|
|
||||||
# etcd metrics
|
# etcd metrics
|
||||||
# etcd_metrics_service_labels:
|
# etcd_metrics_service_labels:
|
||||||
@@ -81,3 +82,6 @@ dashboard_master_toleration: true
|
|||||||
# Override dashboard default settings
|
# Override dashboard default settings
|
||||||
dashboard_token_ttl: 900
|
dashboard_token_ttl: 900
|
||||||
dashboard_skip_login: false
|
dashboard_skip_login: false
|
||||||
|
|
||||||
|
# Policy Controllers
|
||||||
|
# policy_controller_extra_tolerations: [{effect: NoSchedule, operator: "Exists"}]
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ spec:
|
|||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
- key: node-role.kubernetes.io/control-plane
|
- key: node-role.kubernetes.io/control-plane
|
||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
{% if dns_extra_tolerations | default(None) %}
|
{% if dns_extra_tolerations is defined %}
|
||||||
{{ dns_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
{{ dns_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
affinity:
|
affinity:
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ spec:
|
|||||||
key: node-role.kubernetes.io/master
|
key: node-role.kubernetes.io/master
|
||||||
- effect: NoSchedule
|
- effect: NoSchedule
|
||||||
key: node-role.kubernetes.io/control-plane
|
key: node-role.kubernetes.io/control-plane
|
||||||
|
{% if dns_autoscaler_extra_tolerations is defined %}
|
||||||
|
{{ dns_autoscaler_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
||||||
|
{% endif %}
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinity:
|
podAntiAffinity:
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
---
|
---
|
||||||
cert_manager_namespace: "cert-manager"
|
cert_manager_namespace: "cert-manager"
|
||||||
cert_manager_user: 1001
|
cert_manager_user: 1001
|
||||||
|
|
||||||
|
## Change leader election namespace when deploying on GKE Autopilot that forbid the changes on kube-system namespace.
|
||||||
|
## See https://github.com/jetstack/cert-manager/issues/3717
|
||||||
|
cert_manager_leader_election_namespace: kube-system
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager-cainjector:leaderelection
|
name: cert-manager-cainjector:leaderelection
|
||||||
namespace: {{ cert_manager_namespace }}
|
namespace: {{ cert_manager_leader_election_namespace }}
|
||||||
labels:
|
labels:
|
||||||
app: cainjector
|
app: cainjector
|
||||||
app.kubernetes.io/name: cainjector
|
app.kubernetes.io/name: cainjector
|
||||||
@@ -664,7 +664,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager:leaderelection
|
name: cert-manager:leaderelection
|
||||||
namespace: {{ cert_manager_namespace }}
|
namespace: {{ cert_manager_leader_election_namespace }}
|
||||||
labels:
|
labels:
|
||||||
app: cert-manager
|
app: cert-manager
|
||||||
app.kubernetes.io/name: cert-manager
|
app.kubernetes.io/name: cert-manager
|
||||||
@@ -719,7 +719,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager-cainjector:leaderelection
|
name: cert-manager-cainjector:leaderelection
|
||||||
namespace: {{ cert_manager_namespace }}
|
namespace: {{ cert_manager_leader_election_namespace }}
|
||||||
labels:
|
labels:
|
||||||
app: cainjector
|
app: cainjector
|
||||||
app.kubernetes.io/name: cainjector
|
app.kubernetes.io/name: cainjector
|
||||||
@@ -742,7 +742,7 @@ apiVersion: rbac.authorization.k8s.io/v1
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
name: cert-manager:leaderelection
|
name: cert-manager:leaderelection
|
||||||
namespace: {{ cert_manager_namespace }}
|
namespace: {{ cert_manager_leader_election_namespace }}
|
||||||
labels:
|
labels:
|
||||||
app: cert-manager
|
app: cert-manager
|
||||||
app.kubernetes.io/name: cert-manager
|
app.kubernetes.io/name: cert-manager
|
||||||
@@ -866,7 +866,7 @@ spec:
|
|||||||
imagePullPolicy: {{ k8s_image_pull_policy }}
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
||||||
args:
|
args:
|
||||||
- --v=2
|
- --v=2
|
||||||
- --leader-election-namespace=kube-system
|
- --leader-election-namespace={{ cert_manager_leader_election_namespace }}
|
||||||
env:
|
env:
|
||||||
- name: POD_NAMESPACE
|
- name: POD_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
@@ -928,7 +928,7 @@ spec:
|
|||||||
args:
|
args:
|
||||||
- --v=2
|
- --v=2
|
||||||
- --cluster-resource-namespace=$(POD_NAMESPACE)
|
- --cluster-resource-namespace=$(POD_NAMESPACE)
|
||||||
- --leader-election-namespace=kube-system
|
- --leader-election-namespace={{ cert_manager_leader_election_namespace }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 9402
|
- containerPort: 9402
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ spec:
|
|||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
- key: node-role.kubernetes.io/control-plane
|
- key: node-role.kubernetes.io/control-plane
|
||||||
effect: NoSchedule
|
effect: NoSchedule
|
||||||
|
{% if policy_controller_extra_tolerations is defined %}
|
||||||
|
{{ policy_controller_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
||||||
|
{% endif %}
|
||||||
priorityClassName: system-cluster-critical
|
priorityClassName: system-cluster-critical
|
||||||
containers:
|
containers:
|
||||||
- name: calico-kube-controllers
|
- name: calico-kube-controllers
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
marker: "# Ansible entries {mark}"
|
marker: "# Ansible entries {mark}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: Preinstall | propagate resolvconf to k8s components
|
notify: Preinstall | propagate resolvconf to k8s components
|
||||||
when: dhclientconffile is defined
|
|
||||||
|
|
||||||
- name: Configure dhclient hooks for resolv.conf (non-RH)
|
- name: Configure dhclient hooks for resolv.conf (non-RH)
|
||||||
template:
|
template:
|
||||||
|
|||||||
@@ -9,12 +9,10 @@
|
|||||||
state: absent
|
state: absent
|
||||||
backup: yes
|
backup: yes
|
||||||
marker: "# Ansible entries {mark}"
|
marker: "# Ansible entries {mark}"
|
||||||
when: dhclientconffile is defined
|
|
||||||
notify: Preinstall | propagate resolvconf to k8s components
|
notify: Preinstall | propagate resolvconf to k8s components
|
||||||
|
|
||||||
- name: Remove kubespray specific dhclient hook
|
- name: Remove kubespray specific dhclient hook
|
||||||
file:
|
file:
|
||||||
path: "{{ dhclienthookfile }}"
|
path: "{{ dhclienthookfile }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: dhclienthookfile is defined
|
|
||||||
notify: Preinstall | propagate resolvconf to k8s components
|
notify: Preinstall | propagate resolvconf to k8s components
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
when:
|
when:
|
||||||
- dns_mode != 'none'
|
- dns_mode != 'none'
|
||||||
- resolvconf_mode == 'host_resolvconf'
|
- resolvconf_mode == 'host_resolvconf'
|
||||||
|
- dhclientconffile is defined
|
||||||
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
||||||
tags:
|
tags:
|
||||||
- bootstrap-os
|
- bootstrap-os
|
||||||
@@ -84,6 +85,7 @@
|
|||||||
when:
|
when:
|
||||||
- dns_mode != 'none'
|
- dns_mode != 'none'
|
||||||
- resolvconf_mode != 'host_resolvconf'
|
- resolvconf_mode != 'host_resolvconf'
|
||||||
|
- dhclientconffile is defined
|
||||||
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
|
||||||
tags:
|
tags:
|
||||||
- bootstrap-os
|
- bootstrap-os
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ rbac_enabled: "{{ 'RBAC' in authorization_modes }}"
|
|||||||
kubelet_authentication_token_webhook: true
|
kubelet_authentication_token_webhook: true
|
||||||
|
|
||||||
# When enabled, access to the kubelet API requires authorization by delegation to the API server
|
# When enabled, access to the kubelet API requires authorization by delegation to the API server
|
||||||
kubelet_authorization_mode_webhook: true
|
kubelet_authorization_mode_webhook: false
|
||||||
|
|
||||||
# kubelet uses certificates for authenticating to the Kubernetes API
|
# kubelet uses certificates for authenticating to the Kubernetes API
|
||||||
# Automatically generate a new key and request a new certificate from the Kubernetes API as the current certificate approaches expiration
|
# Automatically generate a new key and request a new certificate from the Kubernetes API as the current certificate approaches expiration
|
||||||
|
|||||||
Reference in New Issue
Block a user