Skip to content

Commit 025d8f9

Browse files
audrastumpaudrastump
andauthored
Fleet bump (#447)
Co-authored-by: audrastump <stumpaudra@microsoft.com>
1 parent de8afa9 commit 025d8f9

9 files changed

Lines changed: 72 additions & 32 deletions

File tree

.github/workflows/integration-per-language.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ jobs:
158158
--variable CONTAINERNAME=someContainer \
159159
--variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \
160160
--variable CLUSTERNAME=someAksCluster \
161+
--variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \
161162
--variable DOCKERFILE=./Dockerfile \
162163
--variable BUILDCONTEXTPATH=. \
163164
--variable NAMESPACE=default
@@ -331,6 +332,7 @@ jobs:
331332
--variable CONTAINERNAME=someContainer \
332333
--variable CLUSTERRESOURCEGROUP=someClusterResourceGroup \
333334
--variable CLUSTERNAME=someAksCluster \
335+
--variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters \
334336
--variable DOCKERFILE=./Dockerfile \
335337
--variable BUILDCONTEXTPATH=. \
336338
--variable NAMESPACE=default
@@ -484,7 +486,7 @@ jobs:
484486
curl -m 3 $SERVICEIP:${{env.serviceport}}
485487
sleep 5
486488
kill $tunnelPID
487-
- run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default
489+
- run: ./draft -v generate-workflow -d ./langtest/ --deploy-type manifests --variable WORKFLOWNAME=someWorkflow --variable BRANCHNAME=main --variable ACRRESOURCEGROUP=someAcrResourceGroup --variable AZURECONTAINERREGISTRY=someRegistry --variable CONTAINERNAME=someContainer --variable CLUSTERRESOURCEGROUP=someClusterResourceGroup --variable CLUSTERNAME=someAksCluster --variable CLUSTERRESOURCETYPE=Microsoft.ContainerService/managedClusters --variable DOCKERFILE=./Dockerfile --variable BUILDCONTEXTPATH=. --variable NAMESPACE=default
488490
# Validate generated workflow yaml
489491
- name: Install action-validator with asdf
490492
uses: asdf-vm/actions/install@v1

pkg/fixtures/workflows/github/helm/.github/workflows/azure-kubernetes-service-helm.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# - ACR_RESOURCE_GROUP (resource group of your ACR)
2121
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
2222
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
23+
# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2324
# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
24-
# - CLUSTER_NAME (name of your AKS cluster)
25+
# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters')
2526
# - DOCKER_FILE (path to your Dockerfile)
2627
# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728
# - CHART_PATH (path to your helm chart)
@@ -44,8 +45,9 @@ env:
4445
ACR_RESOURCE_GROUP: testAcrRG
4546
AZURE_CONTAINER_REGISTRY: testAcr
4647
CONTAINER_NAME: testContainer
47-
CLUSTER_RESOURCE_GROUP: testClusterRG
4848
CLUSTER_NAME: testCluster
49+
CLUSTER_RESOURCE_GROUP: testClusterRG
50+
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters
4951
DOCKER_FILE: ./Dockerfile
5052
BUILD_CONTEXT_PATH: test
5153
CHART_PATH: testPath
@@ -102,16 +104,18 @@ jobs:
102104

103105
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
104106
- name: Get K8s context
105-
uses: azure/aks-set-context@v3
107+
uses: azure/aks-set-context@v4
106108
with:
107109
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
108110
cluster-name: ${{ env.CLUSTER_NAME }}
111+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
109112
admin: "false"
110113
use-kubelogin: "true"
111114

112115
# Checks if the AKS cluster is private
113116
- name: Is private cluster
114117
id: isPrivate
118+
if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
115119
run: |
116120
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
117121
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
@@ -124,11 +128,17 @@ jobs:
124128
result=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id)
125129
echo "Helm upgrade result: $result"
126130
exitCode=$(az aks command result --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --command-id $command_id --query exitCode -o tsv)
127-
131+
128132
if [ $exitCode -ne 0 ]; then
129133
exit $exitCode
130134
fi
131135
132136
- name: Deploy application on public cluster
133-
if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true'
134-
run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace
137+
if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
138+
run: |
139+
helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace
140+
141+
- name: Deploy application on fleet hub cluster
142+
if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }}
143+
run: |
144+
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}

