aks-engine-automation

module
v0.0.0-...-e708cdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2019 License: Apache-2.0

README

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

Directories

Path Synopsis
cmd
pkg
apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
apis/azure
Package azure contains azure API versions
Package azure contains azure API versions
apis/azure/v1beta1
Package v1beta1 contains API Schema definitions for the azure v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/zachpuck/aks-engine-automation/pkg/apis/azure +k8s:defaulter-gen=TypeMeta +groupName=azure.cnct.io
Package v1beta1 contains API Schema definitions for the azure v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/zachpuck/aks-engine-automation/pkg/apis/azure +k8s:defaulter-gen=TypeMeta +groupName=azure.cnct.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL