generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Taskfile.yml
34 lines (30 loc) · 1.04 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
---
version: "3"
vars:
PROJECT_DIR:
sh: "git rev-parse --show-toplevel"
CLUSTER_DIR: "{{.PROJECT_DIR}}/"
env:
KUBECONFIG: "{{.PROJECT_DIR}}/kubeconfig"
includes:
ansible: .taskfiles/ansible.yml
cluster: .taskfiles/cluster.yml
docker: .taskfiles/docker.yml
etcd: .taskfiles/etcd.yml
flux: .taskfiles/flux.yml
format: .taskfiles/format.yml
lint: .taskfiles/lint.yml
pre-commit: .taskfiles/pre-commit.yml
velero: .taskfiles/velero.yml
terraform: .taskfiles/terraform.yml
tasks:
kubeconfig:
desc: Remotely fetch kubeconfig from Kubernetes
cmds:
- rsync --verbose --progress --partial --rsync-path="sudo rsync" {{.K3S_PRIMARY_MASTER_NODE_USERNAME}}@{{.K3S_PRIMARY_MASTER_NODE_ADDR}}:/etc/rancher/k3s/k3s.yaml "{{.CLUSTER_DIR}}/kubeconfig"
- sed -i '' 's/127.0.0.1/{{.K3S_LB_ADDR}}/g' "{{.CLUSTER_DIR}}/kubeconfig"
- chmod go-r "{{.CLUSTER_DIR}}/kubeconfig"
vars:
K3S_PRIMARY_MASTER_NODE_USERNAME: "dfroberg"
K3S_PRIMARY_MASTER_NODE_ADDR: "192.168.30.50"
K3S_LB_ADDR: "192.168.30.60"