Skip to content

Instantly share code, notes, and snippets.

@avielb
Created June 27, 2020 10:13
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 avielb/5a41c4c4da425e51bf94930ba3bd827b to your computer and use it in GitHub Desktop.
Save avielb/5a41c4c4da425e51bf94930ba3bd827b to your computer and use it in GitHub Desktop.
a.yaml
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
name: nginx
type: NodePort
ports:
- name: foo # Actually, no port is needed.
port: 80
targetPort: 80
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest # or just image:
ports:
- containerPort: 80
volumeMounts:
- name: config-volume
mountPath: /usr/share/nginx/html
volumes:
- name: config-volume
configMap:
name: myhtml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment