<p>I am deploying <code>symmetricds</code> on <code>google container engine</code>, so i have build <code>symmetricds</code> <code>war</code> file and create <code>docker</code> <code>tomcat</code> image like below :- </p>

<pre><code>FROM tomcat
ENV JAVA_OPTS="-Dcom.sun.management.jmxremote.port=1109 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
ENV CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=1109 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

ADD ./symmetric-ds.war /usr/local/tomcat/webapps/
ADD ./mysql-connector-java-5.1.30.jar /usr/local/tomcat/lib/
COPY ./context.xml /usr/local/tomcat/conf/context.xml
COPY ./server.xml /usr/local/tomcat/conf/server.xml
COPY ./tomcat-users.xml /usr/local/tomcat/conf/tomcat-users.xml

RUN sh -c 'touch /usr/local/tomcat/webapps/symmetric-ds.war'
VOLUME /usr/local/tomcat/webapps/
EXPOSE 8080 1109
</code></pre>

<p>and after that i have push it to repository and i am using kubernetes to deploy it. 
my <code>kubernetes</code> <code>yml</code> file is below :- </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: symserver
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: symserver
    spec:
      containers:
      - name: symserver
        image: symserver:v1
        ports:
        - containerPort: 8080
        - containerPort: 1109
---
apiVersion: v1
kind: Service
metadata:
  name: symserver
spec:
  selector:
    app: symserver
  type: LoadBalancer
  ports:
  - port: 8080
  - port: 1109
</code></pre>

<p>I have two problems for which i am looking for solution :- </p>

<ol>
<li><p>As <code>docker</code> images are read only whatever properties i have defined in <code>symmetricds.properties</code> (which will be part of war file and war file be inside <code>tomcat</code> and i named <code>tomcat</code> image as <code>symserver</code> for <code>docker</code> ) file are fixed and read only. like </p>

<p>sync.url=http://$(hostName):8080/symmtric-ds/sync/$(engineName)</p></li>
</ol>

<p>when i deploy it to google cloud i get different ip for pods and service external link. so how to solve this problem ? as i have to set this ip in symmetricds.properties file so my other store node can connect to it. and when i restart the server then it 'symmetricds' will again pickup new ip or same ip again from file.</p>

<ol start="2">
<li>How to use <code>JMX</code> in case of docker and <code>kubernetes</code>, i have added <code>JMX</code> option in build file but somehow i am not able to connect it using <code>jconsole</code>. I have exposed port 1109 to local machine using port forward command. </li>
</ol>

<p><code>symmetricds.properties</code> file has either to be packed outside of the war file and then manipulated before starting the server so the placeholders could be replaced with concrete values or use the notation <code>${env.variable.value}</code> and try seeing if Spring replaces them with environment variables</p>

<p>To externalize the file <code>symmetricds.properties</code> add this section to the file <code>WEB-INF\web.xml</code></p>

<pre><code>&lt;context-param&gt;
    &lt;param-name&gt;multiServerMode&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/context-param&gt;
</code></pre>

<p>store the file on the file system in a directory, let's say <code>/opt/symm/</code> and set the java system property <code>symmetric.engines.dir</code> to the value of the directory path</p>
