Git Product home page Git Product logo

kubernetes_demo's Introduction

Kubernetes Demonstration

The following is a Kubernetes stack demo, that integrates Istio, Helm, Keel, Kubeapps and Sensu on top of minikube on Mac OS.

Install Tooling

brew install kubernetes-cli kubernetes-helm kubectx

Install Minikube

brew cask install minikube
minikube config set vm-driver virtualbox
minikube config set memory 8192
minikube config set cpus 4
minikube start --extra-config=kubelet.authentication-token-webhook=true
minikube tunnel &

Install Tiller

kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller
helm init --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | \
  sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | \
  kubectl apply -f -

Install Istio.io

ISTIO_VERSION=1.3.1
curl -L https://git.io/getLatestIstio | sh -
INSTALL_DIR=istio-$ISTIO_VERSION/install/kubernetes/helm
helm upgrade -i istio-init $INSTALL_DIR/istio-init --namespace istio-system
helm upgrade -i istio $INSTALL_DIR/istio --namespace istio-system \
  --values $INSTALL_DIR/istio/values-istio-demo.yaml
kubectl label namespace default istio-injection=enabled

Install Istio-HPA

git clone https://github.com/stefanprodan/istio-hpa
kubectl apply -f istio-hpa/kube-metrics-adapter/

Install Kubeapps

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
kubectl create serviceaccount kubeapps-operator --namespace kubeapps
kubectl create clusterrolebinding kubeapps-operator --clusterrole cluster-admin \
  --serviceaccount kubeapps:kubeapps-operator --serviceaccount default:kubeapps-operator
helm upgrade -i kubeapps bitnami/kubeapps --namespace kubeapps

Install metrics-server

helm upgrade -i metrics-server stable/metrics-server --namespace kube-system \
  --set args="{--logtostderr,--kubelet-insecure-tls,--kubelet-preferred-address-types=InternalIP\,ExternalIP\,Hostname}"

Install Keel

helm repo add keel-charts https://charts.keel.sh
helm repo update
helm upgrade -i keel keel-charts/keel --namespace kube-system

Install hosts

export INGRESS_IP=$(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
sudo -- sh -c "echo '$INGRESS_IP users.svc accounts.svc' >> /etc/hosts"
sudo -- sh -c "echo '$INGRESS_IP api.sensu ui.sensu' >> /etc/hosts"

Install Sensu

git clone https://github.com/kubernetes/kube-state-metrics
kubectl apply -f kube-state-metrics/kubernetes/

kubectl create namespace sensu-system
kubectl apply -f k8s/sensu/

SENSUCTL_PACKAGE=sensu-go_5.13.1_darwin_amd64.tar.gz
curl -LO https://s3-us-west-2.amazonaws.com/sensu.io/sensu-go/5.13.1/$SENSUCTL_PACKAGE
tar -xvf $SENSUCTL_PACKAGE sensuctl
sudo mv sensuctl /usr/local/bin/
rm $SENSUCTL_PACKAGE

sensuctl configure
? Sensu Backend URL: http://api.sensu
? Username: admin
? Password: P@ssw0rd!
? Namespace: default
? Preferred output format: tabular

Build Docker Images

docker build -t k776/users-service:latest users
docker push k776/users-service:latest

docker build -t k776/accounts-service:latest accounts
docker push k776/accounts-service:latest

Install/Update Resources

helm upgrade -i users-service k8s/users
helm upgrade -i accounts-service k8s/accounts
kubectl apply -f k8s/istio/

Accessing Services

(make sure 'minikube tunnel' is running and /etc/hosts points to the right IP)

Helpful Commands

kubectl top pods
minikube dashboard
./istio-*/bin/istioctl dashboard grafana
./istio-*/bin/istioctl dashboard jaeger
./istio-*/bin/istioctl dashboard kiali
./istio-*/bin/istioctl dashboard prometheus

kubernetes_demo's People

Contributors

kieranp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.