salt/states/cilium/init.sls
Pratyush Desai 44e070e30c
Initialize Salt
Added some state files to test.

Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
2025-06-22 03:55:21 +05:30

22 lines
825 B
Plaintext

# Deploys Cilium CNI on the Kubernetes cluster.
# This state should ONLY be applied to the control plane node after `kubeadm init`.
cilium_manifest_download:
cmd.run:
- name: 'curl -L {{ pillar["cilium_manifest_url"] }} -o /tmp/cilium-install.yaml'
- creates: '/tmp/cilium-install.yaml'
- require:
- cmd: kubernetes.control_plane.kubeadm_init
- env:
KUBECONFIG: /root/.kube/config
# Apply Cilium manifest
cilium_apply_manifest:
cmd.run:
- name: 'kubectl apply -f /tmp/cilium-install.yaml'
- env:
KUBECONFIG: /root/.kube/config
- unless: 'kubectl get pods -n kube-system -l k8s-app=cilium --field-selector=status.phase=Running | grep -q cilium'
- cmd: cilium_manifest_download # Ensure manifest is downloaded
- file: kubernetes.control_plane.kubeconfig_file