Skip to content

Instantly share code, notes, and snippets.

View mountcm.yaml
apiVersion: v1
kind: Pod
metadata:
name: configmap-demo-pod
spec:
containers:
- name: demo
image: alpine
command: ["sleep", "3600"]
volumeMounts:
View cmload.yaml
apiVersion: v1
kind: Pod
metadata:
name: configmap-example-pod
spec:
containers:
- name: example-container
image: alpine
command: ["sleep", "3600"]
env:
View cmcreate.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: example-config
data:
   # property-like keys; each key maps to a simple value
"license": "XXXX"
  "licensedto": "dummy"
  # file-like keys
View liveness-tcp.yaml
apiVersion: v1
kind: Pod
metadata:
name: goproxy
labels:
app: goproxy
spec:
containers:
- name: goproxy
image: k8s.gcr.io/goproxy:0.1
View liveness-http.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: live-http
spec:
containers:
- name: liveness
image: k8s.gcr.io/liveness
View liveness-exec.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: live-exec
spec:
containers:
- name: liveness
image: k8s.gcr.io/busybox
View goflags_output.sh
BoolFlag is not passed !!!
Boolean Flag is false
String Flag is Hello There!
Int Flag is 4
View goflags_visited_full.go
package main
import (
"flag"
"fmt"
"os"
)
// Define the flag
var help = flag.Bool("help", false, "Show help")
View goflags_visit.go
func isFlagPassed(name string) bool {
found := false
flag.Visit(func(f *flag.Flag) {
if f.Name == name {
found = true
}
})
return found
}
View BuilderPattern3.java
package builder;
public class Main {
public static void main(String[] args) {
User user1 = new User.UserBuilder("Anjana", "Shankar")
.build();
System.out.println(user1);
User user2 = new User.UserBuilder("Random", "User1")