From 80605a8cb6ec3662ea6268d0dbc6b40880e1fe13 Mon Sep 17 00:00:00 2001 From: Brian Kelley Date: Thu, 6 Dec 2018 11:27:11 -0600 Subject: [PATCH] Update README to include new kubernetes specific environment variables, and example of how to utilize the downward api --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ad5f21..106128d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,11 @@ JMXREMOTE_PASSWORD_FILE CATALINA_OPTS JAVA_OPTS [ -Djava.awt.headless=true ] -MASTER_NODE_NAME -- Enable clustering, when set this container will be the master node, should be set as the hostname from the perspective of MySQL login +MASTER_NODE_NAME -- Enable clustering, when set this container will be the master node + should be set as the hostname from the perspective of MySQL login + +POD_NAME -- Enable Kubernetes clustering via downward API +POD_IP -- Enable Kubernetes clustering via downward API ``` @@ -50,4 +54,18 @@ docker run -p 8080:8080 -d \ -v $(pwd)/ROOT.war:/data/ROOT.war \ -v $(pwd)/webapps:/usr/local/tomcat/webapps \ jamfpro -``` \ No newline at end of file +``` + +## Kubernetes Deployment +When enabling clustering the Tomcat manifest should include both `POD_NAME` and `POD_IP` environment variables which can be accessed via the Kubernetes downward API. The environment variable `MASTER_NODE_NAME` should be set to whichever pod will become the master node. An example of utilizing the downward API in a manifest: +``` +- name: POD_NAME +valueFrom: + fieldRef: + fieldPath: metadata.name +- name: POD_IP +valueFrom: + fieldRef: + fieldPath: status.podIP +``` +A set of example Kubernetes manifests can be found in another Github repo here: [JamfPro Kubernetes Manifests](https://github.com/jamf/kubernetesManifests) \ No newline at end of file