Skip to content

Commit

Permalink
test a newer version of k8s
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 f32aa27 commit 19c99f0
Show file tree
Hide file tree
Showing 2 changed files with 853 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,40 @@ jobs:
credentials_json: ${{ secrets.GCLOUD_SERVICE_KEY }}
- name: Install gcloud-sdk
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"
chmod +x ./kubectl
mv ./kubectl /usr/local/bin/kubectl
- name: Setup cluster
working-directory: ${{ github.repository }}
run: |
GKE_K8S_VERSION=$(echo ${{ vars.NSM_KUBERNETES_VERSION }} | cut -c 2-)
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 container clusters create "${GKE_CLUSTER_NAME}" \
--project="${GKE_PROJECT_ID}" \
--machine-type="${GKE_CLUSTER_TYPE}" \
--num-nodes="${GKE_CLUSTER_NUM_NODES}" \
--zone="${GKE_CLUSTER_ZONE}" \
--cluster-version="${GKE_K8S_VERSION}" \
--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
Loading

0 comments on commit 19c99f0

Please sign in to comment.