Skip to content

Instantly share code, notes, and snippets.

@nccurry
Created April 13, 2021 12:37
Show Gist options
  • Save nccurry/f6cf7803298c34678180dd2a28b96b89 to your computer and use it in GitHub Desktop.
Save nccurry/f6cf7803298c34678180dd2a28b96b89 to your computer and use it in GitHub Desktop.
OpenShift Smoke Test Sample Application
apiVersion: v1
kind: List
items:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: httpd-www
namespace: openshift-smoke-test
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: httpd-log
namespace: openshift-smoke-test
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
- apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd
namespace: openshift-smoke-test
spec:
selector:
matchLabels:
app: httpd
replicas: 1
template:
metadata:
labels:
app: httpd
spec:
containers:
- name: httpd
image: registry.redhat.io/rhel8/httpd-24:latest
ports:
- name: http
containerPort: 8080
- name: https
containerPort: 8443
volumeMounts:
- name: www
mountPath: /var/www
- name: log
mountPath: /var/log/httpd
- name: webpage
mountPath: /var/www/html
readOnly: true
volumes:
- name: www
persistentVolumeClaim:
claimName: httpd-www
- name: log
persistentVolumeClaim:
claimName: httpd-log
- name: webpage
configMap:
name: httpd-webpage
items:
- key: index.html
path: index.html
- apiVersion: v1
kind: Service
metadata:
name: httpd
namespace: openshift-smoke-test
spec:
ports:
- name: https
port: 8443
protocol: TCP
targetPort: 8443
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: httpd
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: httpd
namespace: openshift-smoke-test
spec:
port:
targetPort: http
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: httpd
- apiVersion: v1
kind: ConfigMap
metadata:
name: httpd-webpage
namespace: openshift-smoke-test
data:
index.html: |
<html>
<head>
<title>OpenShift Smoke Test</title>
</head>
<body>
Nature’s first green is gold,<br>
Her hardest hue to hold.<br>
Her early leaf’s a flower;<br>
But only so an hour.<br>
Then leaf subsides to leaf.<br>
So Eden sank to grief,<br>
So dawn goes down to day.<br>
Nothing gold can stay.<br>
- Robert Frost
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment