Hello,
We have Azure Pipeline setup to build docker image and store to container registry in Azure. We have configured the environment variables (development, staging, and production) in our application code.
Now we have to use the Build Once, Deploy everywhere (development, staging, and production) strategy. We are using azuredeployment.yaml ( below) to deploy the docker image to Kubernetes.
apiVersion: apps/v1
kind: Deployment
metadata:
name: application-1-deployment
labels:
app: application-1
spec:
replicas: 2
selector:
matchLabels:
app: application-1
template:
metadata:
labels:
app: application-1
spec:
containers:
- name: application-1
image: application-1.azurecr.io/user-stub-service:v#{Build.BuildId}#
ports:
- containerPort: 5001
# start - service
apiVersion: v1
kind: Service
metadata:
name: application-1
spec:
selector:
app: application-1
ports:
- protocol: TCP
port: 5001
targetPort: 5001
type: LoadBalancer
How can we configure the pipeline and kubectl command to pass the environment variables?