Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
kubernates [2018/05/02 02:21]
root
kubernates [2018/06/11 14:01] (current)
root [Hack #1]
Line 3: Line 3:
 * https://​github.com/​kubernetes/​kops ​ * https://​github.com/​kubernetes/​kops ​
 * https://​helm.sh/​ - Helm helps you manage Kubernetes applications — Helm Charts helps you define, install, and upgrade even the most complex Kubernetes application. * https://​helm.sh/​ - Helm helps you manage Kubernetes applications — Helm Charts helps you define, install, and upgrade even the most complex Kubernetes application.
 +* AWS https://​docs.aws.amazon.com/​eks/​latest/​userguide/​getting-started.html
 +
 +== MiniKube == 
 +
 +Start/​stop/​status ​
 +
 +<code java>
 +minikube start
 +minikube stop 
 +minikube status
 +minikube: Running
 +cluster: Running
 +kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
 +</​code>​
 +
 +To get the ip the minikube is running on 
 +
 +<code java>
 +minikube ip
 +192.168.99.100
 +</​code>​
 +
 +
 +Minikube context :  The context is what determines which cluster kubectl is interacting with. You can see all your available contexts in the ~/​.kube/​config file.
 +
 +<code java>
 +kubectl config use-context minikube
 +</​code>​
 +
 +Verify that kubectl is configured to communicate with your cluster:
 +
 +<​code>​
 +kubectl cluster-info
 +</​code>​
 +
 +Open the Kubernetes dashboard in a browser:
 +
 +<code java>
 +minikube dashboard
 +</​code>​
 +
 +that will open your browser to something like ..http://​192.168.99.100:​30000/#​!/​overview?​namespace=default
 +
 +Deploy an image to Kube use the [[https://​kubernetes.io/​docs/​reference/​generated/​kubectl/​kubectl-commands#​run | run]]  command ​
 +
 +<code java>
 +kubectl run salesforce --image=wtr-ecomm-etl-salesforce/​wtr-etl-salesforce:​latest ​ --port=8080
 +</​code>​
 +
 +To update a run we can **set** a new instance:
 +<code java>
 +kubectl set image deployment/​hello-node hello-node=hello-node:​v2
 +</​code>​
 +
 +== Kubectrl Pull Problem == 
 +
 +with docker images being listed in **docker images** minikube failed to run saying unable to pull the docker image
 +
 +It turns out that minikube has it's own registry and cannot see the local docker regsistry ​
 +
 +=== Hack #1 === 
 +
 +The command: ​
 +<code java>
 +minikube docker-env
 +</​code>​
 +
 +lists the minikube env variables and in local environment it can be sourced with 
 +
 +<code java>
 +eval $(minikube docker-env)
 +</​code>​
 +
 +the running in the console it is possible to 
 +
 +<code java>
 +gradle build // after eval, will now install into minikube registry ​
 +// now we run without going out to pull 
 +kubectl run salesforce --image=wtr/​wtr-etl-salesforce-1.0-snapshot:​1.0-snapshot --image-pull-policy=IfNotPresent
 +</​code>​
 +
 +
 +== Hack 2 Run a Local Registry == 
 +
 +Use a local registry:
 +<code java>
 +docker run -d -p 5000:5000 --restart=always --name registry registry:2
 +</​code>​
 +
 +Now tag your image properly:
 +
 +<code java>
 +docker tag ubuntu localhost:​5000/​ubuntu
 +</​code>​
 +
 +Note that localhost should be changed to dns name of the machine running registry container.
 +
 +Now push your image to local registry:
 +
 +<code java>
 +docker push localhost:​5000/​ubuntu
 +</​code>​
 +
 +You should be pull it back:
 +
 +<code java>
 +docker pull localhost:​5000/​ubuntu
 +</​code>​
 +
 +== Create a Deployment == 
 +
 +A Kubernetes Pod is a group of one or more Containers, tied together for the purposes of administration and networking. The Pod in this tutorial has only one Container. A Kubernetes Deployment checks on the health of your Pod and restarts the Pod’s Container if it terminates. Deployments are the recommended way to manage the creation and scaling of Pods.
 +
 +Use the kubectl run command to create a Deployment that manages a Pod. The Pod runs a Container based on your hello-node:​v1 Docker image:
 +
 +kubectl run hello-node --image=hello-node:​v1 --port=8080
 +View the Deployment:
 +
 +kubectl get deployments
 
kubernates.1525252861.txt.gz · Last modified: 2018/05/02 02:21 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd