cluster-api-provider-azure

module
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: Apache-2.0

README

Kubernetes Cluster API Azure Provider Go Report Card

Getting Started

Prerequisites
  1. Install kubectl.

  2. Install minikube and a minikube driver. It is recommended to use KVM2 driver for Linux and VirtualBox for MacOS.

  3. Install kustomize.

  4. Clone the Project.

    git clone https://github.com/kubernetes-sigs/cluster-api-provider-azure $(go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-azure
    
  5. Ensure that you have the project root as your current working directory.

    cd $(go env GOPATH)/src/sigs.k8s.io/cluster-api-provider-azure
    
  6. Build the clusterctl tool.

    make clusterctl
    
Prepare your environment

An Azure Service Principal is needed for usage by the clusterctl tool and for populating the controller manifests. This utilizes environment-based authentication. The following environment variables should be set: AZURE_SUBSCRIPTION_ID, AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET.

An alternative is to install Azure CLI and have the project's script create the service principal automatically. Note that the service principals created by the scripts will not be deleted automatically.

Usage
Creating a Cluster
  1. Generate the cluster.yaml, machines.yaml, and addons.yaml files, and create the service principal if needed.

    cd cmd/clusterctl/examples/azure
    CREATE_SP=FALSE ./generate-yaml.sh # set to TRUE if creating a new Service Principal is desired
    cd ../../../..
    # If CREATE_SP=TRUE
    source cmd/clusterctl/examples/azure/out/credentials.sh
    
  2. Generate the provider-components.yaml file.

    kustomize build config/default/ > cmd/clusterctl/examples/azure/out/provider-components.yaml
    echo "---" >> cmd/clusterctl/examples/azure/out/provider-components.yaml
    kustomize build vendor/sigs.k8s.io/cluster-api/config/default/ >> cmd/clusterctl/examples/azure/out/provider-components.yaml
    
  3. Create the cluster. Kubernetes Version >= 1.11 is required to enable CRD subresources without needing a feature gate.

    Linux

    ./bin/clusterctl create cluster --provider azure \
    -m cmd/clusterctl/examples/azure/out/machines.yaml \
    -c cmd/clusterctl/examples/azure/out/cluster.yaml \
    -p cmd/clusterctl/examples/azure/out/provider-components.yaml \
    --vm-driver kvm2 --minikube kubernetes-version=v1.12.2
    

    macOS

    ./bin/clusterctl create cluster --provider azure \
    -m cmd/clusterctl/examples/azure/out/machines.yaml \
    -c cmd/clusterctl/examples/azure/out/cluster.yaml \
    -p cmd/clusterctl/examples/azure/out/provider-components.yaml \
    --vm-driver virtualbox --minikube kubernetes-version=v1.12.2
    

Once the cluster is created successfully, you can interact with the cluster using kubectl and the kubeconfig downloaded by the clusterctl tool.

kubectl --kubeconfig=kubeconfig get clusters
kubectl --kubeconfig=kubeconfig get machines
Creating and using controller images

TODO

Testing

TODO

Directories

Path Synopsis
cmd
hack
pkg
apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
apis/azureprovider/v1alpha1
Package v1alpha1 contains API Schema definitions for the azureprovider v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +k8s:defaulter-gen=TypeMeta +groupName=azureprovider.k8s.io Package v1alpha1 contains API Schema definitions for the azureprovider v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +k8s:defaulter-gen=TypeMeta +groupName=azureprovider.k8s.io
Package v1alpha1 contains API Schema definitions for the azureprovider v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +k8s:defaulter-gen=TypeMeta +groupName=azureprovider.k8s.io Package v1alpha1 contains API Schema definitions for the azureprovider v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider +k8s:defaulter-gen=TypeMeta +groupName=azureprovider.k8s.io
test
e2e

Jump to

Keyboard shortcuts

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