Home

Awesome

CircleCI

aws-operator

The aws-operator manages Kubernetes clusters running on AWS.

Branches

Getting the Project

Download the latest release: https://github.com/giantswarm/aws-operator/releases/latest

Clone the git repository: https://github.com/giantswarm/aws-operator.git

Download the latest docker image from here: https://quay.io/repository/giantswarm/aws-operator

How to build

Build the standard way.

go build github.com/giantswarm/aws-operator

Architecture

The operator uses our operatorkit framework. It manages an awsconfig CRD using a generated client stored in our apiextensions repo. Releases are versioned using version bundles.

The operator provisions guest Kubernetes clusters running on AWS. It runs in a host Kubernetes cluster also running on AWS.

CloudFormation

The guest Kubernetes clusters are provisioned using AWS CloudFormation. The resources are split between CloudFormation stacks:

In control plane account

In tenant account:

Other AWS Resources

As well as the CloudFormation stacks we also provision a KMS key and S3 bucket per cluster. This is to upload cloudconfigs for the cluster nodes. The cloudconfigs contain TLS certificates which are encrypted using the KMS key.

Kubernetes Resources

The operator also creates a Kubernetes namespace per guest cluster with a service and endpoints. These are used by the host cluster to access the guest cluster.

Certificates

Authentication for the cluster components and end-users uses TLS certificates. These are provisioned using Hashicorp Vault and are managed by our cert-operator.

Secret

Here the AWS IAM credentials have to be inserted.

service:
  aws:
    accesskey:
      id: 'TODO'
      secret: 'TODO'

Here the base64 representation of the data structure above has to be inserted.

apiVersion: v1
kind: Secret
metadata:
  name: aws-operator-secret
  namespace: giantswarm
type: Opaque
data:
  secret.yml: 'TODO'

To create the secret manually do this.

kubectl create -f ./path/to/secret.yml

We also need a key to hold the SSH public key

apiVersion: v1
kind: Secret
metadata:
  name: aws-operator-ssh-key-secret
  namespace: giantswarm
type: Opaque
data:
  id_rsa.pub: 'TODO'

Node VM Images (AMIs)

This operator holds a static mapping of versions and regions to AMI IDs (VM image IDs, region specific) used for tenant cluster nodes in service/controller/key/ami.go. The file is generated by devctl and should not be edited manually. When a new version of the OS is released and new images have been published on AWS, this mapping can be updating using devctl gen ami --dir service/controller/key.

Live editing operator inside an installation

In order to start the operator, you can build it and execute it inside the pod

Live reload code

For live debugging in VS Code

  {
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Connect to okteto",
            "type": "go",
            "request": "attach",
            "mode": "remote",
            "remotePath": "/okteto",
            "port": 2345,
            "host": "127.0.0.1"
        }
    ]
  }

Contact

Contributing & Reporting Bugs

See CONTRIBUTING for details on submitting patches, the contribution workflow as well as reporting bugs.

For security issues, please see the security policy.

License

aws-operator is under the Apache 2.0 license. See the LICENSE file for details.

Credit