From 8fe064d1c1308af2f015a475d17105fa7aff3328 Mon Sep 17 00:00:00 2001 From: Fredrik Klingenberg Date: Thu, 20 Oct 2022 19:17:15 +0200 Subject: [PATCH 1/2] ADD: Private cluster Signed-off-by: Fredrik Klingenberg --- bicep/modules/aks.bicep | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bicep/modules/aks.bicep b/bicep/modules/aks.bicep index 7395116..aa697fb 100644 --- a/bicep/modules/aks.bicep +++ b/bicep/modules/aks.bicep @@ -28,6 +28,9 @@ resource aks 'Microsoft.ContainerService/managedClusters@2022-05-02-preview' = { } properties: { dnsPrefix: dnsPrefix + apiServerAccessProfile: { + enablePrivateCluster: true + } agentPoolProfiles: [ { name: 'agentpool' From 17d3052c514644fb70763302408d70d6dca1bc69 Mon Sep 17 00:00:00 2001 From: Fredrik Klingenberg Date: Thu, 20 Oct 2022 19:47:21 +0200 Subject: [PATCH 2/2] FIX: Run private cluster command Signed-off-by: Fredrik Klingenberg --- .github/workflows/create-infra.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-infra.yml b/.github/workflows/create-infra.yml index 2f2b44d..1480ac4 100644 --- a/.github/workflows/create-infra.yml +++ b/.github/workflows/create-infra.yml @@ -41,7 +41,9 @@ jobs: - name: Kubectl tool installer uses: Azure/setup-kubectl@v3 - - name: Kick off GitOps - run: | - kubectl get nodes - kubectl get ns \ No newline at end of file + - name: Azure CLI script + uses: azure/CLI@v1 + with: + azcliversion: 2.30.0 + inlineScript: | + az aks command invoke --resource-group ${{ env.CLUSTER_NAME }} --name ${{ env.CLUSTER_NAME }} --command "kubectl get nodes" \ No newline at end of file