Skip to content

Instantly share code, notes, and snippets.

@curipha
Created March 19, 2024 06:25
Show Gist options
  • Save curipha/f1d6cc5925902452de82bcc8b4e4cf21 to your computer and use it in GitHub Desktop.
Save curipha/f1d6cc5925902452de82bcc8b4e4cf21 to your computer and use it in GitHub Desktop.
k8s - check behavior of configMap
TEST=123
FOO=bar
hoge=FUGA
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- statefulset.yaml
configMapGenerator:
- name: config-env
envs:
- config.properties
- name: my-test-env
literals:
- BAZ=baz
- qux=QUX
apiVersion: v1
kind: Service
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
clusterIP: None
selector:
app: ubuntu
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: ubuntu
spec:
selector:
matchLabels:
app: ubuntu
serviceName: ubuntu
replicas: 1
template:
metadata:
labels:
app: ubuntu
spec:
containers:
- name: ubuntu
image: ubuntu:latest
command:
- sleep
- infinity
env:
- name: FOO
value: overwriteme
envFrom:
- configMapRef:
name: config-env
- configMapRef:
name: my-test-env
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
capabilities:
drop: ["ALL"]
seccompProfile:
type: "RuntimeDefault"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment