I am having difficulties with Apache ignite docker instance with persistent storage in gcloud.
The way I want to deploy an ignite docker instance in gcloud is when I push my code to github then it triggers a build and update new docker instance, it mounts and stores data in persistent volume automatically in Google cloud from what I created before. By the way I am not going to use kubernetes service for now because of some reasons with gcloud price.
I could deploy persistence-volume manually in console.
docker run -d -v persistence-volume:/persistence -e IGNITE_WORK_DIR=/persistence ignite-database:version
[What is working] Push code to github to trigger to build new instance and update in gcloud.
[What is not working] Automatically mount the persistent volume created before when I push the code to github.
I feel like gcloud command or cloud.yaml file are the ones I have to go through to fix it. It is not clear in what I have to do.
[cloud.yaml] (github triggers to build new update)
steps:
- name: 'gcr.io/kaniko-project/executor:v0.20.0'
args:
- --destination=gcr.io/$PROJECT_ID/database:latest
- --cache=true
- --cache-ttl=168h
- name: gcr.io/cloud-builders/gcloud
args: [ compute, instances, update-container, database, --container-restart-policy=always, --zone=us-east1-a ]
timeout: 1200s
[Dockerfile]
# Start from a Java image.
FROM openjdk:8
# Ignite version
ENV IGNITE_VERSION 2.8.0
ENV JVM_OPTS -Xms512m -server -XX:+AlwaysPreTouch -XX:+UseG1GC -XX:+ScavengeBeforeFullGC -XX:+DisableExplicitGC -Djava.net.preferIPv4Stack=true
# Ignite home
ENV IGNITE_HOME /opt/ignite/apache-ignite-${IGNITE_VERSION}-bin
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt/ignite
RUN wget https://archive.apache.org/dist/ignite/2.8.0/apache-ignite-2.8.0-bin.zip \
&& unzip apache-ignite-${IGNITE_VERSION}-bin.zip \
&& rm apache-ignite-${IGNITE_VERSION}-bin.zip
COPY ./config/run.sh $IGNITE_HOME/
#COPY ./config/default-config.xml $IGNITE_HOME/apache-ignite@default-config.xml
#COPY ./config/persistence-config.xml $IGNITE_HOME/apache-ignite@persistence-config.xml
COPY ./config/control.sh $IGNITE_HOME/
COPY ./config/run_and_activate.sh $IGNITE_HOME/
#RUN sysctl start apache-ignite@default-config.xml
#RUN sysctl enable apache-ignite@persistence-config.xml
RUN chmod +x $IGNITE_HOME/run.sh
RUN chmod +x $IGNITE_HOME/control.sh
RUN chmod +x $IGNITE_HOME/run_and_activate.sh
CMD $IGNITE_HOME/run_and_activate.sh
EXPOSE 11211 47100 47500 49112
I am looking forward your advice.