Skip to content

Commit

Permalink
Merge pull request #164 from shurco/163-feature-k8s-example-manifest
Browse files Browse the repository at this point in the history
🐎 ci: kubernetes manifest example
  • Loading branch information
shurco authored Oct 12, 2024
2 parents d9cda83 + 80bfdc2 commit 1687deb
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ docker run \
ghcr.io/shurco/litecart:latest
```

#### <img width="20" src="/.github/media/platforms/k8s.svg">&nbsp;Run using Kubernetes
An example manifest for running on Kubernetes can be found in the `/k8s/` folder (thanks <a href="https://github.com/vuisme" target="_blank">@vuisme</a>)


## ⬇️&nbsp;&nbsp;Updating
> [!WARNING]
> Before any update, be sure to make a backup of the *./lc_base* folder and the *./site* folder.
Expand Down
95 changes: 95 additions & 0 deletions k8s/litecart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: litecart-pvc
namespace: shop
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
storageClassName: longhorn-sg

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: litecart
namespace: shop
spec:
replicas: 1
selector:
matchLabels:
app: litecart
template:
metadata:
labels:
app: litecart
spec:
nodeSelector:
type: sg
containers:
- name: litecart
image: shurco/litecart:latest
ports:
- containerPort: 8080
volumeMounts:
- name: litecart-storage
mountPath: /lc_base
subPath: lc_base
- name: litecart-storage
mountPath: /lc_digitals
subPath: lc_digitals
- name: litecart-storage
mountPath: /lc_uploads
subPath: lc_uploads
- name: litecart-storage
mountPath: /site
subPath: site
volumes:
- name: litecart-storage
persistentVolumeClaim:
claimName: litecart-pvc

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: litecart-ingress
namespace: shop
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- domain
secretName: litecart-tls
rules:
- host: domain
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: litecart-service
port:
number: 8080

---
apiVersion: v1
kind: Service
metadata:
name: litecart-service
namespace: shop
spec:
selector:
app: litecart
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: NodePort

0 comments on commit 1687deb

Please sign in to comment.