Skip to content

Commit

Permalink
kubevirt and flux cli
Browse files Browse the repository at this point in the history
  • Loading branch information
kiemlicz committed Feb 23, 2024
1 parent a151b5b commit e6d4872
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
10 changes: 10 additions & 0 deletions salt/kubernetes/fluxcd/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{%- from "kubernetes/fluxcd/map.jinja" import kubernetes with context %}
include:
- kubernetes.master
fluxcd_cli:
cmd.script:
- name: {{ kubernetes.fluxcd.cli_url }}
- require:
- sls: kubernetes.master
9 changes: 9 additions & 0 deletions salt/kubernetes/fluxcd/map.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%- from "kubernetes/map.jinja" import kubernetes as kubernetes_defaults with context %}

{% set kubernetes = salt['grains.filter_by']({
'default': {
'fluxcd': {
'cli_url': "https://fluxcd.io/install.sh",
}
},
}, merge=kubernetes_defaults) %}
22 changes: 22 additions & 0 deletions salt/kubernetes/kubevirt/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{%- from "kubernetes/kubevirt/map.jinja" import kubernetes with context %}
{%- from "_common/util.jinja" import retry with context %}
include:
- kubernetes.master
kubevirt_operator_apply:
cmd.run:
- name: kubectl apply -f {{ kubernetes.kubevirt.operator }}
- env:
- KUBECONFIG: {{ kubernetes.config.locations|join(':') }}
{{ retry(attempts=3)| indent(4) }}
- require:
- sls: kubernetes.master
kubevirt_cr_apply:
cmd.run:
- name: kubectl apply -f {{ kubernetes.kubevirt.cr }}
- env:
- KUBECONFIG: {{ kubernetes.config.locations|join(':') }}
{{ retry(attempts=3)| indent(4) }}
- require:
- cmd: kubevirt_operator_apply
13 changes: 13 additions & 0 deletions salt/kubernetes/kubevirt/map.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{%- from "kubernetes/map.jinja" import kubernetes as kubernetes_defaults with context %}

{%- set kubevirt_version = "v1.1.1" %}

{% set kubernetes = salt['grains.filter_by']({
'default': {
'kubevirt': {
'version': kubevirt_version,
'operator': "https://github.com/kubevirt/kubevirt/releases/download/" ~ kubevirt_version ~ "/kubevirt-operator.yaml",
'cr': "https://github.com/kubevirt/kubevirt/releases/download/" ~ kubevirt_version ~ "/kubevirt-cr.yaml"
}
},
}, merge=kubernetes_defaults) %}

0 comments on commit e6d4872

Please sign in to comment.