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
@superbrothers
superbrothers / kubectl-delete_all
Last active October 1, 2024 05:27
Kubernetes: Delete all objects in the namespace
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
diff --git a/pkg/minikube/bootstrapper/kubeadm/templates.go b/pkg/minikube/bootstrapper/kubeadm/templates.go
index cbb3f2bce..b60dce984 100644
--- a/pkg/minikube/bootstrapper/kubeadm/templates.go
+++ b/pkg/minikube/bootstrapper/kubeadm/templates.go
@@ -24,7 +24,7 @@ import (
var kubeadmConfigTemplate = template.Must(template.New("kubeadmConfigTemplate").Funcs(template.FuncMap{
"printMapInOrder": printMapInOrder,
-}).Parse(`apiVersion: kubeadm.k8s.io/v1alpha1
+}).Parse(`apiVersion: kubeadm.k8s.io/v1alpha2
apiVersion: krew.googlecontainertools.github.com/v1alpha1
kind: Plugin
metadata:
name: service
spec:
platforms:
- uri: https://github.com/superbrothers/kubectl-service-plugin/releases/download/v1.1.0/service-darwin-amd64.zip
sha256: 8197bc5506c628381cf1ae73ec03cc44d0513f6ca102d8b7165ba7dff034208e
files:
- from: "*"
apiVersion: apps/v1
kind: Deployment
metadata:
name: the-deployment
spec:
template:
spec:
containers:
- name: the-container
$patch: delete
@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
diff --git a/cluster/update-storage-objects.sh b/cluster/update-storage-objects.sh
index 364c1d7e..a451a2d0 100755
--- a/cluster/update-storage-objects.sh
+++ b/cluster/update-storage-objects.sh
@@ -34,7 +34,6 @@ KUBECTL="${KUBE_OUTPUT_HOSTBIN}/kubectl"
# TODO: Get this list of resources from server once
# http://issue.k8s.io/2057 is fixed.
declare -a resources=(
- "endpoints"
"events"
@superbrothers
superbrothers / kubecon_curl.sh
Last active December 11, 2017 04:52 — forked from hobbsh/kubecon_curl.sh
Download Kubecon Austin 2017 presentations from Sched
#!/bin/bash
mkdir -p kubecon_files
DAYS=("2017-12-06" "2017-12-07" "2017-12-08")
for DAY in "${DAYS[@]}"; do
#Super shitty pipefest because of grep matched groups sadness
LINKS=($(curl https://kccncna17.sched.com/${DAY}/overview | grep -oEi "f='(.*)' cl" | cut -d\' -f 2 | tr '\n' ' '))
for LINK in "${LINKS[@]}"; do
echo "Requesting https://kccncna17.sched.com/${LINK}"
function peco-kubectl-context() {
local selected_context=$(kubectl config view -o go-template --template='{{range .contexts}}{{.name}}{{"\n"}}{{end}}' | peco --query "$LBUFFER")
if [ -n "$selected_context" ]; then
BUFFER="kubectl config use-context $selected_context"
zle accept-line
fi
zle clear-screen
}
zle -N peco-kubectl-context
{
repository(owner: "kubernetes", name: "kubernetes") {
issues(labels: ["sig/cli"], first: 20, orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
title
bodyHTML
url
author {
login
url
#!/usr/bin/env zsh
set -e
__handle_flag() {
local flagname="--namespace="
local flagval="kube-system"
flaghash[${flagname}]=${flagval}