Kubernetes - deploying to a cluster (real cluster)



Surprisingly deploying to a cluster is pretty straight forward.

To run or deploy your application to cluster, issue the following command :-



kubectl run --kubeconfig connect_config.txt connectcd --image=kepung/dotnetapp-prod
--port=5050




The only different is --kubeconfig - which is a file storing your cluster info including access.

Next, to ensure, we expose our port with a service, using command below :-


kubectl --kubeconfig connect_config.txt expose deployment/connectcd
--type="LoadBalancer" --port=5050 --name=connectcd-http


That's pretty much it.

To get the service url for your pod, you can use the following command :-

kubectl --kubeconfig connect_config.txt get service connectcd-http -o yaml


You will see the following output and it contains the DNS of the newly deployed service. Please wait for a few seconds for AWS DNS to have it registered in there.








Comments

Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners