Skip to content

Instantly share code, notes, and snippets.

@dmc5179
Created May 9, 2024 18:08
Show Gist options
  • Save dmc5179/a6bd2d973c3c5298cad0db0a906c1528 to your computer and use it in GitHub Desktop.
Save dmc5179/a6bd2d973c3c5298cad0db0a906c1528 to your computer and use it in GitHub Desktop.
httpd pod test
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: httpd-pv-claim
labels:
app: httpd-frontend
spec:
accessModes:
- ReadWriteMany
storageClassName: efs-sc
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: httpd-frontend
labels:
app: httpd-frontend
spec:
replicas: 1
selector:
matchLabels:
app: httpd-frontend
strategy:
type: RollingUpdate
rollingParams:
updatePeriodSeconds: 1
intervalSeconds: 1
timeoutSeconds: 120
maxSurge: "20%"
maxUnavailable: "10%"
pre: {}
post: {}
template:
metadata:
labels:
app: httpd-frontend
spec:
containers:
- image: registry.access.redhat.com/ubi8/httpd-24
imagePullPolicy: Always
name: httpd-rhel8
ports:
- containerPort: 8080
#hostPort: 8080
name: http-port
- containerPort: 8443
#hostPort: 8443
name: https-port
volumeMounts:
- name: httpd-persistent-storage
mountPath: /home/httpd-server
volumes:
- name: httpd-persistent-storage
persistentVolumeClaim:
claimName: httpd-pv-claim
---
apiVersion: v1
kind: Service
metadata:
name: http-port
labels:
app: httpd-frontend
spec:
ports:
- port: 8080
name: http-port
protocol: TCP
targetPort: 8080
selector:
app: httpd-frontend
---
apiVersion: v1
kind: Service
metadata:
name: https-port
labels:
app: httpd-frontend
spec:
ports:
- port: 8443
name: https-port
protocol: TCP
targetPort: 8443
selector:
app: httpd-frontend
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: httpd-frontend
managedFields:
name: http-port
spec:
port:
targetPort: http-port
to:
kind: Service
name: http-port
weight: 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment