feat: move installing prom operator crds to taskfile
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
4 files changed
+22
-37
No files matched your search
@@ -224,6 +224,7 @@
|
|||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"description": "Process various other dependencies",
|
"description": "Process various other dependencies",
|
||||||
"fileMatch": [
|
"fileMatch": [
|
||||||
|
"(^|/).taskfiles/.+\\.ya?ml$",
|
||||||
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
|
|||||||
@@ -1,26 +1,31 @@
|
|||||||
---
|
---
|
||||||
version: "3"
|
version: "3"
|
||||||
|
|
||||||
tasks:
|
vars:
|
||||||
|
# renovate: datasource=github-releases depName=prometheus-operator/prometheus-operator
|
||||||
|
PROMETHEUS_OPERATOR_VERSION: "v0.70.0"
|
||||||
|
|
||||||
verify:
|
tasks:
|
||||||
desc: Verify flux meets the prerequisites
|
|
||||||
cmd: flux check --pre
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
desc: Install Flux into your cluster
|
desc: Install Flux into your cluster
|
||||||
cmds:
|
cmds:
|
||||||
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/bootstrap
|
# Install essential Prometheus Operator CRDs
|
||||||
|
- kubectl apply --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{ .PROMETHEUS_OPERATOR_VERSION }}/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
|
||||||
|
- kubectl apply --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{ .PROMETHEUS_OPERATOR_VERSION }}/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
|
||||||
|
- kubectl apply --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{ .PROMETHEUS_OPERATOR_VERSION }}/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
|
||||||
|
- kubectl apply --server-side --filename https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/{{ .PROMETHEUS_OPERATOR_VERSION }}/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
|
||||||
|
# Install Flux
|
||||||
|
- kubectl apply --server-side --kustomize {{.KUBERNETES_DIR}}/bootstrap
|
||||||
- cat {{.SOPS_AGE_KEY_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
- cat {{.SOPS_AGE_KEY_FILE}} | kubectl -n flux-system create secret generic sops-age --from-file=age.agekey=/dev/stdin
|
||||||
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply -f -
|
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets.sops.yaml | kubectl apply --server-side --filename -
|
||||||
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets-user.sops.yaml | kubectl apply -f -
|
- sops --decrypt {{.KUBERNETES_DIR}}/flux/vars/cluster-secrets-user.sops.yaml | kubectl apply --server-side --filename -
|
||||||
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml
|
- kubectl apply --server-side --filename {{.KUBERNETES_DIR}}/flux/vars/cluster-settings.yaml
|
||||||
- kubectl apply -f {{.KUBERNETES_DIR}}/flux/vars/cluster-settings-user.yaml
|
- kubectl apply --server-side --filename {{.KUBERNETES_DIR}}/flux/vars/cluster-settings-user.yaml
|
||||||
- kubectl apply --kustomize {{.KUBERNETES_DIR}}/flux/config
|
- kubectl apply --server-side --kustomize {{.KUBERNETES_DIR}}/flux/config
|
||||||
preconditions:
|
preconditions:
|
||||||
- sh: test -f {{.SOPS_AGE_KEY_FILE}}
|
- sh: test -f {{.SOPS_AGE_KEY_FILE}}
|
||||||
msg: |
|
msg: Age key file is not found. Did you forget to create it?
|
||||||
Age key file is not found. Did you forget to create it?
|
|
||||||
vars:
|
vars:
|
||||||
SOPS_AGE_KEY_FILE: "{{.ROOT_DIR}}/age.key"
|
SOPS_AGE_KEY_FILE: "{{.ROOT_DIR}}/age.key"
|
||||||
|
|
||||||
@@ -28,12 +33,6 @@ tasks:
|
|||||||
desc: Force update Flux to pull in changes from your Git repository
|
desc: Force update Flux to pull in changes from your Git repository
|
||||||
cmd: flux reconcile -n flux-system kustomization cluster --with-source
|
cmd: flux reconcile -n flux-system kustomization cluster --with-source
|
||||||
|
|
||||||
hr-restart:
|
|
||||||
desc: Restart all failed Helm Releases
|
|
||||||
cmds:
|
|
||||||
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux suspend hr $0 -n $1'
|
|
||||||
- kubectl get hr --all-namespaces | grep False | awk '{print $2, $1}' | xargs -L1 bash -c 'flux resume hr $0 -n $1'
|
|
||||||
|
|
||||||
nodes:
|
nodes:
|
||||||
desc: List all the nodes in your cluster
|
desc: List all the nodes in your cluster
|
||||||
cmd: kubectl get nodes {{.CLI_ARGS | default "-o wide"}}
|
cmd: kubectl get nodes {{.CLI_ARGS | default "-o wide"}}
|
||||||
|
|||||||
@@ -15,21 +15,6 @@ k3s_etcd_datastore: true
|
|||||||
k3s_etcd_datastore: false
|
k3s_etcd_datastore: false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
k3s_registration_address: "{% raw %}{{ kube_vip_addr }}{% endraw %}"
|
k3s_registration_address: "{% raw %}{{ kube_vip_addr }}{% endraw %}"
|
||||||
k3s_server_manifests_urls:
|
|
||||||
{% if bootstrap_kube_vip_enabled | default(true) %}
|
|
||||||
# Kube-vip RBAC
|
|
||||||
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
|
||||||
filename: kube-vip-rbac.yaml
|
|
||||||
{% endif %}
|
|
||||||
# Essential Prometheus Operator CRDs (the rest are installed with the kube-prometheus-stack helm release)
|
|
||||||
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
|
|
||||||
filename: custom-prometheus-podmonitors.yaml
|
|
||||||
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
|
|
||||||
filename: custom-prometheus-prometheusrules.yaml
|
|
||||||
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
|
|
||||||
filename: custom-prometheus-scrapeconfigs.yaml
|
|
||||||
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.70.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
|
|
||||||
filename: custom-prometheus-servicemonitors.yaml
|
|
||||||
# /var/lib/rancher/k3s/server/manifests
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
k3s_server_manifests_templates:
|
k3s_server_manifests_templates:
|
||||||
- custom-cilium-helmchart.yaml.j2
|
- custom-cilium-helmchart.yaml.j2
|
||||||
@@ -38,6 +23,10 @@ k3s_server_manifests_templates:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
- custom-coredns-helmchart.yaml.j2
|
- custom-coredns-helmchart.yaml.j2
|
||||||
{% if bootstrap_kube_vip_enabled | default(true) %}
|
{% if bootstrap_kube_vip_enabled | default(true) %}
|
||||||
|
# /var/lib/rancher/k3s/server/manifests
|
||||||
|
k3s_server_manifests_urls:
|
||||||
|
- url: https://raw.githubusercontent.com/kube-vip/website/main/content/manifests/rbac.yaml
|
||||||
|
filename: kube-vip-rbac.yaml
|
||||||
# /var/lib/rancher/k3s/agent/pod-manifests
|
# /var/lib/rancher/k3s/agent/pod-manifests
|
||||||
k3s_server_pod_manifests_templates:
|
k3s_server_pod_manifests_templates:
|
||||||
- kube-vip-static-pod.yaml.j2
|
- kube-vip-static-pod.yaml.j2
|
||||||
|
|||||||
@@ -52,10 +52,6 @@
|
|||||||
- { name: policy, kind: CiliumL2AnnouncementPolicy }
|
- { name: policy, kind: CiliumL2AnnouncementPolicy }
|
||||||
- { name: pool, kind: CiliumLoadBalancerIPPool }
|
- { name: pool, kind: CiliumLoadBalancerIPPool }
|
||||||
{% endif %}
|
{% endif %}
|
||||||
- { name: podmonitors.monitoring.coreos.com, kind: CustomResourceDefinition }
|
|
||||||
- { name: prometheusrules.monitoring.coreos.com, kind: CustomResourceDefinition }
|
|
||||||
- { name: scrapeconfigs.monitoring.coreos.com, kind: CustomResourceDefinition }
|
|
||||||
- { name: servicemonitors.monitoring.coreos.com, kind: CustomResourceDefinition }
|
|
||||||
|
|
||||||
- name: Coredns
|
- name: Coredns
|
||||||
when: k3s_primary_control_node
|
when: k3s_primary_control_node
|
||||||
|
|||||||
Reference in new issue
Block a user