Skip to content

Commit

Permalink
Merge pull request #271 from ClubCedille/crabe-webApp
Browse files Browse the repository at this point in the history
  • Loading branch information
SonOfLope authored Dec 6, 2024
2 parents af303f7 + ada5a41 commit 71548b0
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/argo-apps/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ resources:
- ../dronolab/wikijs/
# - ../kubewall/
- ../dronolab/webApp/
- ../crabe/webApp/
# ... other apps ...

# This patch will set the destination cluster for Applications
Expand Down
22 changes: 22 additions & 0 deletions apps/crabe/webApp/argo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: webapp-crabe
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "2"
argocd-image-updater.argoproj.io/image-list: webapp=ghcr.io/crabe-etsmtl/crabe-atelier:latest
argocd-image-updater.argoproj.io/webapp.update-strategy: digest
argocd-image-updater.argoproj.io/webapp.pullsecret: argocd/ghcr-secret
spec:
project: default
destination:
server: https://kubernetes.default.svc
namespace: webapp-crabe
source:
repoURL: https://github.com/ClubCedille/Plateforme-Cedille
path: apps/crabe/webApp/prod
targetRevision: HEAD
syncPolicy:
syncOptions:
- CreateNamespace=true
42 changes: 42 additions & 0 deletions apps/crabe/webApp/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp-crabe
spec:
replicas: 1
selector:
matchLabels:
app: webapp-crabe
template:
metadata:
labels:
app: webapp-crabe
spec:
containers:
- name: webapp-crabe
envfrom:
- secretRef:
name: webapp-crabe-secrets
image: ghcr.io/crabe-etsmtl/crabe-atelier:latest
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi
ephemeral-storage: 1Gi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
8 changes: 8 additions & 0 deletions apps/crabe/webApp/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- service.yaml
- deployment.yaml
- sql/statefulset.yaml
- sql/service.yaml

11 changes: 11 additions & 0 deletions apps/crabe/webApp/base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: crabe-svc
spec:
clusterIP: None
selector:
app: webapp-crabe
ports:
- protocol: TCP
port: 80
12 changes: 12 additions & 0 deletions apps/crabe/webApp/base/sql/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql
spec:
selector:
app: mysql
ports:
- port: 3306
clusterIP: None
52 changes: 52 additions & 0 deletions apps/crabe/webApp/base/sql/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
serviceName: mysql
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
securityContext:
fsGroup: 1000
containers:
- name: mysql
envfrom:
- secretRef:
name: webapp-crabe-secrets
image: ghcr.io/crabe-etsmtl/crabe-mysql:latest
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-pv-claim
mountPath: /var/lib/mysql
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
hugepages-2Mi: 512Mi
memory: "2Gi"
securityContext:
runAsUser: 1000
runAsGroup: 1000
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
volumeClaimTemplates:
- metadata:
name: mysql-pv-claim
spec:
storageClassName: local-hostpath
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
5 changes: 5 additions & 0 deletions apps/crabe/webApp/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- argo.yaml
25 changes: 25 additions & 0 deletions apps/crabe/webApp/prod/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: crabe-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
ingress.kubernetes.io/force-ssl-redirect: "true"
kubernetes.io/tls-acme: "true"
spec:
ingressClassName: contour
tls:
- secretName: crabe-tls
hosts:
- atelier.crabe.cedille.club
rules:
- host: atelier.crabe.cedille.club
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: crabe-svc
port:
number: 80
8 changes: 8 additions & 0 deletions apps/crabe/webApp/prod/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: webapp-crabe

resources:
- ../base/
- ingress.yaml

0 comments on commit 71548b0

Please sign in to comment.