title: How to properly configure the environment in kubernetes cluster?
body: <p>I have a spring boot application with two profiles, dev and prod, my docker file is:</p>
  
  <pre><code>FROM openjdk:8-jdk-alpine
  VOLUME /tmp
  ARG DEPENDENCY=target/dependency
  COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
  COPY ${DEPENDENCY}/META-INF /app/META-INF
  COPY ${DEPENDENCY}/BOOT-INF/classes /app
  ENTRYPOINT ["java","-Dspring.profiles.active=dev","-cp","app:app/lib/*","com.my.Application"]
  </code></pre>
  
  <p>please not that, when building the image,  I specify the entrypoint as command line argument.</p>
  
  <p>This is the containers section of my kubernetes deployment where I use this image:</p>
  
  <pre><code>containers:
    - name: myapp
      image: myregistry.azurecr.io/myapp:0.1.7
      imagePullPolicy: "Always"
      ports:
      - containerPort: 8080
        name: myapp
      readinessProbe:
        httpGet:
          path: /actuator/health
          port: 8080
        timeoutSeconds: 3
        periodSeconds: 20
        failureThreshold: 3
  </code></pre>
  
  <p>It works  but has a major flaw: how can I now switch to the production environment without rebuilding the image? </p>
  
  <p>The best would be to remove that ENTRYPOINT in my docker file and give this configuration in my kubernetes yml so that I could always use the same image...is this possible?</p>
  
  <p>edit: I saw that there is a lifecycle istruction but note that I have a readiness probe based on the spring boot's actuator. It would always fail if I used this construct.</p>