-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
87 lines (69 loc) · 2.68 KB
/
Taskfile.yml
File metadata and controls
87 lines (69 loc) · 2.68 KB
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
# https://taskfile.dev
version: '3'
env:
CLUSTER_NAME: kadras-dev
K8S_VERSION: v1.35
tasks:
# =============================================
# Cluster Management
# =============================================
cluster:setup:
desc: Create kind cluster
cmds:
- kind delete cluster --name {{.CLUSTER_NAME}}
- ytt -f test/setup/clusters/kind-template.yml --data-value k8s_version="{{.K8S_VERSION | replace "v" ""}}" | kind create cluster --name {{.CLUSTER_NAME}} --config -
- kubectl wait --for=condition=Ready nodes --all --timeout=5m
- kapp deploy -a setup -f test/setup/assets -y
- kubectl config set-context --current --namespace=tests
- echo "✅ Cluster '{{.CLUSTER_NAME}}' is ready for use!"
cluster:cleanup:
desc: Delete kind cluster
cmds:
- kind delete cluster --name {{.CLUSTER_NAME}}
cluster:info:
desc: Display cluster information
cmds:
- kubectl cluster-info
- kubectl get nodes
# =============================================
# Development
# =============================================
dev:
desc: Inner development loop with kctrl
cmds:
- cd package && kctrl dev -f package-resources.yml --local -y
clean:
desc: Clean development environment
cmds:
- cd package && kctrl dev -f package-resources.yml --local -y --delete
# =============================================
# Package Operations
# =============================================
build:
desc: Build package configuration
cmds:
- cd package && kctrl package init
kbld:
desc: Use kbld to resolve the OCI images referenced within the manifests
cmds:
- rm -f package/.imgpkg/images.yml && mkdir -p package/.imgpkg && ytt --file package/config | kbld -f- --imgpkg-lock-output package/.imgpkg/images.yml 1>> /dev/null
schema:
desc: Use ytt to generate an OpenAPI specification for the package's configuration values
cmds:
- ytt -f package/config/values-schema.yml --data-values-schema-inspect -o openapi-v3 > schema-openapi.yml
# =============================================
# Testing
# =============================================
test:
desc: Run all tests
cmds:
- task: test:config
- task: test:integration
test:config:
desc: Check the ytt-annotated Kubernetes configuration and its validation
cmds:
- ytt -f package/config | kubeconform -ignore-missing-schemas -summary
test:integration:
desc: Run package integration tests
cmds:
- kubectl kuttl test --config test/integration/kuttl-test.yml --kind-config <(ytt -f test/setup/clusters/kind-template.yml --data-value k8s_version="{{.K8S_VERSION | replace "v" ""}}")