Skip to content

Instantly share code, notes, and snippets.

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

Carlos Santana csantanapr

🏠
Working from home
View GitHub Profile
@csantanapr
csantanapr / deploy-svc-ingress-trivia.md
Created October 13, 2021 14:02
deploy-svc-ingress-trivia

Trivia on ingress

Refs: https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/

You are tasked to deploy an application to http://hello-world.info the software is package at gcr.io/google-samples/hello-app:1.0 the app team said the software listens on port 8080. web app responds to prefix path http://hello-world.info/* Deploy only using the 3 commands, complete the commands.

  1. kubectl create deployment --port **** ...
  2. kubectl expose ...
@csantanapr
csantanapr / git-stats-dux.sh
Last active December 7, 2022 20:08
Knative DUX WG git stats
#!/usr/bin/env sh
rm -rf docs
git clone https://github.com/knative/docs.git
pushd docs > /dev/null
git log --branches --pretty=format:"%ad,%an" --date=short > ../docs.raw.txt
popd > /dev/null
cat docs.raw.txt | awk -F',' '$0 >= "2022-03-14"' > 3months.raw.txt
cat 3months.raw.txt | cut -f2 -d, | sort | uniq -c | sort -k1 -n -r

Keybase proof

I hereby claim:

  • I am csantanapr on github.
  • I am csantanapr (https://keybase.io/csantanapr) on keybase.
  • I have a public key ASChdhd0fbEn_Ni_p2sRsLzllk_6HJ4BhIaf_AAVX6a8BQo

To claim this, I am signing this object:

apiVersion: v1
kind: Namespace
metadata:
name: msc-dev
---
apiVersion: maistra.io/v1
kind: ServiceMeshMember
metadata:
name: default
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1606081399" LAST_MODIFIED="1606237173" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks Bar</H3>
<DL><p>
@csantanapr
csantanapr / bash_strict_mode.md
Created November 17, 2020 18:26 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u
@csantanapr
csantanapr / bash_strict_mode.md
Created November 17, 2020 18:26 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u
apiVersion: v1
kind: ServiceAccount
metadata:
name: ibm-toolkit
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ibm-toolkit
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
kubectl patch deployment metrics-server -n kube-system -p '{"spec":{"template":{"spec":{"containers":[{"name":"metrics-server","args":["--cert-dir=/tmp", "--secure-port=4443", "--kubelet-insecure-tls","--kubelet-preferred-address-types=InternalIP"]}]}}}}'