-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.79 KB
/
performance-1.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
name: Setup DigitalOcean K8s Cluster
on:
workflow_dispatch:
inputs:
CLUSTER_NAME:
description: 'Name of the Kubernetes cluster'
type: string
default: 'perfo-cluster'
required: true
NODE_SIZE:
description: 'Size of the nodes'
options:
- s-2vcpu-2gb
- s-4vcpu-8gb
- s-8vcpu-16gb
- s-16vcpu-32gb
type: choice
default: s-4vcpu-8gb
required: true
NODE_COUNT:
description: 'Number of nodes'
type: number
default: 3
required: true
KUBERNETES_VERSION:
description: 'Kubernetes version to use'
type: string
default: '1.31'
required: true
jobs:
setup-cluster:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install kubectl
run: |
sudo snap install kubectl --classic
kubectl version --client --output=yaml
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Create Kubernetes Cluster
run: |
doctl kubernetes cluster create ${{ github.event.inputs.CLUSTER_NAME }} \
--region fra1 \
--version ${{ github.event.inputs.KUBERNETES_VERSION }} \
--vpc-uuid 7ff72b70-98a3-4743-9e83-2f0131047d39 \
--node-pool "name=default-pool;size=${{ github.event.inputs.NODE_SIZE }};count=${{ github.event.inputs.NODE_COUNT }}" \
--wait
- name: Configure kubectl
run: |
doctl kubernetes cluster kubeconfig save ${{ github.event.inputs.CLUSTER_NAME }}
kubectl config set-context $(kubectl config current-context) --namespace=default