Skip to content

Instantly share code, notes, and snippets.

@GeoffMahugu
Created August 14, 2024 23:56
Show Gist options
  • Save GeoffMahugu/63b356745a230e046d5106c97364cda3 to your computer and use it in GitHub Desktop.
Save GeoffMahugu/63b356745a230e046d5106c97364cda3 to your computer and use it in GitHub Desktop.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nextjs-web-app
spec:
replicas: 2
selector:
matchLabels:
app: nextjs-web-app
template:
metadata:
labels:
app: nextjs-web-app
spec:
containers:
- name: nextjs-web-app
image: nextjs-web-app:latest # Replace with your actual image
ports:
- containerPort: 3000
resources:
limits:
cpu: "500m"
memory: "512Mi"
requests:
cpu: "250m"
memory: "256Mi"
---
apiVersion: v1
kind: Service
metadata:
name: nextjs-web-app-service
spec:
selector:
app: nextjs-web-app
ports:
- protocol: TCP
port: 80
targetPort: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nextjs-web-app-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nextjs-web-app-service
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment