Best way to change a docker image tag in a azure pipeline with kubernetes

I have my azure pipeline doing a kubernetes@1 task with my kubernetes config:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tennant-service-deployment
  labels:
    app: tennant-service
spec:
  replicas: 3
  selector:
    matchLabels:
      app: tennant-service
  template:
    metadata:
      labels:
        app: tennant-service
    spec:
      containers:
        - name: tennant-service
          image: cronesharedwesteurope.azurecr.io/tennant-service:dev
          ports:
            - containerPort: 80   
      imagePullSecrets:
        - name: registrysecret

You can see that at the moment my image is hard coded in my yaml file (tennant-service:dev).

I want the user to tell me witha azure devops pipeline parameter which version he wants (e.g, dev / 1.0 / latest). But because the kubernetes is a yaml config file, I can't change it with a parameter, can I? Are there any tools to do exactly this?



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Network Error and Timeout on Authorize.net JS