Skip to content

Instantly share code, notes, and snippets.

@anjanashankar9
anjanashankar9 / secretenv.yaml
Created March 21, 2023 14:35
Using a secret as an environment variable
View secretenv.yaml
apiVersion: v1
kind: Pod
metadata:
name: example-secret
spec:
containers:
- name: example-container
image: nginx
env:
- name: SECRET
@anjanashankar9
anjanashankar9 / secretsmount.yaml
Created March 21, 2023 14:33
Using a secret as a file from a Pod
View secretsmount.yaml
apiVersion: v1
kind: Pod
metadata:
name: example-secret
spec:
containers:
- name: example-container
image: nginx
volumeMounts:
# name must match the volume name below
@anjanashankar9
anjanashankar9 / secretcreate.yaml
Created March 21, 2023 14:24
Manifest for creating a K8S secrets
View secretcreate.yaml
apiVersion: v1
kind: Secret
metadata:
name: mysecret
type: Opaque
data:
username: YWRtaW4=
password: MWYyZDFlMmU2N2Rm
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