Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added .k8s folder and files #52

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nyu-project
labels:
app: nyu-project
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0%
maxUnavailable: 50%
selector:
matchLabels:
app: nyu-project
template:
metadata:
labels:
app: nyu-project
spec:
imagePullSecrets:
- name: all-icr-io
restartPolicy: Always
containers:
- name: nyu-project
# image: cluster-registry:32000/customers:1.0
image: nyu-project
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
protocol: TCP
env:
- name: RETRY_COUNT
value: "10"
- name: DATABASE_URI
valueFrom:
secretKeyRef:
name: postgres-creds
key: database_uri
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 30
httpGet:
path: /health
port: 8080
resources:
limits:
cpu: "0.50"
memory: "128Mi"
requests:
cpu: "0.25"
memory: "64Mi"
18 changes: 18 additions & 0 deletions .k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: customers
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nyu-project
port:
number: 8080
12 changes: 12 additions & 0 deletions .k8s/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteMany
hostPath:
path: /data/pv0001
storageClassName: ""
14 changes: 14 additions & 0 deletions .k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: nyu-project
spec:
type: ClusterIP
selector:
app: nyu-project
internalTrafficPolicy: Local
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
Loading