I am following this blog post to create kubernetes in existing AWS infrastructure: https://insights.ubuntu.com/2017/02/08/automate-the-deployment-of-kubernetes-in-existing-aws-infrastructure/
$ juju --version
2.2.6-xenial-amd64
My differences:
- I did not use cloudformation as the VPCs already exist (3x priv + 3x pub subnets in a VPC)
- I created a new model, since I want to build multiple clusters (one per environment) using models.
I am at the part where I'm trying to define the public and private subnets that exist in AWS (roughly halfway down the page), but I'm getting error messages that give little insight.
$ juju add-model dev-k8s
$ juju add-space public
$ juju add-space private
$ juju add-subnet subnet-12345678 private
ERROR cannot add subnet: no subnets defined
This error message seems very chicken-egg. I can't add a subnet without a subnet?
I've checked out the documentation: https://jujucharms.com/docs/2.2/commands#add-subnet
Usage: juju add-subnet [options] <CIDR>|<provider-id> <space> [<zone1> <zone2> ...]
So I've tried variations, but all end up with similar results
$ juju add-subnet 1.2.3.4/20 private us-east-1a
ERROR cannot add subnet: no subnets defined
$ juju add-subnet 1.2.3.4/20 private subnet-12345678
ERROR cannot add subnet: no subnets defined
$ juju add-subnet subnet-12345678 private us-east-1a
ERROR cannot add subnet: no subnets defined
... + many more that stretch the usage definition above
What's strange is that the subnets are not populated in the new dev-k8s model
$ juju switch dev-k8s && juju list-subnets
pre-ops-k8s:admin/default -> pre-ops-k8s:admin/dev-k8s
No subnets to display.
But the default model contains all the subnets
$ juju switch default && juju list-subnets
pre-ops-k8s:admin/dev-k8s -> pre-ops-k8s:admin/default
subnets:
1.2.3.4/20:
type: ipv4
provider-id: subnet-12345678
provider-network-id: vpc-12345678
status: in-use
space: ""
zones:
- us-east-1a
... cropped output