<p>i want to start Java spring app with active profile...
I build Docker image in Gitlab CI/CD using maven wrapper ,</p>
<pre><code>./mvnw compile jib:build -Dimage=image/sms-service:1
</code></pre>
<p>after that i deploy app in k8s....</p>
<p>now i want to run with active profile , what is best way? how can i define in k8s to run specific user</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: sms-service
  namespace: sms-service
spec:
  selector:
    matchLabels:
      app: sms-service
  replicas: 4 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: sms-service
    spec:
  template:
    spec:
      containers:
      - name: sms-service
        image: image/sms-service:1
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
      imagePullSecrets:
      - name: sms-service
</code></pre>

stackK
<p>Set the <code>SPRING_PROFILES_ACTIVE</code> environment variable to the profile(s) you want to run.</p>
<p>You can set it in the deployment yaml or at build time in your image but usually better to add it to deployment.</p>
