-
Notifications
You must be signed in to change notification settings - Fork 4
Kubernetes
Make sure you have installed the latest version of kubernetes. If you want to run a local cluster you have two options:
- Open docker prefences
- Navigate to kubernetes tab
- Click enables kubernetes cluster
- Install minikube on your local machine
- run
start minikube
make sure you use the right virtual machine driver and add correct insecure registry if you choose to do so
To verify installation and deployment, run kubectl version
Kubernetes can now be interfaced with and controlled using the kubectl command, it is configured to a cluster, and then the commands will be executed on that cluster. Using minikube or the docker built in cluster deploys a single node VM cluster onto your localhost.
For setting up a local cluster, a web dashboard will always be available from the local machine,
run kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
To access this, open a new terminal window and run
kubectl proxy
You can now visit http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
To easily deploy the coalesce stack to kubernetes, 'kompose' can be installed to convert docker-compose.yml files to *.yaml files compatible for kubernetes to automate creating deployments on kubernetes
- Install kompose
- navigate to a docker-compose file you want to "stand up" on kubernetes
- run kompose up
This will pull each docker image into the minikube vm, from this, deployments and pods will be created
Kubernetes is built to dynamically loadbalance and scale using their "expendable" pod structure, when you scale a deployment up, it will create pods. A pod is a container build ontop of a docker image. When you scale down, pods are destroyed. To make these deployments available with changing IP addresses or multiple virtual ports, kubernetes services are to be used.
- Create a service to expose your deployment
More can be found here: https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/