Skip to content

Instantly share code, notes, and snippets.

View pydevops's full-sized avatar
🏠
Working from home

Victor Yang pydevops

🏠
Working from home
View GitHub Profile
@pydevops
pydevops / gke-gce-cloud-armor-lb.sh
Created December 7, 2021 23:42 — forked from mikesparr/gke-gce-cloud-armor-lb.sh
Example Cloud Armor policies protecting Google HTTPS Global Load Balancer in front of GCE instance group and GKE cluster
#!/usr/bin/env bash
# REF: https://cloud.google.com/armor/docs/integrating-cloud-armor#with_ingress
# REF: https://cloud.google.com/armor/docs/configure-security-policies
# REF: https://cloud.google.com/iap/docs/load-balancer-howto
# REF: https://cloud.google.com/sdk/gcloud/reference/compute/url-maps/add-path-matcher
# REF: https://cloud.google.com/load-balancing/docs/https/setting-up-url-rewrite
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
@pydevops
pydevops / core-arch-training.md
Created May 21, 2021 18:54 — forked from mikesparr/core-arch-training.md
Core cloud architecture training videos

The following videos, or playlists, can help ensure consistent knowledge amongst all core team members and help make customer support easier.

  • CS fundamentals - 12-min videos (9 hr)

    • Learn about computer origins, transistors, logic gates, and computer architecture

    • Learn about binary, bits, and bytes (bits, bytes, and octets key in networking)

    • Computer architecture, programming, languages, ML, robotics

@pydevops
pydevops / cloud-scheduler-run-demo.sh
Created May 21, 2021 18:49 — forked from mikesparr/cloud-scheduler-run-demo.sh
Google Cloud demo invoking a Cloud Run app in Ruby using Cloud Scheduler with OIDC
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-central1" # CHANGEME (OPT)
export GCP_ZONE="us-central1-a" # CHANGEME (OPT)
export NETWORK_NAME="default"
@pydevops
pydevops / artifact-registry-cloud-run-demo.sh
Created May 21, 2021 18:41 — forked from mikesparr/artifact-registry-cloud-run-demo.sh
Google Cloud Platform demo of Artifact Registry deployment and Cloud Run app
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-east1" # CHANGEME (OPT)
export GCP_ZONE="us-east1-c" # CHANGEME (OPT)
export NETWORK_NAME="default"
@pydevops
pydevops / gcp-iam-restrict-user-bucket.sh
Created March 20, 2021 17:15 — forked from mikesparr/gcp-iam-restrict-user-bucket.sh
Google Cloud Platform example to add IAM role restricting user to specific storage buckets with conditions
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workload identity domain
export GCP_REGION="us-central1"
export GCP_ZONE="us-central1-a"
@pydevops
pydevops / istio-gke-tls-example.sh
Created March 20, 2021 16:49 — forked from mikesparr/istio-gke-tls-example.sh
Example GKE ingress with TLS certificate for secure traffic to backend Istio ingress gateway
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workflow identity domain
export GCP_REGION="us-west1"
export ISTIO_VERSION="1.9.1"
@pydevops
pydevops / cloudbuild-pr.yaml
Created March 20, 2021 16:45 — forked from mikesparr/cloudbuild-pr.yaml
Google Cloud Build PR deploy
steps:
# Build image and push to GCR
- name: 'gcr.io/cloud-builders/docker'
id: Build
args:
- 'build'
- '-t'
- 'gcr.io/$PROJECT_ID/$_SERVICE_NAME:v$_PR_NUMBER'
- '.'
# TODO: look into [images]
@pydevops
pydevops / GitHub-Forking.md
Created February 11, 2019 22:09 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@pydevops
pydevops / VirtualBox Cheat Sheet
Created January 27, 2019 23:59 — forked from githubfoam/VirtualBox Cheat Sheet
VirtualBox Cheat Sheet
"VBoxManage" command is different from "sudo VBoxManage" command
VBoxManage --version
sudo apt-get dist-upgrade -y -> Debian-based linux makes sure VirtualBox Guest Additions is installed
VBoxManage list runningvms -> Find running vm to box
vagrant package --base xxxxx_1522057296984_52705 --output ubuntu1604.box --> Package running vm as vagrant box
# Download an ISO image of VirtualBox Guest Additions
@pydevops
pydevops / k8s-crd.md
Last active September 1, 2023 00:41 — forked from smileisak/operators.md
k8s crd operator

Some useful resources regarding Kubernetes Operators, CRDs, etc.