I try to do the following tutorial but I have a problem.
https://devblogs.microsoft.com/devops/announcing-kubernetes-integration-for-azure-pipelines/
I want to deploy a simple node app in my kubernetes cluster but the YAML Template "Deploy to Azure Kubernetes Service" doesn't appear. Any idea why this could happen? It worked yesterday but now the option is gone.
Here is the link to my git repo:
https://github.com/StephanPillhofer/SimpleNodeApp
Any help very welcome.
The problem was that I didn't enable the preview feature multiple staged pipelines in the setting. Thx for your help.
Well, as you mentioned in comments the Kubernetes cluster located under Azure (AKS), therefore you can use the following steps which I find easier to maintain and more straight forward :
First of all, Get credentials from AKS using Azure CLI using az aks get-credentials. This command gets access credentials for a managed Kubernetes cluster and allows you to run kubectl
commands from the agent:
steps:
- task: AzureCLI@1
displayName: 'Azure CLI - get credentials from aks'
inputs:
azureSubscription: '$(azure_subscription)'
scriptLocation: inlineScript
inlineScript: 'az aks get-credentials --resource-group $(resource_group_name) --name $(cluster_name)'
Now, you can run any kubectl
command using a bash script.
For instance :
bash: |
kubectl apply -f manifest.yml
displayName: 'Kubectl apply my manifest.yaml'
In my opinion, it's better using bash scripts instead of depending on extensions. And, if you want to migrate your Yaml to another resource such as Jenkins you can do it easily.