Skip to content

Commit

Permalink
removed kubeconfig env
Browse files Browse the repository at this point in the history
  • Loading branch information
audrastump committed Nov 18, 2024
1 parent 4ee7be7 commit 9945538
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ env:
DOCKER_FILE: {{ .Config.GetVariableValue "DOCKERFILE" }}
BUILD_CONTEXT_PATH: {{ .Config.GetVariableValue "BUILDCONTEXTPATH" }}
NAMESPACE: {{ .Config.GetVariableValue "NAMESPACE" }}
FLEET: {{ .Config.GetVariableValue "FLEET" }}
FLEET_NAME: {{ .Config.GetVariableValue "FLEET_NAME" }}
{{`
jobs:
Expand Down Expand Up @@ -99,15 +98,14 @@ jobs:

# gets credentials for a fleet
- name: Get fleet credentials
if: env.FLEET == 'true'
if: ${{ env.FLEET_NAME != '' }}
run: |
az fleet get-credentials -g ${{ env.CLUSTER_RESOURCE_GROUP }} -n ${{ env.FLEET_NAME }}
export KUBECONFIG=/home/runner/.kube/config
echo "KUBECONFIG=/home/runner/.kube/config" >> $GITHUB_ENV
# Retrieves your Azure Kubernetes Service cluster's kubeconfig file
- name: Get K8s context
if: env.FLEET != 'true'
if: ${{ env.FLEET_NAME == '' }}
uses: azure/aks-set-context@v3
with:
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
Expand All @@ -117,15 +115,15 @@ jobs:

# Checks if the AKS cluster is private
- name: Is private cluster
if: env.FLEET != 'true'
if: ${{ env.FLEET_NAME == '' }}
id: isPrivate
run: |
result=$(az aks show --resource-group ${{ env.CLUSTER_RESOURCE_GROUP }} --name ${{ env.CLUSTER_NAME }} --query "apiServerAccessProfile.enablePrivateCluster")
echo "PRIVATE_CLUSTER=$result" >> "$GITHUB_OUTPUT"
# Deploys application based on given manifest file
- name: Deploys application
if: env.FLEET != 'true'
if: ${{ env.FLEET_NAME == '' }}
uses: Azure/k8s-deploy@v4
with:
action: deploy
Expand All @@ -137,7 +135,7 @@ jobs:
private-cluster: ${{ steps.isPrivate.outputs.PRIVATE_CLUSTER == 'true' }}
namespace: ${{ env.NAMESPACE }}
- name: Deploys fleet application
if: env.FLEET == 'true'
if: ${{ env.FLEET_NAME != '' }}
run: |
kubectl config current-context
/usr/bin/kubectl apply --validate=false --request-timeout=60s -f ${{ env.DEPLOYMENT_MANIFEST_PATH }}/configmap.yaml,${{ env.DEPLOYMENT_MANIFEST_PATH }}/deployment.yaml,${{ env.DEPLOYMENT_MANIFEST_PATH }}/service.yaml --namespace ${{ env.NAMESPACE }}
Expand Down

0 comments on commit 9945538

Please sign in to comment.