Skip to content

Commit

Permalink
cleaup
Browse files Browse the repository at this point in the history
Signed-off-by: NikitaSkrynnik <[email protected]>
  • Loading branch information
NikitaSkrynnik committed Aug 8, 2024
1 parent 19c99f0 commit dec142c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 848 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,21 @@ jobs:
uses: google-github-actions/setup-gcloud@v2
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/${{ vars.NSM_KUBERNETES_VERSION }}/bin/linux/amd64/kubectl"
curl -LO https://dl.k8s.io/release/${{ vars.NSM_KUBERNETES_VERSION }}/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
- name: Setup cluster
working-directory: ${{ github.repository }}
run: |
# Get a specific GKE cluster version that matches NSM_KUBERNETES_VERSION
K8S_VERSION=$(echo ${{ vars.NSM_KUBERNETES_VERSION }} | cut -d '.' -f 1,2 | cut -c 2-)
echo $K8S_VERSION
K8S_VERSION=1.28
gcloud components install gke-gcloud-auth-plugin
gcloud components update
GKE_CLUSTER_VERSION=$(gcloud container get-server-config --zone="$GKE_CLUSTER_ZONE" --format=json \
| jq '.channels[] | select (.channel=="REGULAR") | .validVersions[]' \
| grep -m 1 "$K8S_VERSION" | tr -d '"')
echo $GKE_CLUSTER_VERSION
gcloud components install gke-gcloud-auth-plugin
gcloud components update
gcloud container clusters create "${GKE_CLUSTER_NAME}" \
--project="${GKE_PROJECT_ID}" \
--machine-type="${GKE_CLUSTER_TYPE}" \
Expand All @@ -76,12 +73,8 @@ jobs:
--cluster-version="${GKE_CLUSTER_VERSION}" \
--enable-gvnic -q

gcloud components list
echo "Writing config to ${KUBECONFIG}"
gcloud container clusters get-credentials "${GKE_CLUSTER_NAME}" --project="${GKE_PROJECT_ID}" --zone="${GKE_CLUSTER_ZONE}"
gcloud components list
env:
GKE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }}
GKE_CLUSTER_NAME: gke-${{ github.run_id }}-${{ github.run_number }}
Expand Down Expand Up @@ -109,7 +102,7 @@ jobs:
GKE_CLUSTER_NAME: gke-${{ github.run_id }}-${{ github.run_number }}
GKE_CLUSTER_ZONE: us-central1-a
- name: Upload logs
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: logs-${{ github.run_number }}
Expand Down
Loading

0 comments on commit dec142c

Please sign in to comment.