Skip to content

Instantly share code, notes, and snippets.

@melvinlee
Created April 2, 2025 13:19
Show Gist options
  • Select an option

  • Save melvinlee/b7e6bab21462376f921cf4b11c3bda8e to your computer and use it in GitHub Desktop.

Select an option

Save melvinlee/b7e6bab21462376f921cf4b11c3bda8e to your computer and use it in GitHub Desktop.
Oracle Statefulset Manifest
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: oracle-db
namespace: default
labels:
app: oracle-db
spec:
serviceName: oracle-svc
replicas: 1
selector:
matchLabels:
app: oracle-db
template:
metadata:
labels:
app: oracle-db
spec:
securityContext:
runAsUser: 54321
runAsGroup: 54321
fsGroup: 54321
containers:
- name: oracle
image: gvenzl/oracle-free:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 1521
name: oracle
- containerPort: 5500
name: em
env:
- name: ORACLE_PWD
valueFrom:
secretKeyRef:
name: oracle-secret
key: password
- name: ORACLE_SID
value: "FREE"
- name: ORACLE_PDB
value: "FREEPDB1"
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "4Gi"
cpu: "2"
volumeMounts:
- name: oracle-data
mountPath: /opt/oracle/oradata
- name: healthcheck-script
mountPath: /healthcheck
livenessProbe:
exec:
command:
- /bin/bash
- /healthcheck/healthcheck.sh
initialDelaySeconds: 300
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
exec:
command:
- /bin/bash
- /healthcheck/healthcheck.sh
initialDelaySeconds: 300
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
volumes:
- name: healthcheck-script
configMap:
name: oracle-healthcheck
defaultMode: 0755 # Make script executable
volumeClaimTemplates:
- metadata:
name: oracle-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
storageClassName: standard
---
apiVersion: v1
kind: Service
metadata:
name: oracle-svc
labels:
app: oracle-db
spec:
clusterIP: None
ports:
- port: 1521
name: oracle
targetPort: 1521
selector:
app: oracle-db
---
apiVersion: v1
kind: Secret
metadata:
name: oracle-secret
type: Opaque
stringData:
password: "YourSecurePassword123"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment