masterone: k8s manifests for Rancher migration (app+postgres, NodePort 30095)
This commit is contained in:
parent
18800c7046
commit
bfc8dd7809
3 changed files with 188 additions and 0 deletions
100
clusters/default/masterone/20-portal.yaml
Normal file
100
clusters/default/masterone/20-portal.yaml
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
# MasterOne portal app. Image is built and imported locally (masterone-portal:k8s);
|
||||
# uploads persist on hostPath PV. Secrets (API keys, DB creds, PORTAL_SECRET_KEY)
|
||||
# live in the masterone-secrets Secret — created imperatively, NEVER committed to git.
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: masterone-uploads-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes: [ReadWriteOnce]
|
||||
hostPath:
|
||||
path: /var/lib/rancher/masterone/uploads
|
||||
type: DirectoryOrCreate
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: masterone-uploads
|
||||
namespace: masterone
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
volumeName: masterone-uploads-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: portal
|
||||
namespace: masterone
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: portal
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: portal
|
||||
spec:
|
||||
containers:
|
||||
- name: portal
|
||||
image: masterone-portal:k8s
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8095
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: masterone-secrets
|
||||
env:
|
||||
- name: PORTAL_MASTERONE_ROOT
|
||||
value: /masterone
|
||||
- name: DATABASE_URL
|
||||
value: postgresql://masterone:$(POSTGRES_PASSWORD)@postgres.masterone.svc.cluster.local/masterone_portal
|
||||
- name: PORTAL_COOKIE_SECURE
|
||||
value: "1"
|
||||
volumeMounts:
|
||||
- name: uploads
|
||||
mountPath: /app/uploads
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8095
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 10
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /healthz
|
||||
port: 8095
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 30
|
||||
resources:
|
||||
requests:
|
||||
memory: 512Mi
|
||||
cpu: 100m
|
||||
limits:
|
||||
memory: 2Gi
|
||||
volumes:
|
||||
- name: uploads
|
||||
persistentVolumeClaim:
|
||||
claimName: masterone-uploads
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: portal
|
||||
namespace: masterone
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: portal
|
||||
ports:
|
||||
- port: 8095
|
||||
targetPort: 8095
|
||||
nodePort: 30095
|
||||
Loading…
Add table
Add a link
Reference in a new issue