-
Notifications
You must be signed in to change notification settings - Fork 23
86 lines (79 loc) · 2.98 KB
/
multi-cluster-two-piars.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
name: Multi cluster; two pairs of clusters on two isolated networks
on:
[workflow_dispatch, push]
jobs:
k3d-multicluster-demo:
name: Two pairs of clusters on two isolated networks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./
id: test-cluster-1-a
name: "Create 1st k3d Cluster in 172.20.0.0/24"
with:
cluster-name: "test-cluster-1-a"
network: "nw01"
subnet-CIDR: "172.20.0.0/24"
args: >-
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- uses: ./
id: test-cluster-1-b
name: "Create 2nd k3d Cluster in 172.20.0.0/24"
with:
cluster-name: "test-cluster-2-a"
network: "nw01"
args: >-
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- uses: ./
id: test-cluster-2-a
name: "Create 1st k3d Cluster in 172.20.1.0/24"
with:
cluster-name: "test-cluster-1-b"
network: "nw02"
subnet-CIDR: "172.20.1.0/24"
args: >-
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- uses: ./
id: test-cluster-2-b
name: "Create 2nd k3d Cluster in 172.20.1.0/24"
with:
cluster-name: "test-cluster-2-b"
network: "nw02"
args: >-
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- name: Cluster info
run: |
echo
echo test-cluster-1-a: ${{ steps.test-cluster-1-a.outputs.network }} ${{ steps.test-cluster-1-a.outputs.subnet-CIDR }}
echo test-cluster-1-b: ${{ steps.test-cluster-1-b.outputs.network }} ${{ steps.test-cluster-1-b.outputs.subnet-CIDR }}
echo test-cluster-2-a: ${{ steps.test-cluster-2-a.outputs.network }} ${{ steps.test-cluster-2-a.outputs.subnet-CIDR }}
echo test-cluster-2-b: ${{ steps.test-cluster-2-b.outputs.network }} ${{ steps.test-cluster-2-b.outputs.subnet-CIDR }}
echo
kubectl cluster-info --context k3d-test-cluster-1-a
kubectl cluster-info --context k3d-test-cluster-2-a
kubectl cluster-info --context k3d-test-cluster-1-b
kubectl cluster-info --context k3d-test-cluster-2-b
- name: Nodes
run: |
docker ps -a
kubectl config use-context k3d-test-cluster-1-a
kubectl get nodes -o wide
kubectl config use-context k3d-test-cluster-1-b
kubectl get nodes -o wide
kubectl config use-context k3d-test-cluster-2-a
kubectl get nodes -o wide
kubectl config use-context k3d-test-cluster-2-b
kubectl get nodes -o wide
- name: Network
run: |
docker network list
docker network inspect nw01
docker network inspect nw02