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 Kubernetes resource definitions. #30

Merged
merged 1 commit into from
Aug 13, 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
150 changes: 150 additions & 0 deletions mpaviewer-deployment-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-mpaviewer-data-prod
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: azurefile-csi-retain-zrs
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mpaviewer-prod
spec:
selector:
matchLabels:
app: mpaviewer
replicas: 1
template:
metadata:
labels:
app: mpaviewer
spec:
containers:
- name: mpaviewer-prod
image: ghcr.io/dbca-wa/mpaviewer:v0.1.0
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: Australia/Perth
command:
- R
- '-e'
- options('shiny.port'=8080,shiny.host='0.0.0.0');mpaviewer::run_app()
resources:
requests:
memory: "128Mi"
cpu: "5m"
limits:
memory: "1Gi"
cpu: "500m"
securityContext:
runAsNonRoot: true
runAsUser: 1000
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /app/inst/data
name: mpaviewer-data
- mountPath: /tmp
name: tmpfs-ram
volumes:
- name: mpaviewer-data
persistentVolumeClaim:
claimName: pvc-mpaviewer-data-prod
- name: tmpfs-ram
emptyDir:
medium: "Memory"
---
apiVersion: v1
kind: Service
metadata:
name: mpaviewer-clusterip-prod
spec:
type: ClusterIP
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: mpaviewer
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mpaviewer-ingress-prod
spec:
rules:
- host: mpaviewer.dbca.wa.gov.au
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mpaviewer-clusterip-prod
port:
number: 8080
- host: marinedashboard.dbca.wa.gov.au
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mpaviewer-clusterip-prod
port:
number: 8080
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: mpaviewer-cronjob-prod
spec:
schedule: 1 * * * * # 1 minute past the hour
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- image: ghcr.io/dbca-wa/mpaviewer:v0.1.0
imagePullPolicy: IfNotPresent
name: mpa-cronjob
env:
- name: TZ
value: Australia/Perth
resources:
limits:
cpu: "500m"
memory: "1Gi"
command:
- /usr/local/bin/Rscript
- /app/inst/cron/job.R
securityContext:
runAsNonRoot: true
runAsUser: 1000
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- mountPath: /app/inst/data
name: mpaviewer-data
volumes:
- name: mpaviewer-data
persistentVolumeClaim:
claimName: pvc-mpaviewer-data-prod
restartPolicy: Never
150 changes: 150 additions & 0 deletions mpaviewer-deployment-uat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-mpaviewer-data-uat
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: azurefile-csi-retain
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mpaviewer-uat
spec:
selector:
matchLabels:
app: mpaviewer
replicas: 1
template:
metadata:
labels:
app: mpaviewer
spec:
containers:
- name: mpaviewer-uat
image: ghcr.io/dbca-wa/mpaviewer:v0.1.0
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: Australia/Perth
command:
- R
- '-e'
- options('shiny.port'=8080,shiny.host='0.0.0.0');mpaviewer::run_app()
resources:
requests:
memory: "128Mi"
cpu: "5m"
limits:
memory: "1Gi"
cpu: "500m"
securityContext:
runAsNonRoot: true
runAsUser: 1000
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /app/inst/data
name: mpaviewer-data
- mountPath: /tmp
name: tmpfs-ram
volumes:
- name: mpaviewer-data
persistentVolumeClaim:
claimName: pvc-mpaviewer-data-uat
- name: tmpfs-ram
emptyDir:
medium: "Memory"
---
apiVersion: v1
kind: Service
metadata:
name: mpaviewer-clusterip-uat
spec:
type: ClusterIP
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: mpaviewer
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mpaviewer-ingress-uat
spec:
rules:
- host: mpaviewer-uat.dbca.wa.gov.au
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mpaviewer-clusterip-uat
port:
number: 8080
- host: marinedashboard-uat.dbca.wa.gov.au
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mpaviewer-clusterip-uat
port:
number: 8080
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: mpaviewer-cronjob-uat
spec:
schedule: 1 * * * * # 1 minute past the hour
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- image: ghcr.io/dbca-wa/mpaviewer:v0.1.0
imagePullPolicy: IfNotPresent
name: mpa-cronjob
env:
- name: TZ
value: Australia/Perth
resources:
limits:
cpu: "500m"
memory: "1Gi"
command:
- /usr/local/bin/Rscript
- /app/inst/cron/job.R
securityContext:
runAsNonRoot: true
runAsUser: 1000
privileged: false
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- mountPath: /app/inst/data
name: mpaviewer-data
volumes:
- name: mpaviewer-data
persistentVolumeClaim:
claimName: pvc-mpaviewer-data-uat
restartPolicy: Never
Loading