pkg/fixtures/workflows/github/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# - ACR_RESOURCE_GROUP (resource group of your ACR)
2121
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
2222
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
23+
# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2324
# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
24-
# - CLUSTER_NAME (name of your AKS cluster)
25+
# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedCluster')
2526
# - DOCKER_FILE (path to your Dockerfile)
2627
# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728
# - NAMESPACE (namespace to deploy your application)
@@ -45,8 +46,9 @@ env:
4546
ACR_RESOURCE_GROUP: testAcrRG
4647
AZURE_CONTAINER_REGISTRY: testAcr
4748
CONTAINER_NAME: testContainer
48-
CLUSTER_RESOURCE_GROUP: testClusterRG
4949
CLUSTER_NAME: testCluster
50+
CLUSTER_RESOURCE_GROUP: testClusterRG
51+
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters
5052
KUSTOMIZE_PATH: ./overlays/production
5153
DOCKER_FILE: ./Dockerfile
5254
BUILD_CONTEXT_PATH: test
@@ -101,12 +103,13 @@ jobs:
101103

102104
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
103105
- name: Get K8s context
104-
uses: azure/aks-set-context@v3
106+
uses: azure/aks-set-context@v4
105107
with:
106108
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
107109
cluster-name: ${{ env.CLUSTER_NAME }}
108110
admin: 'false'
109111
use-kubelogin: 'true'
112+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
110113

111114
# Runs Kustomize to create manifest files
112115
- name: Bake deployment
@@ -116,17 +119,17 @@ jobs:
116119
kustomizationPath: ${{ env.KUSTOMIZE_PATH }}
117120
kubectl-version: latest
118121
id: bake
119-
120122
# Checks if the AKS cluster is private
121123
- name: Is private cluster
124+
if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
122125
id: isPrivate
123126
run: |
124127
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
125128
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
126129
127130
# Deploys application based on manifest files from previous step
128131
- name: Deploy application
129-
uses: Azure/k8s-deploy@v4
132+
uses: Azure/k8s-deploy@v5
130133
with:
131134
action: deploy
132135
manifests: ${{ steps.bake.outputs.manifestsBundle }}
@@ -136,4 +139,5 @@ jobs:
136139
name: ${{ env.CLUSTER_NAME }}
137140
private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
138141
namespace: ${{ env.NAMESPACE }}
142+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
139143

pkg/fixtures/workflows/github/manifests/.github/workflows/azure-kubernetes-service.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
# 2. Set the following environment variables (or replace the values below):
1919
# - ACR_RESOURCE_GROUP (resource group of your ACR)
2020
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
21+
# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2122
# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
22-
# - CLUSTER_NAME (name of your AKS cluster)
23+
# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters')
2324
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
2425
# - DEPLOYMENT_MANIFEST_PATH (path to the manifest yaml for your deployment)
2526
# - DOCKER_FILE (path to your Dockerfile)
2627
# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728
# - NAMESPACE (namespace to deploy your application)
28-
#
2929
# For more information on GitHub Actions for Azure, refer to https://github.com/Azure/Actions
3030
# For more samples to get started with GitHub Action workflows to deploy to Azure, refer to https://github.com/Azure/actions-workflow-samples
3131
# For more options with the actions used below please refer to https://github.com/Azure/login
@@ -41,8 +41,9 @@ env:
4141
ACR_RESOURCE_GROUP: testAcrRG
4242
AZURE_CONTAINER_REGISTRY: testAcr
4343
CONTAINER_NAME: testContainer
44-
CLUSTER_RESOURCE_GROUP: testClusterRG
4544
CLUSTER_NAME: testCluster
45+
CLUSTER_RESOURCE_GROUP: testClusterRG
46+
CLUSTER_RESOURCE_TYPE: Microsoft.ContainerService/managedClusters
4647
DEPLOYMENT_MANIFEST_PATH: ./manifests
4748
DOCKER_FILE: ./Dockerfile
4849
BUILD_CONTEXT_PATH: test
@@ -97,23 +98,25 @@ jobs:
9798

