Skip to content

Instantly share code, notes, and snippets.

@albertoal
Last active May 11, 2020 19:42
Show Gist options
  • Save albertoal/474ef757ee24d3ce9f0daf607364a155 to your computer and use it in GitHub Desktop.
Save albertoal/474ef757ee24d3ce9f0daf607364a155 to your computer and use it in GitHub Desktop.
apiVersion: kops/v1alpha2
kind: Cluster
metadata:
name: {{.kubernetes_cluster_name.value}}
spec:
api:
loadBalancer:
type: Public
additionalSecurityGroups: ["{{.common_http_sg_id.value}}"]
authorization:
rbac: {}
channel: stable
cloudProvider: aws
configBase: s3://{{.kops_s3_bucket.value}}/{{.kubernetes_cluster_name.value}}
# Create one etcd member per AZ
etcdClusters:
- etcdMembers:
{{range $i, $az := .availability_zones.value}}
- instanceGroup: master-{{.}}
name: {{. | replace $.region.value "" }} {{/* converts eu-west-1a to a */}}
{{end}}
name: main
- etcdMembers:
{{range $i, $az := .availability_zones.value}}
- instanceGroup: master-{{.}}
name: {{. | replace $.region.value "" }} {{/* converts eu-west-1a to a */}}
{{end}}
name: events
iam:
allowContainerRegistry: true
legacy: false
kubernetesVersion: 1.10.6
masterPublicName: api.{{.kubernetes_cluster_name.value}}
networkCIDR: {{.vpc_cidr_block.value}}
networkID: {{.vpc_id.value}}
networking:
canal: {}
nonMasqueradeCIDR: 100.64.0.0/10
subnets:
# Public (utility) subnets, one per AZ
{{range $i, $id := .public_subnet_ids.value}}
- id: {{.}}
name: utility-{{index $.availability_zones.value $i}}
type: Utility
zone: {{index $.availability_zones.value $i}}
{{end}}
# Private subnets, one per AZ
{{range $i, $id := .private_subnet_ids.value}}
- id: {{.}}
name: {{index $.availability_zones.value $i}}
type: Private
zone: {{index $.availability_zones.value $i}}
egress: {{index $.nat_gateway_ids.value $i}}
{{end}}
topology:
dns:
type: Public
masters: private
nodes: private
---
# Create one master per AZ
{{range .availability_zones.value}}
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
labels:
kops.k8s.io/cluster: {{$.kubernetes_cluster_name.value}}
name: master-{{.}}
spec:
image: kope.io/k8s-1.10-debian-stretch-amd64-hvm-ebs-2018-08-17
kubernetesVersion: 1.10.6
machineType: t2.medium
maxSize: 1
minSize: 1
role: Master
subnets:
- {{.}}
---
{{end}}
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
labels:
kops.k8s.io/cluster: {{.kubernetes_cluster_name.value}}
name: nodes
spec:
image: kope.io/k8s-1.10-debian-stretch-amd64-hvm-ebs-2018-08-17
kubernetesVersion: 1.10.6
machineType: t2.small
maxSize: 2
minSize: 2
role: Node
subnets:
{{range .availability_zones.value}}
- {{.}}
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment