From ebbb961d6d4e61eebe5000c418139eb8d509f3d5 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 10 Oct 2022 10:18:33 +0200 Subject: [PATCH] updated kubernetes state --- states/kubernetes/containerd.sls | 4 ---- states/kubernetes/defaults.yaml | 4 ++++ states/kubernetes/service.sls | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/states/kubernetes/containerd.sls b/states/kubernetes/containerd.sls index fe3be15..c52f884 100644 --- a/states/kubernetes/containerd.sls +++ b/states/kubernetes/containerd.sls @@ -7,7 +7,3 @@ kubernetes-containerd-conf: - template: jinja - watch_in: - service: kubernetes-containerd-service - -kubernetes-containerd-reset-cni: - file.absent: - - name: /etc/cni/net.d/10-flannel.conflist diff --git a/states/kubernetes/defaults.yaml b/states/kubernetes/defaults.yaml index c86ed26..c70589c 100644 --- a/states/kubernetes/defaults.yaml +++ b/states/kubernetes/defaults.yaml @@ -14,3 +14,7 @@ kubernetes: net.ipv4.ip_forward: 1 net.ipv6.conf.all.forwarding: 1 net.ipv6.conf.all.disable_ipv6: 0 + services: + - kubelet + - containerd + - systemd-resolved diff --git a/states/kubernetes/service.sls b/states/kubernetes/service.sls index 67c55c6..2dc9fdb 100644 --- a/states/kubernetes/service.sls +++ b/states/kubernetes/service.sls @@ -1,10 +1,8 @@ --- {%- from "kubernetes/map.jinja" import kubernetes with context %} -kubernetes-containerd-service: +{%- for service in kubernetes.services %} +kubernetes-{{ service }}-service: service.running: - - name: containerd - -kubernetes-systemd-resolved: - service.running: - - name: systemd-resolved + - name: {{ service }} - enable: true +{%- endfor %}