9899
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
99100
- name: Get K8s context
100-
uses: azure/aks-set-context@v3
101+
uses: azure/aks-set-context@v4
101102
with:
102103
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
103104
cluster-name: ${{ env.CLUSTER_NAME }}
104105
admin: 'false'
105106
use-kubelogin: 'true'
107+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
106108

107109
# Checks if the AKS cluster is private
108110
- name: Is private cluster
111+
if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
109112
id: isPrivate
110113
run: |
111114
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
112115
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
113116
114117
# Deploys application based on given manifest file
115118
- name: Deploys application
116-
uses: Azure/k8s-deploy@v4
119+
uses: Azure/k8s-deploy@v5
117120
with:
118121
action: deploy
119122
manifests: ${{ env.DEPLOYMENT_MANIFEST_PATH }}
@@ -123,3 +126,4 @@ jobs:
123126
name: ${{ env.CLUSTER_NAME }}
124127
private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
125128
namespace: ${{ env.NAMESPACE }}
129+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}

pkg/handlers/templatetests/workflows_github_helm_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func TestGitHubWorkflowHelmTemplates(t *testing.T) {
2222
"AZURECONTAINERREGISTRY": "testAcr",
2323
"CONTAINERNAME": "testContainer",
2424
"CLUSTERRESOURCEGROUP": "testClusterRG",
25+
"CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters",
2526
"CLUSTERNAME": "testCluster",
2627
"KUSTOMIZEPATH": "./overlays/production",
2728
"DEPLOYMENTMANIFESTPATH": "./manifests",

pkg/handlers/templatetests/workflows_github_kustomize_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func TestGitHubWorkflowKustomizeTemplates(t *testing.T) {
2222
"AZURECONTAINERREGISTRY": "testAcr",
2323
"CONTAINERNAME": "testContainer",
2424
"CLUSTERRESOURCEGROUP": "testClusterRG",
25+
"CLUSTERRESOURCETYPE": "Microsoft.ContainerService/managedClusters",
2526
"CLUSTERNAME": "testCluster",
2627
"DEPLOYMENTMANIFESTPATH": "./manifests",
2728
"DOCKERFILE": "./Dockerfile",

template/workflows/helm/.github/workflows/azure-kubernetes-service-helm.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# - ACR_RESOURCE_GROUP (resource group of your ACR)
2121
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
2222
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
23+
# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2324
# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
24-
# - CLUSTER_NAME (name of your AKS cluster)
25+
# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedClusters')
2526
# - DOCKER_FILE (path to your Dockerfile)
2627
# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728
# - CHART_PATH (path to your helm chart)
@@ -44,8 +45,9 @@ env:
4445
ACR_RESOURCE_GROUP: {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }}
4546
AZURE_CONTAINER_REGISTRY: {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }}
4647
CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }}
47-
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
4848
CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }}
49+
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
50+
CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
4951
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
5052
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
5153
CHART_PATH: {{ .Config.GetVariableValue "CHARTPATH" }}
@@ -102,16 +104,18 @@ jobs:
102104

103105
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
104106
- name: Get K8s context
105-
uses: azure/aks-set-context@v3
107+
uses: azure/aks-set-context@v4
106108
with:
107109
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
108110
cluster-name: ${{ env.CLUSTER_NAME }}
111+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
109112
admin: "false"
110113
use-kubelogin: "true"
111114

