This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
create-cluster-gardener-aws.sh
executable file
·76 lines (72 loc) · 2.12 KB
/
create-cluster-gardener-aws.sh
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
#!/bin/bash
echo $GARDEN_KUBECONFIG | base64 --decode > ./garden-kubeconfig.yaml
export SHOOT_NAME=${SHOOT_NAME:-c$(date +"%d%H%M%S")}
cat <<EOF | kubectl --kubeconfig ./garden-kubeconfig.yaml apply -f -
kind: Shoot
apiVersion: core.gardener.cloud/v1beta1
metadata:
name: $SHOOT_NAME
spec:
provider:
type: aws
infrastructureConfig:
apiVersion: aws.provider.extensions.gardener.cloud/v1alpha1
kind: InfrastructureConfig
networks:
vpc:
cidr: 10.250.0.0/16
zones:
- name: eu-central-1b
workers: 10.250.0.0/19
public: 10.250.32.0/20
internal: 10.250.48.0/20
controlPlaneConfig:
apiVersion: aws.provider.extensions.gardener.cloud/v1alpha1
kind: ControlPlaneConfig
workers:
- name: worker-mk12q
minimum: 1
maximum: 1
maxSurge: 1
machine:
type: m5.xlarge
image:
name: gardenlinux
version: 184.0.0
zones:
- eu-central-1b
volume:
type: gp2
size: 50Gi
networking:
type: calico
nodes: 10.250.0.0/16
cloudProfileName: aws
secretBindingName: trial-secretbinding-aws
region: eu-central-1
purpose: evaluation
kubernetes:
version: 1.18.12
addons:
kubernetesDashboard:
enabled: false
nginxIngress:
enabled: false
maintenance:
timeWindow:
begin: 220000+0000
end: 230000+0000
autoUpdate:
kubernetesVersion: true
machineImageVersion: true
hibernation:
schedules: []
EOF
STATUS="False"
while [[ $STATUS != "True" ]]; do
STATUS=$(kubectl --kubeconfig ./garden-kubeconfig.yaml get shoot $SHOOT_NAME -ojson | jq -r '.status.conditions[] | select(.type=="EveryNodeReady") | .status')
echo "Waiting for shoot $SHOOT_NAME nodes to be ready: $(kubectl --kubeconfig ./garden-kubeconfig.yaml get shoot $SHOOT_NAME -ojsonpath='{.status.lastOperation.description}')"
sleep 5
done
kubectl --kubeconfig ./garden-kubeconfig.yaml get secret $SHOOT_NAME.kubeconfig -ojsonpath='{.data.kubeconfig}' | base64 --decode > ~/.kube/config
chmod 600 ~/.kube/config