Search code examples
amazon-web-serviceskuberneteskops

In which scenario we should consider creating manual VPC(and subnets) for KOPS?


We are trying to create KOPS cluster, however we need to deploy our database server separately(outside of KOPS cluster). We thought of creating a CloudFormation for Infrastructure(vpc, subnets etc..) and create database server(ec2) manually. Then deploy Application servers through KOPS cluster.

My query is like Is it recommended to create manual VPC(and subnets) for KOPS?


Solution

  • Kops uses terraform on the backend to create resources in AWS. Its usually best to let Kops create and manage those resources unless you can't and have to deploy to an existing vpc. Kops can output to terraform so you can manage your infrastructure as code. This also give you the option to add an RDS cluster in terraform and have it added to your Kops cluster so its all managed together.

    Here is how you would do that and keep your state files in S3.

    $ kops create cluster \
      --name=kubernetes.mydomain.com \
      --state=s3://mycompany.kubernetes \
      --dns-zone=kubernetes.mydomain.com \
      [... your other options ...]
      --out=. \
      --target=terraform
    

    Then you would add your RDS cluster to the terraform code and do a terraform plan , then terraform apply.