-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaws-eks.yaml
109 lines (104 loc) · 3.26 KB
/
aws-eks.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
apiVersion: capi.weave.works/v1alpha2
kind: CAPITemplate
metadata:
name: aws-eks
namespace: default
spec:
description: AWS EKS Cluster
params:
- name: CLUSTER_NAME
description: The name for this cluster.
- name: CLUSTER_NAMESPACE
description: The namespace for this cluster.
- name: AWS_REGION
description: AWS Region to create cluster
options: ['eu-north-1']
- name: KUBERNETES_VERSION
description: EKS Kubernetes version to use
options: ['v1.22.10','v1.24.1']
- name: WORKER_MACHINE_COUNT
description: Number of worker nodes to create.
- name: INSTANCE_TYPE
description: Tpye of worker nodes
options: ['t3.medium','t3.large']
- name: OWNER_EMAIL
description: E-Mail of Cluster Owner
- name: SSH_KEY_NAME
description: AWS ssh key name
resourcetemplates:
- content:
- apiVersion: gitops.weave.works/v1alpha1
kind: GitopsCluster
metadata:
name: "${CLUSTER_NAME}"
namespace: "${CLUSTER_NAMESPACE}"
labels:
weave.works/capi: bootstrap
spec:
capiClusterRef:
name: "${CLUSTER_NAME}"
- apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
namespace: ${CLUSTER_NAMESPACE}
spec:
clusterNetwork:
pods:
cidrBlocks:
- 10.120.0.0/20
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: AWSManagedControlPlane
name: ${CLUSTER_NAME}-control-plane
infrastructureRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: AWSManagedControlPlane
name: ${CLUSTER_NAME}-control-plane
- apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: AWSManagedControlPlane
metadata:
name: ${CLUSTER_NAME}-control-plane
namespace: ${CLUSTER_NAMESPACE}
spec:
additionalTags:
creator: ${OWNER_EMAIL}
region: ${AWS_REGION}
sshKeyName: ${SSH_KEY_NAME}
version: ${KUBERNETES_VERSION}
iamAuthenticatorConfig:
mapRoles:
- username: "admin"
rolearn: "arn:aws:iam::894516026745:role/AdministratorAccess"
groups:
- "system:masters"
- username: "admin"
rolearn: "arn:aws:iam::894516026745:role/WeaveEksEditor"
groups:
- "system:masters"
- apiVersion: cluster.x-k8s.io/v1beta1
kind: MachinePool
metadata:
name: ${CLUSTER_NAME}-pool-0
namespace: ${CLUSTER_NAMESPACE}
spec:
clusterName: ${CLUSTER_NAME}
replicas: ${WORKER_MACHINE_COUNT}
template:
spec:
bootstrap:
dataSecretName: ""
clusterName: ${CLUSTER_NAME}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSManagedMachinePool
name: ${CLUSTER_NAME}-pool-0
- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSManagedMachinePool
metadata:
name: ${CLUSTER_NAME}-pool-0
namespace: ${CLUSTER_NAMESPACE}
spec:
additionalTags:
creator: ${OWNER_EMAIL}
instanceType: ${INSTANCE_TYPE}