Pod life

The environment
Variables
- Neighbouring services
OPENLDAP_PORT_389_TCP_ADDR=10.102.226.153
OPENLDAP_PORT_389_TCP_PORT=389
OPENLDAP_PORT_389_TCP_PROTO=tcp
OPENLDAP_SERVICE_HOST=10.102.226.153
OPENLDAP_SERVICE_PORT=389
OPENLDAP_PORT_389_TCP=tcp://10.102.226.153:389
OPENLDAP_PORT=tcp://10.102.226.153:389
The environment
Variables
containers:
- name: mycontainer
image: alpine:3.7
<...>
env:
- name: MY_ENVIRONMENT_VARIABLE
value: "value"
- name: AND_ANOTHER
value: "yup"
The environment
Variables
- Variables in PodSpec from shared ConfigMap
containers:
- name: mycontainer
image: alpine:3.7
<...>
env:
- name: LOG_LEVEL
valueFrom:
configMapKeyRef:
name: ddyparams
key: loglevel
The environment
Variables
- Variables in PodSpec from Secret
containers:
- name: mycontainer
image: alpine:3.7
<...>
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: myapp
key: databaseurl
The environment
Variables
- Variables in PodSpec from Downward API
containers:
- name: mycontainer
image: alpine:3.7
<...>
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
The environment
Variables
- Load all key/value pairs from ConfigMap or Secret using envFrom
containers:
- name: mycontainer
image: alpine:3.7
envFrom:
- secretRef:
name: app-secrets
- configMapRef:
name: app-configs
The environment
Volumes
- emptyDir
- hostPath
- secret
- GCEPersistentDisk
- AWSElasticBlockStore
- NFS
- iSCSI
- RBD
- CephFS
- Cinder
- VsphereVolume
The environment
Kubernetes default serviceaccount
~ # ls -al /var/run/secrets/kubernetes.io/serviceaccount
total 0
drwxrwxrwt 3 root root 140 Sep 24 14:26 .
drwxr-xr-x 3 root root 27 Sep 24 14:26 ..
drwxr-xr-x 2 root root 100 Sep 24 14:26 ..9989_24_09_14_26_34.196016358
lrwxrwxrwx 1 root root 31 Sep 24 14:26 ..data -> ..9989_24_09_14_26_34.196016358
lrwxrwxrwx 1 root root 13 Sep 24 14:26 ca.crt -> ..data/ca.crt
lrwxrwxrwx 1 root root 16 Sep 24 14:26 namespace -> ..data/namespace
lrwxrwxrwx 1 root root 12 Sep 24 14:26 token -> ..data/token
Health checks
livenessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 120
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
Readiness checks
readinessProbe:
httpGet:
path: /ready
port: 80
initialDelaySeconds: 120
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
Classed society
- SecurityContext
- SElinux
- Capabilities
NET_ADMIN
SETPCAP
SYS_RAWIO
NET_BIND_SERVICE
- RBAC
- NetworkPolicy (distributed firewall)