Skip to content

Commit

Permalink
🧑‍⚕️Add wordpress for BMES.
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamG committed Oct 17, 2024
1 parent c2b5073 commit abeb876
Show file tree
Hide file tree
Showing 4 changed files with 198 additions and 1 deletion.
12 changes: 12 additions & 0 deletions kubernetes/argocd/stacks/bmes-wordpress/certs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: bmes-tls
spec:
dnsNames:
- convergehealth.cc
secretName: bmes-tls
issuerRef:
kind: ClusterIssuer
name: letsencrypt
140 changes: 140 additions & 0 deletions kubernetes/argocd/stacks/bmes-wordpress/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wordpress-pvc
namespace: bmes-wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: nfs-csi
resources:
requests:
storage: 20Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-pvc
namespace: bmes-wordpress
spec:
accessModes:
- ReadWriteOnce
storageClassName: nfs-csi
resources:
requests:
storage: 2Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: bmes-website
namespace: bmes-wordpress
spec:
strategy:
type: Recreate # hell on earth.
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: bmes-website
template:
metadata:
annotations:
labels:
app.kubernetes.io/name: bmes-website
spec:
volumes:
- name: wp-data
persistentVolumeClaim:
claimName: wordpress-pvc
- name: wp-db
persistentVolumeClaim:
claimName: database-pvc
containers:
- name: wordpress-db
image: mysql:9.1
volumeMounts:
- name: wp-db
mountPath: /var/lib/mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "notASecret"
- name: MYSQL_DATABASE
value: "wordpress"
- name: wordpress
image: wordpress:6.6-apache
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
protocol: TCP
volumeMounts:
- name: wp-data
mountPath: /var/www/html
env:
- name: WORDPRESS_DB_HOST
value: "localhost"
- name: WORDPRESS_DB_USER
value: "root"
- name: WORDPRESS_DB_PASSWORD
value: "notASecret"
- name: WORDPRESS_DB_NAME
value: "wordpress"
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
limits:
cpu: '1000m'
memory: 1024Mi
requests:
cpu: '100m'
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
namespace: bmes-wordpress
name: wordpress
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: bmes-website
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: bmes
namespace: bmes-wordpress
annotations:
external-dns.alpha.kubernetes.io/target: app.acmuic.org
spec:
entryPoints:
- websecure
- web
routes:
- kind: Rule
match: "Host(`convergehealth.cc`) || Host(`www.convergehealth.cc`)"
services:
- kind: Service
name: bmes # Perhaps move to new file.
namespace: bmes-wordpress
passHostHeader: true
port: http
responseForwarding:
flushInterval: 1ms
scheme: http
strategy: RoundRobin
weight: 10
tls:
secretName: bmes-tls
26 changes: 26 additions & 0 deletions kubernetes/argocd/stacks/common/bmes-wordpress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: bmes-wordpress
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: bmes-wordpress
server: 'https://kubernetes.default.svc'
sources:
- path: kubernetes/argocd/stacks/bmes-wordpress
repoURL: '[email protected]:acm-uic/IaC.git'
targetRevision: HEAD
directory:
recurse: true
include: '*.yml'
exclude: values.yml
project: bmes
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
21 changes: 20 additions & 1 deletion kubernetes/argocd/stacks/common/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,23 @@ spec:
# A role which provides read-only access to all applications in the project
- name: read-only
description: Read-only privileges to sparkhacks

---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: bmes
namespace: argocd
spec:
clusterResourceWhitelist:
- group: '*'
kind: '*'
destinations:
- namespace: 'bmes-wordpress'
server: '*'
sourceRepos:
- '[email protected]:acm-uic/IaC.git'
- 'https://acm.cs.uic.edu/helm'
roles:
# A role which provides read-only access to all applications in the project
- name: read-only
description: Read-only privileges to sparkhacks

0 comments on commit abeb876

Please sign in to comment.