Skip to content

Instantly share code, notes, and snippets.

@chandradeoarya
Last active September 28, 2024 11:37
Show Gist options
  • Save chandradeoarya/0172016f85113cd61b99bff3e3405615 to your computer and use it in GitHub Desktop.
Save chandradeoarya/0172016f85113cd61b99bff3e3405615 to your computer and use it in GitHub Desktop.
Kubernetes manifest file to create nginx resources like deployments and service.
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment-dojo
labels:
app: ng-dep-dojo
spec:
replicas: 1
selector:
matchLabels:
app: ng-pod
template:
metadata:
labels:
app: ng-pod
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service-dojo
spec:
type: NodePort
selector:
app: ng-pod
ports:
- protocol: TCP
port: 80
targetPort: 80
nodePort: 30001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment