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