fix: prefix custom manifests with custom- and bump prom operator crd versions

Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
Devin Buhl committed 2023-05-08 15:08:56 -04:00
1 parent 4e4c03f7be
commit 3c0cefe264
6 files changed
+40 -39

No files matched your search

+24 -20
View File
@@ -30,30 +30,34 @@ k3s_registration_address: "{{ kubevip_address }}"
k3s_server_manifests_urls:
# Kube-vip
- url: https://raw.githubusercontent.com/kube-vip/kube-vip/main/docs/manifests/rbac.yaml
filename: kube-vip-rbac.yaml
filename: custom-kube-vip-rbac.yaml
# Tigera Operator
- url: https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/tigera-operator.yaml
filename: calico-tigera-operator.yaml
filename: custom-calico-tigera-operator.yaml
# Prometheus Operator
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
filename: prometheus-alertmanagerconfigs.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
filename: prometheus-alertmanagers.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
filename: prometheus-podmonitors.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
filename: prometheus-probes.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
filename: prometheus-prometheuses.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
filename: prometheus-prometheusrules.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
filename: prometheus-servicemonitors.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
filename: prometheus-thanosrulers.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
filename: custom-prometheus-alertmanagerconfigs.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
filename: custom-prometheus-alertmanagers.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
filename: custom-prometheus-podmonitors.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
filename: custom-prometheus-probes.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
filename: custom-prometheus-prometheuses.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
filename: custom-prometheus-prometheusrules.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
filename: custom-prometheus-servicemonitors.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml
filename: custom-prometheus-thanosrulers.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml
filename: custom-prometheus-scrapeconfigs.yaml
- url: https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.65.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml
filename: custom-prometheus-prometheusagents.yaml
# (list) A flat list of templates to deploy on the primary control plane
# /var/lib/rancher/k3s/server/manifests
k3s_server_manifests_templates:
- calico-installation.yaml.j2
- kube-vip-daemonset.yaml.j2
- custom-calico-installation.yaml.j2
- custom-kube-vip-daemonset.yaml.j2
+8 -19
View File
@@ -10,18 +10,6 @@
ansible.builtin.pause:
seconds: 5
tasks:
- name: Check if cluster is installed
check_mode: false
ansible.builtin.stat:
path: "/etc/rancher/k3s/config.yaml"
register: k3s_check_installed
- name: Set manifest facts
ansible.builtin.set_fact:
k3s_server_manifests_templates: []
k3s_server_manifests_urls: []
when: k3s_check_installed.stat.exists
- name: Install Kubernetes
ansible.builtin.include_role:
name: xanmanning.k3s
@@ -92,19 +80,20 @@
name: servicemonitors.monitoring.coreos.com
- kind: CustomResourceDefinition
name: thanosrulers.monitoring.coreos.com
- kind: CustomResourceDefinition
name: scrapeconfigs.monitoring.coreos.com
- kind: CustomResourceDefinition
name: prometheusagents.monitoring.coreos.com
when:
- k3s_server_manifests_templates | length > 0
or k3s_server_manifests_urls | length > 0
- k3s_control_node is defined
- k3s_control_node
# Cleaning up the manifests from the /var/lib/rancher/k3s/server/manifests
# directory is needed because k3s has an awesome "feature" to always deploy
# these on restarting the k3s systemd service. Removing them does NOT
# uninstall the manifests.
# Removing them means we can manage the lifecycle of these components
# outside of the /var/lib/rancher/k3s/server/manifests directory
# NOTE
# Cleaning up the manifests from the /var/lib/rancher/k3s/server/manifests directory
# is needed because k3s has an awesome "feature" to always re-deploy them when the k3s
# service is restarted. Removing them does not uninstall the manifests from your cluster.
- name: Remove deployed manifest templates
ansible.builtin.file:
+2
View File
@@ -28,12 +28,14 @@
public: true
vars:
k3s_state: uninstalled
- name: Gather list of CNI files
ansible.builtin.find:
paths: /etc/cni/net.d
patterns: "*"
hidden: true
register: directory_contents
- name: Delete CNI files
ansible.builtin.file:
path: "{{ item.path }}"
+6
View File
@@ -15,6 +15,7 @@
- name: Locale | Set timezone
community.general.timezone:
name: "{{ timezone | default('Etc/UTC') }}"
- name: Networking
block:
- name: Networking | Set hostname to inventory hostname
@@ -25,6 +26,7 @@
path: /etc/hosts
block: |
127.0.1.1 {{ inventory_hostname }}
- name: Packages | Fedora
block:
- name: Packages | Install required packages
@@ -36,6 +38,7 @@
ansible.builtin.dnf:
autoremove: true
when: ansible_facts['distribution'] == 'Fedora'
- name: Packages | Ubuntu
block:
- name: Packages | Install required packages
@@ -53,6 +56,7 @@
notify: Reboot
when: "'raspi' in ansible_kernel"
when: ansible_facts['distribution'] == 'Ubuntu'
- name: User Configuration
block:
- name: User Configuration | Add additional SSH public keys
@@ -60,6 +64,7 @@
user: "{{ ansible_user }}"
key: "{{ item }}"
loop: "{{ public_ssh_keys | default([]) }}"
- name: System Configuration (1)
block:
- name: System Configuration (1) | Disable firewalld | Fedora
@@ -80,6 +85,7 @@
ansible.builtin.systemd:
service: fstrim.timer
enabled: true
- name: System Configuration (2)
block:
- name: System Configuration (2) | Enable kernel modules now