diff --git a/ansible/kubernetes.yml b/ansible/kubernetes.yml index b0bae6c..4e24bb0 100644 --- a/ansible/kubernetes.yml +++ b/ansible/kubernetes.yml @@ -30,7 +30,8 @@ - name: Reconfigure Kubernetes nodes hosts: kubernetes vars: - KUBERNETES_VERSION: v1.29.7 + KUBERNETES_VERSION: v1.30.3 + IP: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" tasks: - name: Remove APT packages ansible.builtin.apt: @@ -156,14 +157,15 @@ ansible.builtin.shell: "sysctl --system" when: sysctl.changed -- name: Reconfigure Kubernetes master nodes - hosts: masters - vars: - KUBERNETES_VERSION: v1.28.12 - IP: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}" - tasks: - - name: Configure kube-apiserver manifest on masters + - name: Reconfigure kube-apiserver to use Passmower OIDC endpoint ansible.builtin.template: src: kube-apiserver.j2 dest: /etc/kubernetes/manifests/kube-apiserver.yaml mode: 600 + register: apiserver + when: + - inventory_hostname in groups["masters"] + + - name: Restart kube-apiserver + ansible.builtin.shell: "killall kube-apiserver" + when: apiserver.changed