112115
# Checks if the AKS cluster is private
113116
- name: Is private cluster
114117
id: isPrivate
118+
if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
115119
run: |
116120
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
117121
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
@@ -130,6 +134,12 @@ jobs:
130134
fi
131135
132136
- name: Deploy application on public cluster
133-
if: steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true'
134-
run: helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace
137+
if: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER != 'true' && env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
138+
run: |
139+
helm upgrade --wait -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }} --create-namespace
140+
141+
- name: Deploy application on fleet hub cluster
142+
if: ${{ env.CLUSTER_RESOURCE_TYPE == 'Microsoft.ContainerService/fleets' }}
143+
run: |
144+
helm upgrade -i -f ${{ env.CHART_OVERRIDE_PATH }} --set ${{ env.CHART_OVERRIDES }} --set image.tag=${{ github.sha }} automated-deployment ${{ env.CHART_PATH }} --namespace ${{ env.NAMESPACE }}
135145
`}}

template/workflows/kustomize/.github/workflows/azure-kubernetes-service-kustomize.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# - ACR_RESOURCE_GROUP (resource group of your ACR)
2121
# - AZURE_CONTAINER_REGISTRY (name of your container registry / ACR)
2222
# - CONTAINER_NAME (name of the container image you would like to push up to your ACR)
23+
# - CLUSTER_NAME (name of the resource to deploy to - fleet name or managed cluster name)
2324
# - CLUSTER_RESOURCE_GROUP (where your cluster is deployed)
24-
# - CLUSTER_NAME (name of your AKS cluster)
25+
# - CLUSTER_RESOURCE_TYPE (type of resource to deploy to, either 'Microsoft.ContainerService/fleets' or 'Microsoft.ContainerService/managedCluster')
2526
# - DOCKER_FILE (path to your Dockerfile)
2627
# - BUILD_CONTEXT_PATH (path to the context of your Dockerfile)
2728
# - NAMESPACE (namespace to deploy your application)
@@ -45,8 +46,9 @@ env:
4546
ACR_RESOURCE_GROUP: {{ .Config.GetVariableValue "ACRRESOURCEGROUP" }}
4647
AZURE_CONTAINER_REGISTRY: {{ .Config.GetVariableValue "AZURECONTAINERREGISTRY" }}
4748
CONTAINER_NAME: {{ .Config.GetVariableValue "CONTAINERNAME" }}
48-
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
4949
CLUSTER_NAME: {{ .Config.GetVariableValue "CLUSTERNAME" }}
50+
CLUSTER_RESOURCE_GROUP: {{ .Config.GetVariableValue "CLUSTERRESOURCEGROUP" }}
51+
CLUSTER_RESOURCE_TYPE: {{ .Config.GetVariableValue "CLUSTERRESOURCETYPE" }}
5052
KUSTOMIZE_PATH: {{ .Config.GetVariableValue "KUSTOMIZEPATH" }}
5153
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
5254
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
@@ -101,12 +103,13 @@ jobs:
101103

102104
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
103105
- name: Get K8s context
104-
uses: azure/aks-set-context@v3
106+
uses: azure/aks-set-context@v4
105107
with:
106108
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
107109
cluster-name: ${{ env.CLUSTER_NAME }}
108110
admin: 'false'
109111
use-kubelogin: 'true'
112+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
110113

111114
# Runs Kustomize to create manifest files
112115
- name: Bake deployment
@@ -116,17 +119,17 @@ jobs:
116119
kustomizationPath: ${{ env.KUSTOMIZE_PATH }}
117120
kubectl-version: latest
118121
id: bake
119-
120122
# Checks if the AKS cluster is private
121123
- name: Is private cluster
124+
if: ${{ env.CLUSTER_RESOURCE_TYPE != 'Microsoft.ContainerService/fleets' }}
122125
id: isPrivate
123126
run: |
124127
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
125128
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
126129
127130
# Deploys application based on manifest files from previous step
128131
- name: Deploy application
129-
uses: Azure/k8s-deploy@v4
132+
uses: Azure/k8s-deploy@v5
130133
with:
131134
action: deploy
132135
manifests: ${{ steps.bake.outputs.manifestsBundle }}
@@ -136,4 +139,5 @@ jobs:
136139
name: ${{ env.CLUSTER_NAME }}
137140
private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
138141
namespace: ${{ env.NAMESPACE }}
142+
resource-type: ${{ env.CLUSTER_RESOURCE_TYPE }}
139143
`}}

0 commit comments

Comments
 (0)