-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
126 lines (115 loc) · 4.82 KB
/
Taskfile.yml
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
version: "3"
silent: true
includes:
argocd: ./tasks/argocd.yaml
tf: ./tasks/terraform.yaml
vars:
CYAN: tput setaf 6
RED: tput setaf 1
YELLOW: tput setaf 3
GREEN: tput setaf 2
BLUE: tput setaf 1
PURPLE: tput setaf 5
BG_B: tput setab 0
BOLD: tput bold
RESET: tput sgr0
CLEAR: tput reset
PATH_ERROR: is not installed or correctly configured in PATH.
K8S_VERSION: 1.26.1
dotenv: [".env"]
tasks:
lint:
desc: Performs lint testing on the YAML files in the repository using the yamllint tool to ensure proper formatting and syntax.
preconditions:
- sh: "which yamllint"
msg: "yamllint {{.PATH_ERROR}}"
cmds:
- yamllint -c ./.yamllint .
docs:gen:
preconditions:
- sh: "which terraform-docs"
msg: "terraform-docs {{.PATH_ERROR}}"
dir: terraform
desc: Build documentation using Terraform-docs
cmds:
- terraform-docs markdown -c .terraform-docs.yaml . --output-file README.md
test:k3d:
desc: Starts your local k3d cluster.
preconditions:
- sh: "which k3d"
msg: "k3d {{.PATH_ERROR}}"
summary: |
Creating a k3d cluster
This command ensures the cluster on k3d will
be created with all the correct parameters, allowing
for a declarative setup that requires minimal intervention
to work. k3d is configured to automatically create an entry
on your KUBECONFIG file and update it to point towards the cluster.
All commands that create resources also are specific to the cluster
name configured on the file ('k3d-demo'), as to avoid creating those
resoures on non-local clusters that may be on KUBECONFIG file as well.
cmds:
- task: clear
- k3d cluster delete --config config/k3d.yaml
- k3d cluster create --config config/k3d.yaml
- task: highlight_normal
- echo -e "\nYour cluster has been created. Type 'k3d cluster list' to confirm."
- task: reset
ignore_error: true
repos:
desc: Adds and updates all the required Helm repositories locally.
preconditions:
- sh: "which helm"
msg: "helm {{.PATH_ERROR}}"
cmds:
- task: clear
- task: highlight_bg
- echo -e "This will add new repositories to your local Helm\n"
- task: reset
- helm repo add chaos-mesh https://charts.chaos-mesh.org
- helm repo add hashicorp https://helm.releases.hashicorp.com
- helm repo add bitnami https://charts.bitnami.com/bitnami
- helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/
- helm repo add nginx-stable https://helm.nginx.com/stable
- helm repo add lwolf-charts http://charts.lwolf.org
- helm repo add emberstack https://emberstack.github.io/helm-charts
- helm repo add keyporttech https://keyporttech.github.io/helm-charts/
- helm repo add agones https://agones.dev/chart/stable
- helm repo add drone https://charts.drone.io
- helm repo add botkube https://charts.botkube.io
- helm repo add mysql-operator https://mysql.github.io/mysql-operator/
- helm repo add stakater https://stakater.github.io/stakater-charts
- helm repo add fairwinds-stable https://charts.fairwinds.com/stable
- helm repo add ananace-charts https://ananace.gitlab.io/charts
- helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
- helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- helm repo add pixie-operator https://pixie-operator-charts.storage.googleapis.com
- helm repo add eraser https://azure.github.io/eraser/charts
- helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
- task: clear
- echo -e "This will add new repositories to your local Helm\n"
- task: highlight_normal
- echo -e "Finished adding repositories. Updating them now.\n"
- task: reset
- helm repo update
ignore_error: true
dns:
desc: Creates the DNS entry required for the local domain to work.
preconditions:
- sh: "which hostctl"
msg: "hostctl {{.PATH_ERROR}}"
summary: |
Configuring Local DNS configuration through hostctl
This command uses hostctl to manage entries on /etc/hosts on a
a cross operational system compatible way. This command should work
on all MacOS, Windows and Linux. It adds all the '*.k8s.localhost'
domains to your local DNS hosts file. It also makes it easy for the
user to reverse those changes, avoiding pollution on your hosts
(or equivalent) file.
cmds:
- task: clear
- sleep 0.01 && {{if eq OS "windows"}}hostctl add k8s -q < config/.etchosts{{else}}sudo hostctl add k8s -q < config/.etchosts{{end}}
- task: highlight_normal
- echo -e "Added 'k8s.localhost' and related domains to your hosts file!"
- task: reset
ignore_error: true