Configurations you need to start a kubernetes cluster

Dependencies

kubectl apply -f 0_dependencies

Load Balancer

kubectl apply -f 1_load-balancer

Ingress service

kubectl apply -f 2_ingress-service

Heapster Monitoriong

Needed to use Horizontal Pod Autoscaler. kubectl apply -f 3_heapster

Prometheus and Graphana

kubectl apply -f 4_prometheus

Automation

chmod +X deploy.sh

./deploy.sh

Access dashboard on AKS with RBAC enabled

kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard

dashboard

Helm

To install helm-cli run curl -L https://git.io/get_helm.sh | bash

helm init

kubectl apply -f 2_private-ingress/helm-rbac.yaml

kubectl create serviceaccount --namespace kube-system tiller

kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

helm init --service-account tiller --node-selectors "beta.kubernetes.io/os"="linux" --upgrade

Private Ingress

Create a namespace for the ingress resources kubectl apply -f 2_private-ingress/backend-namespace.yaml

In the file 2_private-ingress/internal-ingress.yaml you need to set the IP do you want to use.

Use Helm to deploy an NGINX ingress controller

helm install stable/nginx-ingress \
    --namespace backend \
    -f 2_private-ingress/internal-ingress.yaml \
    --set controller.replicaCount=2 \
    --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux \
    --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux

Author

Ismael Leiva

License

Copyright © 2017, Ismael Leiva. Released under the MIT License.

Credit

This repository was inspired by the implementation in giantswarm/prometheus

Bibliography