Skip to content

Commit dba757c

Browse files
authored
31.0.0+1.34.4 (#61)
* update min_ansible_version to 2.15 * use own githubixx Vagrant boxes * replace injected ansible_* facts usage with ansible_facts[...] (prepares for ansible-core 2.24 where INJECT_FACTS_AS_VARS default changes) * Molecule verify: check worker services healthy * Verify on each worker: kubelet and kube-proxy services are enabled/running, and their config files exist with expected permissions / node joined and Ready * Molecule verify: from control host, assert each worker appears in kubectl get nodes and is Ready * Molecule verify: check if role configuration is applied * Molecule: Assert expected kubelet/kube-proxy settings from this role are present (e.g., kubelet config path, kube-proxy mode/config path), not just service status. * Molecule: check binary/version consistency * Molecule verify: check if certificates/kubeconfigs are present * Molecule verify: validate worker certs + kubeconfig files exist and are readable by root only as expected * Molecule verify: add smoke test * update README/CHANGELOG * fix typo in README
1 parent 79ab30c commit dba757c

9 files changed

Lines changed: 508 additions & 31 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 31.0.0+1.34.4
4+
5+
- **UPDATE**
6+
- update `k8s_ctl_release` to `1.34.4`
7+
8+
- **OTHER**
9+
- replace injected `ansible_*` facts usage with `ansible_facts[...]` (prepares for ansible-core 2.24 where `INJECT_FACTS_AS_VARS` default changes)
10+
11+
- **MOLECULE**
12+
- use own [githubixx Vagrant boxes](https://portal.cloud.hashicorp.com/vagrant/discover/githubixx)
13+
- add more checks in `verify.yml`
14+
315
## 30.0.0+1.33.6
416

517
- **UPDATE**

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This Ansible role is used in [Kubernetes the not so hard way with Ansible - Work
44

55
## Versions
66

7-
I tag every release and try to stay with [semantic versioning](http://semver.org). If you want to use the role I recommend to checkout the latest tag. The master branch is basically development while the tags mark stable releases. But in general I try to keep master in good shape too. A tag `30.0.0+1.33.6` means this is release `30.0.0` of this role and it's meant to be used with Kubernetes version `1.33.6` (but should work with any K8s 1.33.x release of course). If the role itself changes `X.Y.Z` before `+` will increase. If the Kubernetes version changes `X.Y.Z` after `+` will increase too. This allows to tag bugfixes and new major versions of the role while it's still developed for a specific Kubernetes release. That's especially useful for Kubernetes major releases with breaking changes.
7+
I tag every release and try to stay with [semantic versioning](http://semver.org). If you want to use the role I recommend to checkout the latest tag. The master branch is basically development while the tags mark stable releases. But in general I try to keep master in good shape too. A tag `31.0.0+1.34.4` means this is release `31.0.0` of this role and it's meant to be used with Kubernetes version `1.34.4` (but should work with any K8s 1.34.x release of course). If the role itself changes `X.Y.Z` before `+` will increase. If the Kubernetes version changes `X.Y.Z` after `+` will increase too. This allows to tag bugfixes and new major versions of the role while it's still developed for a specific Kubernetes release. That's especially useful for Kubernetes major releases with breaking changes.
88

99
## Requirements
1010

@@ -27,6 +27,18 @@ See full [CHANGELOG.md](https://github.com/githubixx/ansible-role-kubernetes-wor
2727

2828
**Recent changes:**
2929

30+
## 31.0.0+1.34.4
31+
32+
- **UPDATE**
33+
- update `k8s_ctl_release` to `1.34.4`
34+
35+
- **OTHER**
36+
- replace injected `ansible_*` facts usage with `ansible_facts[...]` (prepares for ansible-core 2.24 where `INJECT_FACTS_AS_VARS` default changes)
37+
38+
- **MOLECULE**
39+
- use own [githubixx Vagrant boxes](https://portal.cloud.hashicorp.com/vagrant/discover/githubixx)
40+
- add more checks in `verify.yml`
41+
3042
## 30.0.0+1.33.6
3143

3244
- **UPDATE**
@@ -99,7 +111,7 @@ See full [CHANGELOG.md](https://github.com/githubixx/ansible-role-kubernetes-wor
99111
roles:
100112
- name: githubixx.kubernetes_worker
101113
src: https://github.com/githubixx/ansible-role-kubernetes-worker.git
102-
version: 30.0.0+1.33.6
114+
version: 31.0.0+1.34.4
103115
```
104116
105117
## Role Variables
@@ -127,7 +139,7 @@ k8s_worker_pki_dir: "{{ k8s_worker_conf_dir }}/pki"
127139
k8s_worker_bin_dir: "/usr/local/bin"
128140

129141
# K8s release
130-
k8s_worker_release: "1.33.6"
142+
k8s_worker_release: "1.34.4"
131143

132144
# The interface on which the Kubernetes services should listen on. As all cluster
133145
# communication should use a VPN interface the interface name is
@@ -166,7 +178,7 @@ k8s_ca_conf_directory: "{{ '~/k8s/certs' | expanduser }}"
166178
# variable of https://github.com/githubixx/ansible-role-kubernetes-ca
167179
# role). If it's not specified you'll get certificate errors in the
168180
# logs of the services mentioned above.
169-
k8s_worker_api_endpoint_host: "{% set controller_host = groups['k8s_controller'][0] %}{{ hostvars[controller_host]['ansible_' + hostvars[controller_host]['k8s_interface']].ipv4.address }}"
181+
k8s_worker_api_endpoint_host: "{% set controller_host = groups['k8s_controller'][0] %}{{ hostvars[controller_host]['ansible_facts'][hostvars[controller_host]['k8s_interface']]['ipv4']['address'] }}"
170182

171183
# As above just for the port. It specifies on which port the
172184
# Kubernetes API servers are listening. Again if there is a loadbalancer
@@ -203,14 +215,14 @@ k8s_worker_kubelet_conf_dir: "{{ k8s_worker_conf_dir }}/kubelet"
203215
# https://kubernetes.io/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads
204216
k8s_worker_kubelet_settings:
205217
"config": "{{ k8s_worker_kubelet_conf_dir }}/kubelet-config.yaml"
206-
"node-ip": "{{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}"
218+
"node-ip": "{{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}"
207219
"kubeconfig": "{{ k8s_worker_kubelet_conf_dir }}/kubeconfig"
208220

209221
# kubelet kubeconfig
210222
k8s_worker_kubelet_conf_yaml: |
211223
kind: KubeletConfiguration
212224
apiVersion: kubelet.config.k8s.io/v1beta1
213-
address: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}
225+
address: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}
214226
authentication:
215227
anonymous:
216228
enabled: false
@@ -224,7 +236,7 @@ k8s_worker_kubelet_conf_yaml: |
224236
clusterDNS:
225237
- "10.32.0.254"
226238
failSwapOn: true
227-
healthzBindAddress: "{{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}"
239+
healthzBindAddress: "{{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}"
228240
healthzPort: 10248
229241
runtimeRequestTimeout: "15m"
230242
serializeImagePulls: false
@@ -244,10 +256,10 @@ k8s_worker_kubeproxy_settings:
244256
k8s_worker_kubeproxy_conf_yaml: |
245257
kind: KubeProxyConfiguration
246258
apiVersion: kubeproxy.config.k8s.io/v1alpha1
247-
bindAddress: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}
259+
bindAddress: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}
248260
clientConnection:
249261
kubeconfig: "{{ k8s_worker_kubeproxy_conf_dir }}/kubeconfig"
250-
healthzBindAddress: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}:10256
262+
healthzBindAddress: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}:10256
251263
mode: "ipvs"
252264
ipvs:
253265
minSyncPeriod: 0s

defaults/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ k8s_worker_pki_dir: "{{ k8s_worker_conf_dir }}/pki"
2121
k8s_worker_bin_dir: "/usr/local/bin"
2222

2323
# K8s release
24-
k8s_worker_release: "1.33.6"
24+
k8s_worker_release: "1.34.4"
2525

2626
# The interface on which the Kubernetes services should listen on. As all cluster
2727
# communication should use a VPN interface the interface name is
@@ -60,7 +60,7 @@ k8s_ca_conf_directory: "{{ '~/k8s/certs' | expanduser }}"
6060
# variable of https://github.com/githubixx/ansible-role-kubernetes-ca
6161
# role). If it's not specified you'll get certificate errors in the
6262
# logs of the services mentioned above.
63-
k8s_worker_api_endpoint_host: "{{ hostvars[groups['k8s_controller'] | first]['ansible_' + hostvars[groups['k8s_controller'] | first]['k8s_interface']].ipv4.address }}"
63+
k8s_worker_api_endpoint_host: "{{ hostvars[groups['k8s_controller'] | first]['ansible_facts'][hostvars[groups['k8s_controller'] | first]['k8s_interface']]['ipv4']['address'] }}"
6464

6565
# As above just for the port. It specifies on which port the
6666
# Kubernetes API servers are listening. Again if there is a loadbalancer
@@ -97,14 +97,14 @@ k8s_worker_kubelet_conf_dir: "{{ k8s_worker_conf_dir }}/kubelet"
9797
# https://kubernetes.io/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads
9898
k8s_worker_kubelet_settings:
9999
"config": "{{ k8s_worker_kubelet_conf_dir }}/kubelet-config.yaml"
100-
"node-ip": "{{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}"
100+
"node-ip": "{{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}"
101101
"kubeconfig": "{{ k8s_worker_kubelet_conf_dir }}/kubeconfig"
102102

103103
# kubelet kubeconfig
104104
k8s_worker_kubelet_conf_yaml: |
105105
kind: KubeletConfiguration
106106
apiVersion: kubelet.config.k8s.io/v1beta1
107-
address: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}
107+
address: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}
108108
authentication:
109109
anonymous:
110110
enabled: false
@@ -118,7 +118,7 @@ k8s_worker_kubelet_conf_yaml: |
118118
clusterDNS:
119119
- "10.32.0.254"
120120
failSwapOn: true
121-
healthzBindAddress: "{{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}"
121+
healthzBindAddress: "{{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}"
122122
healthzPort: 10248
123123
runtimeRequestTimeout: "15m"
124124
serializeImagePulls: false
@@ -138,10 +138,10 @@ k8s_worker_kubeproxy_settings:
138138
k8s_worker_kubeproxy_conf_yaml: |
139139
kind: KubeProxyConfiguration
140140
apiVersion: kubeproxy.config.k8s.io/v1alpha1
141-
bindAddress: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}
141+
bindAddress: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}
142142
clientConnection:
143143
kubeconfig: "{{ k8s_worker_kubeproxy_conf_dir }}/kubeconfig"
144-
healthzBindAddress: {{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}:10256
144+
healthzBindAddress: {{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}:10256
145145
mode: "ipvs"
146146
ipvs:
147147
minSyncPeriod: 0s

meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ galaxy_info:
33
author: Robert Wimmer
44
description: Installs Kubernetes worker.
55
license: GPLv3
6-
min_ansible_version: "2.9"
6+
min_ansible_version: "2.15"
77
role_name: kubernetes_worker
88
namespace: githubixx
99
platforms:

molecule/default/group_vars/all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ k8s_apiserver_settings_user:
118118

119119
k8s_worker_kubelet_settings:
120120
"config": "{{ k8s_worker_kubelet_conf_dir }}/kubelet-config.yaml"
121-
"node-ip": "{{ hostvars[inventory_hostname]['ansible_' + k8s_interface].ipv4.address }}"
121+
"node-ip": "{{ hostvars[inventory_hostname]['ansible_facts'][k8s_interface]['ipv4']['address'] }}"
122122
"kubeconfig": "{{ k8s_worker_kubelet_conf_dir }}/kubeconfig"
123123
"seccomp-default": ""
124124

molecule/default/molecule.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
# Copyright (C) 2023 Robert Wimmer
2+
# Copyright (C) 2023-2026 Robert Wimmer
33
# SPDX-License-Identifier: GPL-3.0-or-later
44

55
dependency:
@@ -13,7 +13,7 @@ driver:
1313

1414
platforms:
1515
- name: test-assets
16-
box: alvistack/ubuntu-22.04
16+
box: githubixx/ubuntu-24.04
1717
memory: 2048
1818
cpus: 2
1919
groups:
@@ -26,7 +26,7 @@ platforms:
2626
type: static
2727
ip: 172.16.10.5
2828
- name: test-controller1
29-
box: alvistack/ubuntu-22.04
29+
box: githubixx/ubuntu-22.04
3030
memory: 2048
3131
cpus: 2
3232
groups:
@@ -41,7 +41,7 @@ platforms:
4141
type: static
4242
ip: 172.16.10.10
4343
- name: test-controller2
44-
box: alvistack/ubuntu-22.04
44+
box: githubixx/ubuntu-22.04
4545
memory: 2048
4646
cpus: 2
4747
groups:
@@ -56,7 +56,7 @@ platforms:
5656
type: static
5757
ip: 172.16.10.20
5858
- name: test-controller3
59-
box: alvistack/ubuntu-24.04
59+
box: githubixx/ubuntu-24.04
6060
memory: 2048
6161
cpus: 2
6262
groups:
@@ -70,7 +70,7 @@ platforms:
7070
type: static
7171
ip: 172.16.10.30
7272
- name: test-etcd1
73-
box: alvistack/ubuntu-22.04
73+
box: githubixx/ubuntu-24.04
7474
memory: 2048
7575
cpus: 2
7676
groups:
@@ -82,7 +82,7 @@ platforms:
8282
type: static
8383
ip: 172.16.10.100
8484
- name: test-etcd2
85-
box: alvistack/ubuntu-22.04
85+
box: githubixx/ubuntu-24.04
8686
memory: 2048
8787
cpus: 2
8888
groups:
@@ -94,7 +94,7 @@ platforms:
9494
type: static
9595
ip: 172.16.10.110
9696
- name: test-etcd3
97-
box: alvistack/ubuntu-22.04
97+
box: githubixx/ubuntu-24.04
9898
memory: 2048
9999
cpus: 2
100100
groups:
@@ -106,7 +106,7 @@ platforms:
106106
type: static
107107
ip: 172.16.10.120
108108
- name: test-worker1
109-
box: alvistack/ubuntu-22.04
109+
box: githubixx/ubuntu-22.04
110110
memory: 2048
111111
cpus: 2
112112
groups:
@@ -120,7 +120,7 @@ platforms:
120120
type: static
121121
ip: 172.16.10.200
122122
- name: test-worker2
123-
box: alvistack/ubuntu-24.04
123+
box: githubixx/ubuntu-24.04
124124
memory: 2048
125125
cpus: 2
126126
groups:

0 commit comments

Comments
 (0)