I am trying to connect to cluster and create a namespace using github actions.
For that, I tried these steps.
In the link shared above, I first retrieved the azure service principal for connecting aks.
az ad sp create-for-rbac --name "myApp" --role contributor --scopes /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP> --sdk-auth
And then, proceeded with the steps.
But, during namespace creation, I am getting error as below.
W1102 12:06:42.227952 3700 helpers.go:555] --dry-run is deprecated and can be replaced with --dry-run=client.
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Error: Process completed with exit code 1.
Below is the github job failing.
- name: Set the target Azure Kubernetes Service (AKS) cluster.
uses: azure/aks-set-context@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
- name: Deploy to Cluster
uses: azure/k8s-deploy@v1
with:
manifests: |
manifests/deployment.yml
manifests/service.yml
images: |
${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }}
imagepullsecrets: |
${{ env.SECRET }}
namespace: ${{ env.NAMESPACE }}