Cloudify provider for Kubernetes
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Cloudify Cloud Controller Manager

We use git submodule instead common practice of vendoring because it has one big advantage we can use git merge for update code base for support new version of kubernetes. We are trying to use only additional code instead replace and you always can check 'what is the last merged version' and how we connect to cloudify. So theoretically you can build kubernetes binaries from repository, but we have no guarantees for such usage. And when we will have ability to attach our code as plugin to kubernetes product we will drop all kubernetes forks and use only official repositories (near 1.9+?)

git (Disc Usage: 699-872Mb)

git clone --recursive
# show state for submodules
git config status.submodulesummary 1


sudo apt-get install golang-go
export GOBIN=`pwd`/bin
export PATH=$PATH:`pwd`/bin
export GOPATH=`pwd`
git submodule update
make all

reformat code

make reformat

Preparation to use new version of kubernetes

After update to new version of kubernates run:

rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/

Preparation to use new version of autoscaler

After update to new version of autoscaler run:

rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/
rm -rfv src/

and cleanup Godeps/Godeps.json.

Functionality related to kubernetes

# cfy-kubernetes version
cfy-kubernetes -version
cfy-kubernetes --kubeconfig $HOME/.kube/config --cloud-config examples/config.json
kubectl get nodes

# autoscale
src/ --kubeconfig $HOME/.kube/config --cloud-provider cloudify --cloud-config examples/config.json

# scale
cfy executions start scale -d k8s -p 'scalable_entity_name=k8s_node_group'

# downscale
cfy executions start scale -d k8s -p 'scalable_entity_name=k8s_node_group' -p 'delta=-1'

# create simple pod
kubectl create -f --kubeconfig $HOME/.kube/config

# look to description
kubectl describe deployment nginx-deployment --kubeconfig $HOME/.kube/config

# delete
kubectl delete deployment nginx-deployment --kubeconfig $HOME/.kube/config

# check volume
kubectl create -f nginx.yaml
watch -n 5 -d kubectl describe pod nginx
kubectl delete pod nginx

# check scale
kubectl run php-apache --requests=cpu=500m,memory=500M --expose --port=80
kubectl autoscale deployment php-apache --cpu-percent=90 --min=10 --max=20
watch -n 10 -d "kubectl get hpa; kubectl get pods; kubectl get nodes"

# stop scale
kubectl delete hpa php-apache
kubectl delete deployment php-apache

For cfy-go documentation look to godoc.

For additional cluster-autoscaler documentation look to official repository.

Upload blueprint to manager (without build sources)

For full documentation about inputs look to official simple cluster blueprint or copy distributed with repository. CLOUDPROVIDER can be aws or vsphere.

# set empty secrets
cfy secret create kubernetes_certificate_authority_data -s "#"
cfy secret create kubernetes-admin_client_key_data -s "#"
cfy secret create kubernetes_master_port -s "#"
cfy secret create kubernetes-admin_client_certificate_data -s "#"
cfy secret create kubernetes_master_ip -s "#"

# upload
git clone -b master --depth 1
cd cloudify-kubernetes-provider
CLOUDPROVIDER=aws make upload

cfy uninstall k8s -p ignore_failure=true --allow-custom-parameters

Known issues:

  • Q: Many messages like 'Not found instances: Wrong content type: text/html' in logs on kubenetes manager host or 'kube-dns not Running' in cloudify logs.
  • A: Check in /root/cfy.json cloudify manager ip and port.