F5 Solutions for Containers > Appendix > Appendix 5: BIG-IP / OpenShift Multi-Pod Deployment Source | Edit on
Lab 1.4 - F5 Container Connector Usage¶
Now that our container connector is up and running, let’s deploy an application to test both route domans / partitions.
For this lab we’ll use a simple pre-configured docker image called “f5-hello-world”. It can be found on docker hub at f5devcentral/f5-hello-world
To deploy “f5-hello-world” on ose-master1 and ose-master2 create the following files:
Create a file called
f5-hello-world-deployment.yaml
1apiVersion: extensions/v1beta1 2kind: Deployment 3metadata: 4 name: f5-hello-world 5spec: 6 replicas: 2 7 template: 8 metadata: 9 labels: 10 run: f5-hello-world 11 spec: 12 containers: 13 - name: f5-hello-world 14 image: "f5devcentral/f5-hello-world:develop" 15 imagePullPolicy: IfNotPresent 16 ports: 17 - containerPort: 8080 18 protocol: TCP
Create a file called
f5-hello-world-service.yaml
1apiVersion: v1 2kind: Service 3metadata: 4 name: f5-hello-world 5 labels: 6 run: f5-hello-world 7spec: 8 ports: 9 - port: 8080 10 protocol: TCP 11 targetPort: 8080 12 type: ClusterIP 13 selector: 14 run: f5-hello-world
Now we need to creat the f5 configmap of the application for each partition.
Create a file called
f5-hello-world-configmap-10.yaml
on ose-master11apiVersion: v1 2kind: ConfigMap 3metadata: 4 name: f5-hello-world 5 namespace: default 6 labels: 7 f5type: virtual-server 8data: 9 schema: "f5schemadb://bigip-virtual-server_v0.1.7.json" 10 data: | 11 { 12 "virtualServer": { 13 "frontend": { 14 "balance": "round-robin", 15 "mode": "http", 16 "partition": "okd10", 17 "virtualAddress": { 18 "bindAddr": "10.1.10.80%0", 19 "port": 80 20 } 21 }, 22 "backend": { 23 "serviceName": "f5-hello-world", 24 "servicePort": 8080, 25 "healthMonitors": [{ 26 "interval": 5, 27 "protocol": "http", 28 "send": "HEAD / HTTP/1.0\r\n\r\n", 29 "timeout": 16 30 }] 31 } 32 } 33 }
Create a file called
f5-hello-world-configmap-20.yaml
on ose-master21apiVersion: v1 2kind: ConfigMap 3metadata: 4 name: f5-hello-world 5 namespace: default 6 labels: 7 f5type: virtual-server 8data: 9 schema: "f5schemadb://bigip-virtual-server_v0.1.7.json" 10 data: | 11 { 12 "virtualServer": { 13 "frontend": { 14 "balance": "round-robin", 15 "mode": "http", 16 "partition": "okd20", 17 "virtualAddress": { 18 "bindAddr": "10.1.10.81%0", 19 "port": 80 20 } 21 }, 22 "backend": { 23 "serviceName": "f5-hello-world", 24 "servicePort": 8080, 25 "healthMonitors": [{ 26 "interval": 5, 27 "protocol": "http", 28 "send": "HEAD / HTTP/1.0\r\n\r\n", 29 "timeout": 16 30 }] 31 } 32 } 33 }
We can now launch our application:
ose-master1
oc create -f f5-hello-world-deployment.yaml oc create -f f5-hello-world-service.yaml oc create -f f5-hello-world-configmap-10.yaml
ose-master2
oc create -f f5-hello-world-deployment.yaml oc create -f f5-hello-world-service.yaml oc create -f f5-hello-world-configmap-20.yaml
To check the status of our deployment, you can run the following commands:
oc get pods -o wide oc describe svc f5-hello-world
To test the app you need to pay attention to connect to the jumphost, open browser and got http://10.1.10.80 and http://10.1.10.81