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