Skip to content

Instantly share code, notes, and snippets.

@nikhiljha

nikhiljha/deployment.yaml Secret

Last active Dec 27, 2020
Embed
What would you like to do?
Basic Kubernetes Examples (YAML Edition)
# Notice how this has the same variables over
# and over again... One of the reasons why YAML is not the tool
# for the job (in hindsight).
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo
labels:
app: echo
spec:
replicas: 1
selector:
matchLabels:
app: echo
template:
metadata:
labels:
app: echo
spec:
containers:
- name: echo
image: k8s.gcr.io/echoserver:1.4
ports:
- containerPort: 8080
resources:
requests:
memory: "100Mi"
cpu: "0.5"
limits:
memory: "128Mi"
cpu: "0.65"
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: echo
spec:
rules:
- host: "echo.example.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: echo
port:
number: 8080
apiVersion: v1
kind: Service
metadata:
name: echo
spec:
selector:
app: echo
ports:
- protocol: TCP
port: 8080
targetPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment