Browse your Git repositories
---
# PersistentVolumeClaim for notes data
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: notes-app-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
# Deployment for Notes App
apiVersion: apps/v1
kind: Deployment
metadata:
name: notes-app
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: notes-app
template:
metadata:
labels:
app: notes-app
spec:
imagePullSecrets:
- name: harbor-registry-secret
containers:
- name: notes-app
image: harbor.kratov.luiv.dev/luna_priv/notes:latest
ports:
- containerPort: 5000
env:
- name: NOTES_FILE
value: /data/notes.json
volumeMounts:
- name: notes-data
mountPath: /data
livenessProbe:
httpGet:
path: /health
port: 5000
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /health
port: 5000
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: notes-data
persistentVolumeClaim:
claimName: notes-app-pvc
---
# Service for Notes App
apiVersion: v1
kind: Service
metadata:
name: notes-app
namespace: default
spec:
selector:
app: notes-app
ports:
- port: 80
targetPort: 5000
---
# Ingress with automatic HTTPS via Let's Encrypt
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: notes-app-tls
namespace: default
annotations:
cert-manager.io/cluster-issuer: letsencrypt-http01
traefik.ingress.kubernetes.io/router.tls: "true"
traefik.ingress.kubernetes.io/redirect-to-https: "true"
spec:
ingressClassName: traefik
tls:
- hosts:
- notes.codeuwu.com
secretName: notes-actalis-cert
rules:
- host: notes.codeuwu.com # Change to your domain
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: notes-app
port:
number: 80