Skip to content

Instantly share code, notes, and snippets.

@kudaliar032
Created October 13, 2021 09:07
Show Gist options
  • Save kudaliar032/61e1920dae9e2e69a77c07714588f01c to your computer and use it in GitHub Desktop.
Save kudaliar032/61e1920dae9e2e69a77c07714588f01c to your computer and use it in GitHub Desktop.
Longhorn web server demo
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
labels:
app: nginx
spec:
replicas: 5
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
resources:
limits:
memory: "512Mi"
cpu: "0.25"
ports:
- containerPort: 80
name: http-server
volumeMounts:
- mountPath: /usr/share/nginx/html
name: nginx-data
volumes:
- name: nginx-data
persistentVolumeClaim:
claimName: nginx-pvc
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
labels:
app: nginx
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
name: http-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment