syscll
syscll

Reputation: 1031

How can I specify a cluster CIDR when using kops?

I am a little unsure about how to ensure I do not have overlapping CIDRs when using kops to create multiple clusters.

I know it's possible to specify the --cluster-cidr when using the kube-control-manager, but I can't seem to find a way of doing this when using kops.

Upvotes: 2

Views: 1713

Answers (1)

cohadar
cohadar

Reputation: 4888

First you check which CIDRs you are already using

aws ec2 describe-vpcs | jq -cr '.Vpcs[] | [.CidrBlock, .VpcId, .Tags[0].Value]'

Than before you create the cluster, edit the main config

kops edit cluster $NAME

Change networkCIDR, nonMasqueradeCIDR and subnets.cidr

Note that subnets.cidr MUST be inside networkCIDR range.

Also note that networkCIDR and nonMasqueradeCIDR MUST NOT overlap

Example of valid config:

  networkCIDR: 10.80.0.0/16
  nonMasqueradeCIDR: 10.81.0.0/16
  subnets:
  - cidr: 10.80.0.0/24

Upvotes: 3

Related Questions