Push image to Docker.com and then deploy via Kubernetes.

The last article we deployed a image to a local Harbor repository. While some might consider that more challenging, I’m going to do something similar here.

  1. We will push our image to Docker.com
  2. We will then create a namespace in kubernetes and pull the image from Docker.

Go to Docker.com and create your account.

Using the same SSH server image we created in the previous demostration, we will push that image out to Docker. The image name is: egsshd This is my attempt at building a simple service to get familiar with how to interact with Docker, and kubernetes.

Once you have a docker account set up, we are ready to push our image. First we will need to make a tag for the image using docker tag command followed by docker push command. Since my docker username is benatx123, I put that in my command, followed by the image name, followed by a tag.

Now in docker.com under repositories, we have a new public image. If you want to make your image private, you may.

I added a comment/Readme letting others know this is a simple ssh server service and the root password is VMware1!

Now that our image is ready we need to build a yaml file and point to the image. In the last example, I just posted a screenshot of the yaml file. But, let’s make this a little easier. I will publish the kubernetes yaml file to github.com. I created a github account and then created a new repository called 8ks-sshd. You can find this repository here: https://github.com/batx123/k8s-sshd

Log into VMware Vsphere 7 with kubernetes and create a new namespace. Assign a user with edit rights to the namespace. Assign a storage policy to the namespace.

Log into kubernetes and apply the yaml file.

We created the deployment. Now.. does it work? Let’s see.

Boom! Mission accomplished. Now if you want to copy this.. just install git and do a git clone.

$git clone https://github.com/batx123/k8s-sshd.git

And if you are curious as to what happened in NSX-T 3.0, here’s a screenshot of the load balancer IP. The application was automatically configured by adding LoadBalancer to the yaml file.

Published by Ben

I do stuff in the datacenter.

Leave a comment

Your email address will not be published. Required fields are marked *