Skip to content

Instantly share code, notes, and snippets.

@VeryFatBoy
Forked from robrich/deployment.yaml
Created October 12, 2021 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VeryFatBoy/0bf9ed2cbd04b63a8eedf035af9c6d11 to your computer and use it in GitHub Desktop.
Save VeryFatBoy/0bf9ed2cbd04b63a8eedf035af9c6d11 to your computer and use it in GitHub Desktop.
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