Created
February 25, 2024 01:50
-
-
Save Segmentational/d3a43026a28a6fcf3a89bbc4305ff5c5 to your computer and use it in GitHub Desktop.
Kubernetes Deployment Downward API Environment Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: api-deployment | |
labels: | |
name: api-deployment | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
name: api-deployment | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxSurge: 50% | |
maxUnavailable: 0 | |
template: | |
metadata: | |
labels: | |
name: api-deployment | |
spec: | |
serviceAccountName: api-service-account | |
containers: | |
- name: api-container | |
image: account-id.dkr.ecr.us-east-2.amazonaws.com/api | |
imagePullPolicy: Always | |
ports: | |
- name: http | |
containerPort: 8080 | |
env: | |
- name: LOCAL_POD_SERVICE_ACCOUNT | |
valueFrom: | |
fieldRef: | |
fieldPath: spec.serviceAccountName | |
- name: LOCAL_POD_IP | |
valueFrom: | |
fieldRef: | |
fieldPath: status.podIP | |
- name: LOCAL_NODE_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: spec.nodeName | |
- name: LOCAL_POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: LOCAL_POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
- name: LOCAL_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
readinessProbe: | |
initialDelaySeconds: 10 | |
periodSeconds: 15 | |
httpGet: | |
port: 8080 | |
livenessProbe: | |
initialDelaySeconds: 10 | |
periodSeconds: 15 | |
httpGet: | |
port: 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment