Skip to content
Commits on Source (6)
...@@ -107,7 +107,7 @@ kubelet_systemd_hardening: true ...@@ -107,7 +107,7 @@ kubelet_systemd_hardening: true
# IP addresses, kubelet_secure_addresses allows you # IP addresses, kubelet_secure_addresses allows you
# to specify the IP from which the kubelet # to specify the IP from which the kubelet
# will receive the packets. # will receive the packets.
kubelet_secure_addresses: "192.168.10.110 192.168.10.111 192.168.10.112" kubelet_secure_addresses: "localhost link-local {{ kube_pods_subnet }} 192.168.10.110 192.168.10.111 192.168.10.112"
# additional configurations # additional configurations
kube_owner: root kube_owner: root
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
- name: Docker | Find docker packages - name: Docker | Find docker packages
set_fact: set_fact:
docker_packages_list: "{{ ansible_facts.packages.keys() | select('search', '^docker*') }}" docker_packages_list: "{{ ansible_facts.packages.keys() | select('search', '^docker+') }}"
containerd_package: "{{ ansible_facts.packages.keys() | select('search', '^containerd*') }}" containerd_package: "{{ ansible_facts.packages.keys() | select('search', '^containerd+') }}"
- name: Docker | Stop all running container - name: Docker | Stop all running container
shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -q | xargs -r {{ docker_bin_dir }}/docker kill" shell: "set -o pipefail && {{ docker_bin_dir }}/docker ps -q | xargs -r {{ docker_bin_dir }}/docker kill"
......
...@@ -5,7 +5,7 @@ kubelet_csr_approver_namespace: kube-system ...@@ -5,7 +5,7 @@ kubelet_csr_approver_namespace: kube-system
kubelet_csr_approver_repository_name: kubelet-csr-approver kubelet_csr_approver_repository_name: kubelet-csr-approver
kubelet_csr_approver_repository_url: https://postfinance.github.io/kubelet-csr-approver kubelet_csr_approver_repository_url: https://postfinance.github.io/kubelet-csr-approver
kubelet_csr_approver_chart_ref: "{{ kubelet_csr_approver_repository_name }}/kubelet-csr-approver" kubelet_csr_approver_chart_ref: "{{ kubelet_csr_approver_repository_name }}/kubelet-csr-approver"
kubelet_csr_approver_chart_version: 0.2.8 kubelet_csr_approver_chart_version: 1.1.0
# Fill values override here # Fill values override here
# See upstream https://github.com/postfinance/kubelet-csr-approver # See upstream https://github.com/postfinance/kubelet-csr-approver
......
...@@ -15,7 +15,6 @@ metadata: ...@@ -15,7 +15,6 @@ metadata:
kind: ClusterRole kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
# rename if there are conflicts
name: snapshot-controller-runner name: snapshot-controller-runner
rules: rules:
- apiGroups: [""] - apiGroups: [""]
...@@ -24,9 +23,6 @@ rules: ...@@ -24,9 +23,6 @@ rules:
- apiGroups: [""] - apiGroups: [""]
resources: ["persistentvolumeclaims"] resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"] verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""] - apiGroups: [""]
resources: ["events"] resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"] verbs: ["list", "watch", "create", "update", "patch"]
...@@ -35,13 +31,37 @@ rules: ...@@ -35,13 +31,37 @@ rules:
verbs: ["get", "list", "watch"] verbs: ["get", "list", "watch"]
- apiGroups: ["snapshot.storage.k8s.io"] - apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"] resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete"] verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents/status"]
verbs: ["patch"]
- apiGroups: ["snapshot.storage.k8s.io"] - apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"] resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update"] verbs: ["get", "list", "watch", "update", "patch", "delete"]
- apiGroups: ["snapshot.storage.k8s.io"] - apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status"] resources: ["volumesnapshots/status"]
verbs: ["update"] verbs: ["update", "patch"]
- apiGroups: ["groupsnapshot.storage.k8s.io"]
resources: ["volumegroupsnapshotclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["groupsnapshot.storage.k8s.io"]
resources: ["volumegroupsnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
- apiGroups: ["groupsnapshot.storage.k8s.io"]
resources: ["volumegroupsnapshotcontents/status"]
verbs: ["patch"]
- apiGroups: ["groupsnapshot.storage.k8s.io"]
resources: ["volumegroupsnapshots"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["groupsnapshot.storage.k8s.io"]
resources: ["volumegroupsnapshots/status"]
verbs: ["update", "patch"]
# Enable this RBAC rule only when using distributed snapshotting, i.e. when the enable-distributed-snapshotting flag is set to true
# - apiGroups: [""]
# resources: ["nodes"]
# verbs: ["get", "list", "watch"]
--- ---
kind: ClusterRoleBinding kind: ClusterRoleBinding
...@@ -54,7 +74,6 @@ subjects: ...@@ -54,7 +74,6 @@ subjects:
namespace: {{ snapshot_controller_namespace }} namespace: {{ snapshot_controller_namespace }}
roleRef: roleRef:
kind: ClusterRole kind: ClusterRole
# change the name also here if the ClusterRole gets renamed
name: snapshot-controller-runner name: snapshot-controller-runner
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
...@@ -62,12 +81,12 @@ roleRef: ...@@ -62,12 +81,12 @@ roleRef:
kind: Role kind: Role
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
metadata: metadata:
namespace: {{ snapshot_controller_namespace }}
name: snapshot-controller-leaderelection name: snapshot-controller-leaderelection
namespace: {{ snapshot_controller_namespace }}
rules: rules:
- apiGroups: ["coordination.k8s.io"] - apiGroups: ["coordination.k8s.io"]
resources: ["leases"] resources: ["leases"]
verbs: ["get", "watch", "list", "delete", "update", "create"] verbs: ["get", "watch", "list", "delete", "update", "create"]
--- ---
kind: RoleBinding kind: RoleBinding
......
...@@ -15,11 +15,12 @@ spec: ...@@ -15,11 +15,12 @@ spec:
replicas: {{ snapshot_controller_replicas }} replicas: {{ snapshot_controller_replicas }}
selector: selector:
matchLabels: matchLabels:
app: snapshot-controller app.kubernetes.io/name: snapshot-controller
# the snapshot controller won't be marked as ready if the v1 CRDs are unavailable # The snapshot controller won't be marked as ready if the v1 CRDs are unavailable.
# in #504 the snapshot-controller will exit after around 7.5 seconds if it # The flag --retry-crd-interval-max is used to determine how long the controller
# can't find the v1 CRDs so this value should be greater than that # will wait for the CRDs to become available before exiting. The default is 30 seconds
minReadySeconds: 15 # so minReadySeconds should be set slightly higher than the flag value.
minReadySeconds: 35
strategy: strategy:
rollingUpdate: rollingUpdate:
maxSurge: 0 maxSurge: 0
...@@ -28,13 +29,13 @@ spec: ...@@ -28,13 +29,13 @@ spec:
template: template:
metadata: metadata:
labels: labels:
app: snapshot-controller app.kubernetes.io/name: snapshot-controller
spec: spec:
serviceAccount: snapshot-controller serviceAccountName: snapshot-controller
containers: containers:
- name: snapshot-controller - name: snapshot-controller
image: {{ snapshot_controller_image_repo }}:{{ snapshot_controller_image_tag }} image: {{ snapshot_controller_image_repo }}:{{ snapshot_controller_image_tag }}
imagePullPolicy: {{ k8s_image_pull_policy }}
args: args:
- "--v=5" - "--v=5"
- "--leader-election=false" - "--leader-election={{ 'true' if snapshot_controller_replicas > 1 else 'false' }}"
imagePullPolicy: {{ k8s_image_pull_policy }}
...@@ -24,10 +24,11 @@ kubelet_kubelet_cgroups_cgroupfs: "/system.slice/kubelet.service" ...@@ -24,10 +24,11 @@ kubelet_kubelet_cgroups_cgroupfs: "/system.slice/kubelet.service"
kubelet_systemd_hardening: false kubelet_systemd_hardening: false
# List of secure IPs for kubelet # List of secure IPs for kubelet
kubelet_secure_addresses: >- kube_node_addresses: >-
{%- for host in groups['kube_control_plane'] -%} {%- for host in (groups['kube_control_plane'] + groups['kube_node'] + groups['etcd']) | unique -%}
{{ hostvars[host]['ip'] | default(fallback_ips[host]) }}{{ ' ' if not loop.last else '' }} {{ hostvars[host]['ip'] | default(fallback_ips[host]) }}{{ ' ' if not loop.last else '' }}
{%- endfor -%} {%- endfor -%}
kubelet_secure_addresses: "localhost link-local {{ kube_pods_subnet }} {{ kube_node_addresses }}"
# Reserve this space for kube resources # Reserve this space for kube resources
# Set to true to reserve resources for kube daemons # Set to true to reserve resources for kube daemons
......
...@@ -358,9 +358,9 @@ csi_livenessprobe_image_repo: "{{ kube_image_repo }}/sig-storage/livenessprobe" ...@@ -358,9 +358,9 @@ csi_livenessprobe_image_repo: "{{ kube_image_repo }}/sig-storage/livenessprobe"
csi_livenessprobe_image_tag: "v2.5.0" csi_livenessprobe_image_tag: "v2.5.0"
snapshot_controller_supported_versions: snapshot_controller_supported_versions:
v1.29: "v6.3.3" v1.29: "v7.0.2"
v1.28: "v4.2.1" v1.28: "v7.0.2"
v1.27: "v4.2.1" v1.27: "v7.0.2"
snapshot_controller_image_repo: "{{ kube_image_repo }}/sig-storage/snapshot-controller" snapshot_controller_image_repo: "{{ kube_image_repo }}/sig-storage/snapshot-controller"
snapshot_controller_image_tag: "{{ snapshot_controller_supported_versions[kube_major_version] }}" snapshot_controller_image_tag: "{{ snapshot_controller_supported_versions[kube_major_version] }}"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# do not run gather facts when bootstrap-os in roles # do not run gather facts when bootstrap-os in roles
when: > when: >
ansible_play_role_names | ansible_play_role_names |
intersect(['bootstrap-os', 'kubernetes-sigs.kubespray.bootstrap-os']) | intersect(['bootstrap-os', 'kubernetes_sigs.kubespray.bootstrap-os']) |
length == 0 length == 0
tags: tags:
- always - always
......
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
register: var_lib_kubelet_directory register: var_lib_kubelet_directory
- name: Reset | Find files/dirs with immutable flag in /var/lib/kubelet - name: Reset | Find files/dirs with immutable flag in /var/lib/kubelet
command: lsattr -laR /var/lib/kubelet command: lsattr -laR /var/lib/kubelet/
become: true become: true
register: var_lib_kubelet_files_dirs_w_attrs register: var_lib_kubelet_files_dirs_w_attrs
changed_when: false changed_when: false
......