feat: 声明 sandbox 双节点 K3s 集群
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
---
|
||||
- name: Wait for the K3s server manifest directory
|
||||
ansible.builtin.wait_for:
|
||||
path: /var/lib/rancher/k3s/server/manifests
|
||||
state: present
|
||||
timeout: 120
|
||||
|
||||
- name: Download the pinned Flux controller manifest
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ sandbox_flux_install_url }}"
|
||||
dest: /var/lib/rancher/k3s/server/manifests/flux-install.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
timeout: 120
|
||||
|
||||
- name: Read the installed homelab CA
|
||||
ansible.builtin.slurp:
|
||||
src: /usr/local/share/ca-certificates/ddupan-internal-ca.crt
|
||||
register: sandbox_flux_ca
|
||||
no_log: true
|
||||
|
||||
- name: Install the Flux source and root sync manifest
|
||||
ansible.builtin.template:
|
||||
src: flux-sync.yaml.j2
|
||||
dest: /var/lib/rancher/k3s/server/manifests/flux-sync.yaml
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
no_log: true
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: flux-system
|
||||
namespace: flux-system
|
||||
type: Opaque
|
||||
stringData:
|
||||
caFile: |
|
||||
{{ sandbox_flux_ca.content | b64decode | indent(4, true) }}
|
||||
---
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: GitRepository
|
||||
metadata:
|
||||
name: flux-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m
|
||||
ref:
|
||||
branch: {{ sandbox_flux_repository_branch }}
|
||||
secretRef:
|
||||
name: flux-system
|
||||
timeout: 60s
|
||||
url: {{ sandbox_flux_repository_url }}
|
||||
---
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: flux-system
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 10m
|
||||
path: {{ sandbox_flux_path }}
|
||||
prune: false
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: flux-system
|
||||
timeout: 3m
|
||||
wait: true
|
||||
Reference in New Issue
Block a user