Skip to content

Instantly share code, notes, and snippets.

@martinezhenry
Last active April 23, 2023 21:31
Show Gist options
  • Save martinezhenry/a6ac2f80a4ad9f3137f479d98be4bb45 to your computer and use it in GitHub Desktop.
Save martinezhenry/a6ac2f80a4ad9f3137f479d98be4bb45 to your computer and use it in GitHub Desktop.
K8s resources example
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-deployment
labels:
app: hello-world
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-world
image: hello-world
imagePullPolicy: IfNotPresent
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
ports:
- containerPort: 80
env:
- name: "ENV_SCOPE"
value: "lab"
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: hello-world-deployment
ports:
- protocol: TCP
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment