Hello World Web Server¶
A simple "Hello World" web server using the Red Hat Hardened Nginx image.
-
Create a namespace:
-
Create a ConfigMap with the page content:
-
Create the Deployment:
apiVersion: apps/v1 kind: Deployment metadata: name: hello-world namespace: hello-world spec: replicas: 2 selector: matchLabels: app: hello-world template: metadata: labels: app: hello-world spec: containers: - name: nginx image: registry.redhat.io/hi/nginx:latest ports: - containerPort: 8080 resources: requests: memory: "32Mi" cpu: "50m" limits: memory: "64Mi" cpu: "100m" volumeMounts: - name: html mountPath: /opt/app-root/src readOnly: true volumes: - name: html configMap: name: hello-world-html -
Create a Service and Route:
-
Verify it's running:
oc get pods -n hello-world ROUTE=$(oc get route hello-world -o jsonpath='{.spec.host}') curl http://$ROUTEYou should see:
Hello World!