Skip to content

tooling to help automate the creation and maintenance of a kubernetes cluster created with aks-engine

License

Notifications You must be signed in to change notification settings

zachpuck/aks-engine-automation

Repository files navigation

Build Status Coverage

AKS engine automation

A Kubernetes operator used to provision Kubernetes clusters in azure utilizing aks-engine

Overview

AKS engine automation provides a Kubernetes native process to creating aks-engine clusters in azure. Utilizing custom resource definitions of Kind AksCluster to create and update clusters. Additional secrets are created for azure credentials(<cluster-name>-secret) and vm ssh private key(<cluster-name>-privatekey).

Getting started

Prerequisites: Aks engine automation requires an azure storage account used to store the aks-engine manifests. This storage account must be in the same subscription as the Kubernetes clusters.

  1. Create an azure resource group: az group create --name "aks-operator-group" --location "westus"
  2. Create an azure storage account: az storage account create --name "aksoperatorstorage01" --resource-group "aks-operator-group"

Installing the Operator:

helm install deployments/helm/aks-engine-automation \
  --name aks-operator \
  --set storageAccount.name="aksoperatorstorage01" \
  --set storageAccount.group="aks-operator-group"

Usage

Once the Operator is installed and running in a kubernetes cluster you can begin creating AksCluster Custom Resources. An sample resource is located in config/samples. The sample contains two resources.

  1. A kubernetes secret that contains your azure credentials.
  2. An AksCluster custom resource used to define the details of your cluster.

The Operator has two containers. One container is the kubernetes operator itself and will show the logs related managing the Akscluster Custom resources. The second container is the opctl. The logs from opctl container show the indivdiual results of each "operation" (the individual steps of managing clusters: create, update, add node, ect..). Each of these operations returns the results to standard out.

The operations are created using opctl

Build

To build new images: opctl run build

This will build

Local Debug:

Requirements:

  1. minikube
  2. opctl

Steps:

  1. minikube start
  2. make install
  3. Set environment variables:
    • export AKS_ENGINE_STORAGE_ACCOUNT_NAME=<name of azure storage account> (see Prerequisites)
    • export AKS_ENGINE_STORAGE_ACCOUNT_GROUP=<name of azure storage account resource group>
    • export OPERATIONS_PKG_PATH= <local file path to this repos operations folder> ex: $GOPATH/src/github.com/zachpuck/aks-engine-automation/operations
  4. make run

In as separate terminal:

  1. Update sample CR with your azure credentials: ./config/samples/azure_v1beta1_akscluster.yaml
  2. kubectl apply -f ./config/samples/azure_v1beta1_akscluster.yaml
  3. View the opctl event stream by navigating to http://localhost:42224/#/events

You can now see the created resource by typing kubectl get akcluster

Features:

  1. create cluster
  2. delete cluster
  3. upgrade cluster kubernetes version
  4. multiple worker node pools
  5. enable public ip access on nodes
  6. add/delete node (scaling)

not yet implemented:

  1. custom vnets
  2. availability zones
  3. Virtual machine scale set for masters

About

tooling to help automate the creation and maintenance of a kubernetes cluster created with aks-engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published