Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
Forked from robrich/deployment.yaml
Created October 12, 2021 16:35
Embed
What would you like to do?
Kubernetes first elements
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
app: myapp
spec:
replicas: 3
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: nginx
image: nginx:1.17.8
ports:
- containerPort: 80
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: myapp
annotations:
# cloud-specific annotations may be necessary
spec:
rules:
- host: my.example.com
http:
paths:
- path: /
backend:
serviceName: myapp
servicePort: 80
apiVersion: v1
kind: Pod
metadata:
name: myapp
labels:
app: myapp
spec:
containers:
- name: nginx
image: nginx:1.17.8
ports:
- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: myapp
labels:
app: myapp
spec:
selector:
app: myapp
type: NodePort
ports:
- port: 80
targetPort: 80
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment