-
Notifications
You must be signed in to change notification settings - Fork 23
50 lines (48 loc) · 1.69 KB
/
multi-cluster.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
name: Multi cluster; two clusters on default network
on:
[workflow_dispatch, push]
jobs:
k3d-multicluster-demo:
name: Two clusters on default network
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./
id: test-cluster-1
name: "Create 1st k3d Cluster"
with:
cluster-name: "test-cluster-1"
args: >-
-p "80:80@agent[0]"
-p "443:443@agent[0]"
-p "5053:53/udp@agent[0]"
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- uses: ./
id: test-cluster-2
name: "Create 2nd k3d Cluster"
with:
cluster-name: "test-cluster-2"
args: >-
-p "81:80@agent[0]"
-p "444:443@agent[0]"
-p "5054:53/udp@agent[0]"
--agents 3
--no-lb
--k3s-server-arg "--no-deploy=traefik,servicelb,metrics-server"
- name: Cluster info
run: |
echo test-cluster-1: ${{ steps.test-cluster-1.outputs.network }} ${{ steps.test-cluster-1.outputs.subnet-CIDR }}
echo test-cluster-2: ${{ steps.test-cluster-2.outputs.network }} ${{ steps.test-cluster-2.outputs.subnet-CIDR }}
echo
kubectl cluster-info --context k3d-test-cluster-1 && kubectl cluster-info --context k3d-test-cluster-2
- name: Nodes
run: |
docker ps -a
kubectl config use-context k3d-test-cluster-1
kubectl get nodes -o wide
kubectl config use-context k3d-test-cluster-2
kubectl get nodes -o wide
- name: Network
run: docker network inspect k3d-action-bridge-network