Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Joaquin Menchaca darkn3rd

🏠
Working from home
View GitHub Profile
@darkn3rd
darkn3rd / cleanup_cloud_resources.sh
Created Sep 19, 2022
GKE NSM2: Delete Google Cloud Resources
View cleanup_cloud_resources.sh
gcloud container clusters delete $GKE_CLUSTER_NAME \
--project $GKE_PROJECT_ID \
--region $GKE_REGION
gcloud iam service-accounts delete $GKE_SA_EMAIL --project $GKE_PROJECT_ID
gcloud iam service-accounts delete $DNS_SA_EMAIL --project $DNS_PROJECT_ID
@darkn3rd
darkn3rd / cleanup_k8s_resources.sh
Created Sep 19, 2022
GKE NSM2: Delete Kubernetes Resources
View cleanup_k8s_resources.sh
# Ratel Resources
kubectl delete deploy/dgraph-ratel --namespace "ratel"
kubectl delete svc/dgraph-ratel --namespace "ratel"
# VirtualServers
helm delete dgraph-virtualservers --namespace "dgraph"
helm delete ratel-virtualserver --namespace "ratel"
# Kubernetes Addons
helm delete "external-dns" --namespace "kube-addons"
@darkn3rd
darkn3rd / vs.yaml
Created Sep 18, 2022
GKE NSM2: Dgraph VirtualServer and Policy
View vs.yaml
repositories:
# https://artifacthub.io/packages/helm/itscontained/raw
- name: itscontained
url: https://charts.itscontained.io
releases:
- name: dgraph-virtualservers
chart: itscontained/raw
namespace: dgraph
version: 0.2.5
@darkn3rd
darkn3rd / vs.yaml
Created Sep 18, 2022
GKE NSM2: ratel virtualserver
View vs.yaml
repositories:
# https://artifacthub.io/packages/helm/itscontained/raw
- name: itscontained
url: https://charts.itscontained.io
releases:
- name: ratel-virtualserver
chart: itscontained/raw
namespace: ratel
version: 0.2.5
@darkn3rd
darkn3rd / helmfile.yaml
Created Sep 18, 2022
GKE NSM2: Ratel helmfile
View helmfile.yaml
repositories:
# https://artifacthub.io/packages/helm/itscontained/raw
- name: itscontained
url: https://charts.itscontained.io
releases:
- name: ratel
chart: itscontained/raw
namespace: ratel
version: 0.2.5
@darkn3rd
darkn3rd / helmfile.yaml
Created Sep 18, 2022
GKE NSM2: external-dns helmfile
View helmfile.yaml
repositories:
# https://artifacthub.io/packages/helm/bitnami/external-dns
- name: bitnami
url: https://charts.bitnami.com/bitnami
releases:
- name: external-dns
namespace: kube-addons
chart: bitnami/external-dns
version: 6.8.1
@darkn3rd
darkn3rd / helmfile.yaml
Created Sep 18, 2022
GKE NSM2: nginx-ic helmfile
View helmfile.yaml
repositories:
# https://artifacthub.io/packages/helm/nginx/nginx-ingress
- name: nginx-stable
url: https://helm.nginx.com/stable
releases:
# NOTE: tutorial online uses 'nginx-ingress' for namespace
- name: nginx-ingress
namespace: kube-addons
chart: nginx-stable/nginx-ingress
@darkn3rd
darkn3rd / republish_nginx_image.sh
Created Sep 18, 2022
GKE NSM2: republish_nginx_image.sh
View republish_nginx_image.sh
source env.sh
NGINX_IC_NAP_IMAGE="$PRIV_REG/nginx-ic-nap/nginx-plus-ingress"
docker pull $NGINX_IC_NAP_IMAGE:2.3.0
docker tag $NGINX_IC_NAP_IMAGE:2.3.0 \
gcr.io/$GCR_PROJECT_ID/nginx-plus-ingress:2.3.0
docker push gcr.io/$GCR_PROJECT_ID/nginx-plus-ingress:2.3.0
@darkn3rd
darkn3rd / docker_keys.sh
Last active Sep 18, 2022
GKE NSM2: docker_keys.sh
View docker_keys.sh
#!/usr/bin/env bash
PRIV_REG="private-registry.nginx.com"
if [[ "$(uname -s)" == "Linux" ]]; then
DOCKER_CERTS_PATH="/etc/docker/certs.d/$PRIV_REG"
sudo mkdir -p $DOCKER_CERTS_PATH
elif [[ "$(uname -s)" == "Darwin" ]]; then
DOCKER_CERTS_PATH="$HOME/.docker/certs.d/$PRIV_REG"
mkdir -p $DOCKER_CERTS_PATH
@darkn3rd
darkn3rd / issuers.yaml
Created Sep 18, 2022
GKE NSM2: Cert Manager Issuers
View issuers.yaml
repositories:
# https://artifacthub.io/packages/helm/itscontained/raw
- name: itscontained
url: https://charts.itscontained.io
releases:
- name: cert-manager-issuers
chart: itscontained/raw
namespace: kube-addons
version: 0.2.5