Skip to content

Instantly share code, notes, and snippets.

@markround
Created March 18, 2022 13:11
Show Gist options
  • Save markround/d31446d5f6a3e82059bfd6ee301c5b0e to your computer and use it in GitHub Desktop.
Save markround/d31446d5f6a3e82059bfd6ee301c5b0e to your computer and use it in GitHub Desktop.
nodeport
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
namespace: default
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
namespace: default
labels:
name: nginx
spec:
type: NodePort
ports:
- port: 80
name: http
protocol: TCP
selector:
app: nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment