Skip to content

Instantly share code, notes, and snippets.

@weebNeedWeed
Created July 17, 2024 07:46
Show Gist options
  • Save weebNeedWeed/a5e148f8568bd6edf98ed5faa6865f1a to your computer and use it in GitHub Desktop.
Save weebNeedWeed/a5e148f8568bd6edf98ed5faa6865f1a to your computer and use it in GitHub Desktop.
export REGION=us-central1
export ZONE=us-central1-f
gcloud config set compute/region $REGION
gcloud config set compute/zone $ZONE
# Task 1
gcloud compute networks create griffin-dev-vpc \
--subnet-mode custom
gcloud compute networks subnets create griffin-dev-wp \
--network griffin-dev-vpc \
--range 192.168.16.0/20
gcloud compute networks subnets create griffin-dev-mgmt \
--network griffin-dev-vpc \
--range 192.168.32.0/20
# Task 2
gcloud compute networks create griffin-prod-vpc \
--subnet-mode custom
gcloud compute networks subnets create griffin-prod-wp \
--network griffin-prod-vpc \
--range 192.168.48.0/20
gcloud compute networks subnets create griffin-prod-mgmt \
--network griffin-prod-vpc \
--range 192.168.64.0/20
# Task 3
# Create Host on Console
gcloud compute firewall-rules create allow-ssh \
--network=griffin-dev-vpc \
--action=ALLOW \
--rules=tcp:22 \
--source-ranges=0.0.0.0/0
gcloud compute firewall-rules create allow-ssh-2 \
--network=griffin-prod-vpc \
--action=ALLOW \
--rules=tcp:22 \
--source-ranges=0.0.0.0/0
# Task 4 on Console
gcloud sql connect griffin-dev-db --user=root --quiet
# Task 5
gcloud container clusters create griffin-dev \
--network griffin-dev-vpc \
--subnetwork griffin-dev-wp \
--zone $ZONE \
--num-nodes 2
# Task 6
gsutil cp -m -r gs://cloud-training/gsp321/wp-k8s .
gcloud container clusters get-credentials griffin-dev
kubectl apply -f wp-env.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment