-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (65 loc) · 2.35 KB
/
rsp-filestore-dir.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Sets up directories on NFS for Filestore. Do not run more than once.
name: 'RSP FILESTORE DIR'
on:
workflow_dispatch:
inputs:
gcpProject:
description: GCP Project ID
required: true
gkeCluster:
description: 'GKE Cluster used to prep NFS dirs'
required: true
filestore:
description: 'Filestore to configure NFS dirs'
required: true
jobs:
build:
name: 'Setups directories on GCP filestore for use'
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
working-directory: ./kubernetes-manifests
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
# gcp auth
- name: GCP login
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
# gcloud setup
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
skip_install: true
# Set up yq
- name: Set up yq
run: |-
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O yq
chmod +x yq
env:
YQ_VERSION: 3.4.1
# Update Filestore Address Persistent Volume Patch
- name: Update Filestore Address
run: |-
FILESTORE_IP=$(gcloud filestore instances list --filter=name:"${{ github.event.inputs.filestore }}" --format="value(IP_ADDRESS)")
echo $FILESTORE_IP
./yq w -i overlays/dev/nfs.ip.patch.yaml [].value $FILESTORE_IP
# Get the GKE credentials so we can deploy to the cluster
- id: 'get-credentials'
uses: 'google-github-actions/get-gke-credentials@v2'
with:
cluster_name: "${{ github.event.inputs.gkeCluster }}"
location: "us-central1"
# Validate the kubernetes manifest from kustomize
- name: Validate Kubernetes Manifests
run: |-
kustomize build overlays/dev
# Deploy the kubernetes manifest from kustomize
- name: Deploy Kubernetes Manifests
run: |-
kustomize build overlays/dev | kubectl apply -f -