How to Add Secret yaml in Azure DevOps pipeline for AKS

Viewed 55

I am trying out few things in AKS. Right now I am trying to release to AKS through Azure DevOps. But I have a doubt that I have 3 yaml files (ConfigMap, Deployment and Secret) and I mentioned the below in deployment.yaml file

envFrom:
        - secretRef:
            name: webinar-web-app-secret
        - configMapRef:
            name: webinar-web-app-configmap

Right now my release file looks like this. Please guide me how to add the secret.yaml file in the pipeline

trigger: 
  - master

pool:
  vmImage: ubuntu-latest
  
resources:
- repo: self

stages:
- stage: 'Deployment_AKS_Prod'
  displayName: 'Deploy To AKS prod'
  jobs:
    - deployment: Release
      environment: 'test-aks.prod'
      displayName: 'Release'
      strategy:
        runOnce:
          deploy:
            steps:
            - checkout: self

            - task: Kubernetes@1
              displayName: Deploying Manifests into AKS
              inputs:
                connectionType: 'Azure Resource Manager'
                azureSubscriptionEndpoint: 'aks'
                azureResourceGroup: 'test-rg'
                kubernetesCluster: 'test-aks'
                namespace: 'prod'
                command: 'apply'
                useConfigurationFile: true
                configuration: '$(Build.SourcesDirectory)/deployment/webinar-app.yaml'
                secretType: 'dockerRegistry'
                containerRegistryType: 'Azure Container Registry'
                useConfigMapFile: true
                configMapFile: '$(Build.SourcesDirectory)/deployment/configmap.yaml'
0 Answers
Related