-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzarf.yaml
130 lines (120 loc) · 4.97 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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.12.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.31.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: "[]"
- name: DOMAIN
description: "Cluster domain"
default: "uds.dev"
- name: ADMIN_DOMAIN
description: "Domain for admin services, defaults to `admin.DOMAIN`"
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_version=$(k3d version | grep -E -o "([0-9]+\.?){3}$")
required_version="5.7.1"
if ! echo "$required_version\n$k3d_version" | sort -V -C; then
echo "This package requires a minimum k3d version of $required_version"
echo "Please upgrade k3d (https://k3d.io/stable/#install-current-latest-release) and try again"
exit 1
fi
description: "Check k3d version compatibility"
- 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:
# Wait for CoreDNS to be available. This allows slow internet connections to complete before we move on and try to connect to a cluster that may or may not be ready to accept connections. CoreDNS is a deployment we can trust will always be there.
- wait:
cluster:
kind: Pod
condition: Ready
name: "k8s-app=kube-dns"
namespace: kube-system
description: "Wait for CoreDNS to be ready"
- 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.9
- name: uds-dev-stack
namespace: uds-dev-stack
localPath: chart
# x-release-please-start-version
version: 0.12.0
# x-release-please-end
valuesFiles:
- "values/dev-stack-values.yaml"
variables:
- name: COREDNS_OVERRIDES
# Defaults contain rewrites of `*.uds.dev` to the UDS core Istio tenant and admin gateways
description: "CoreDNS overrides"
path: coreDnsOverrides
- name: minio
namespace: uds-dev-stack
version: 5.4.0
url: https://charts.min.io/
valuesFiles:
- "values/minio-values.yaml"