Skip to content

Instantly share code, notes, and snippets.

@alexandreroman
Last active October 25, 2018 14:21
Show Gist options
  • Save alexandreroman/0c715c258932bd018ab57312d6c07a24 to your computer and use it in GitHub Desktop.
Save alexandreroman/0c715c258932bd018ab57312d6c07a24 to your computer and use it in GitHub Desktop.
Deploy wordsmith demo from DockerCon EU 17 to K8s

Deploy wordsmith demo to K8s

Wordsmith is the demo project shown at DockerCon EU 2017, where Docker announced that support for Kubernetes was coming to the Docker platform.

The following components will be deployed:

  • db: a PostgreSQL database storing words
  • words: a Java REST API which serves words read from the database
  • web: a Go web application which calls the API and builds words into sentences

Deploy the app using this command:

$ kubectl apply -f https://raw.githubusercontent.com/dockersamples/k8s-wordsmith-demo/master/kube-deployment.yml
service/db created
deployment.apps/db created
service/words created
deployment.apps/words created
service/web created
deployment.apps/web created

Monitor app deployment:

$ kubectl get pods
NAME                     READY   STATUS              RESTARTS   AGE
db-79b64dd4bb-4mkj6      0/1     ContainerCreating   0          6s
web-58d8d84784-jgf2t     0/1     ContainerCreating   0          5s
words-6f8c8d68b9-6b8f5   0/1     ContainerCreating   0          6s
words-6f8c8d68b9-gvjc8   0/1     ContainerCreating   0          6s
words-6f8c8d68b9-j72h5   0/1     ContainerCreating   0          6s
words-6f8c8d68b9-kljg4   0/1     ContainerCreating   0          6s
words-6f8c8d68b9-lm6tg   0/1     ContainerCreating   0          6s

Wait for the app to be ready (IP address should be allocated):

$ kubectl get services web
NAME   TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)          AGE
web    LoadBalancer   10.100.200.115   35.187.102.136   8081:31510/TCP   27m

This app is exposed with a LoadBalancer object on port 8081.

Use your browser to access this app: http://<External IP>:8081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment