-
Notifications
You must be signed in to change notification settings - Fork 0
/
zarf.yaml
99 lines (91 loc) · 3.52 KB
/
zarf.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/main/zarf.schema.json
kind: ZarfPackageConfig
metadata:
name: uds-k3d
description: "UDS K3d Cluster Setup. WARNING: This will destroy the cluster if it already exists."
url: https://github.com/defenseunicorns/uds-k3d
yolo: true
# x-release-please-start-version
version: "0.9.0"
# x-release-please-end
variables:
- name: CLUSTER_NAME
description: "Name of the cluster"
default: "uds"
- name: K3D_IMAGE
description: "K3d image to use"
default: "rancher/k3s:v1.30.4-k3s1"
- name: K3D_EXTRA_ARGS
description: "Optionally pass k3d arguments to the default"
default: ""
- name: NGINX_EXTRA_PORTS
description: "Optionally allow more ports through Nginx (combine with K3D_EXTRA_ARGS '-p <port>:<port>@server:*')"
default: "[]"
components:
- name: destroy-cluster
required: true
description: "Optionally destroy the cluster before creating it"
actions:
onDeploy:
before:
- cmd: k3d cluster delete ${ZARF_VAR_CLUSTER_NAME}
description: "Destroy the cluster"
- name: create-cluster
required: true
description: "Create the k3d cluster"
actions:
onDeploy:
before:
- cmd: |
k3d cluster create \
-p "80:80@server:*" \
-p "443:443@server:*" \
--api-port 6550 \
--k3s-arg "--disable=traefik@server:*" \
--k3s-arg "--disable=metrics-server@server:*" \
--k3s-arg "--disable=servicelb@server:*" \
--k3s-arg "--disable=local-storage@server:*" \
--image ${ZARF_VAR_K3D_IMAGE} ${ZARF_VAR_K3D_EXTRA_ARGS} \
${ZARF_VAR_CLUSTER_NAME}
description: "Create the cluster"
onSuccess:
- cmd: |
echo "You can access this cluster over SSH (note http redirect will redirect to port 80 instead of 8080):"
echo "ssh -N -L 8080:localhost:80 -L 8443:localhost:443 -L 6550:localhost:6550"
echo
echo "To get the kubeconfig:"
echo "k3d kubeconfig get ${ZARF_VAR_CLUSTER_NAME}"
echo
echo "This cluster can be destroyed with:"
echo "k3d cluster delete ${ZARF_VAR_CLUSTER_NAME}"
description: "Print out information about how to access the cluster remotely"
- name: uds-dev-stack
required: true
description: "Install MetalLB, NGINX, Minio, local-path-rwx and Ensure MachineID to meet UDS developer needs without later config changes"
actions:
onDeploy:
before:
- cmd: ./zarf tools kubectl get nodes -o=jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}' | cut -d'.' -f1-3
description: "Load network ip base for MetalLB"
setVariables:
- name: BASE_IP
after:
- cmd: ./zarf tools kubectl rollout restart deployment coredns -n kube-system
description: "Restart CoreDNS to pick up internal DNS override for uds.dev"
charts:
- name: metallb
namespace: uds-dev-stack
url: https://metallb.github.io/metallb
version: 0.14.8
- name: uds-dev-stack
namespace: uds-dev-stack
localPath: chart
version: 0.2.0
valuesFiles:
- "values/dev-stack-values.yaml"
- name: minio
namespace: uds-dev-stack
version: 5.2.0
url: https://charts.min.io/
valuesFiles:
- "values/minio-values.yaml"