Deploy the F5 Hello World ContainerΒΆ
- All of the following commands and yaml files are contained within the "f5-kube-demo" github repo.
$ git clone https://github.com/vtog/f5-kube-demo.git
Basic f5-hello-world application deployment commands:
- Create f5 hello world kubernetes deployment
$ kubectl create -f f5-hello-world-deployment.yaml
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: f5-hello-world spec: replicas: 2 template: metadata: labels: run: f5-hello-world spec: containers: - name: f5-hello-world image: "f5devcentral/f5-hello-world" imagePullPolicy: IfNotPresent ports: - containerPort: 8080 protocol: TCP
- Create f5 hello world kubernetes configmap
$ kubectl create -f f5-hello-world-configmap.yaml
apiVersion: v1 kind: ConfigMap metadata: name: f5-hello-world namespace: default labels: f5type: virtual-server data: schema: "f5schemadb://bigip-virtual-server_v0.1.7.json" data: | { "virtualServer": { "frontend": { "balance": "round-robin", "mode": "http", "partition": "kubernetes", "virtualAddress": { "bindAddr": "10.1.10.81", "port": 80 } }, "backend": { "serviceName": "f5-hello-world", "servicePort": 8080, "healthMonitors": [{ "interval": 5, "protocol": "http", "send": "HEAD / HTTP/1.0\r\n\r\n", "timeout": 16 }] } } }
- Create f5 hello world kubernetes service
"type" needs to be set based on the mode configured for the f5 / kubernetes container connector. Edit the yaml file and change type to "NodePort" or "ClusterIP". The example below shows "NodePort"
$ kubectl create -f f5-hello-world-service.yaml
apiVersion: v1 kind: Service metadata: name: f5-hello-world labels: run: f5-hello-world spec: ports: - port: 8080 protocol: TCP targetPort: 8080 type: NodePort selector: run: f5-hello-world
- Verify f5-hello-world container is up and running
$ kubectl get pods -o wide goto http://10.1.10.81
- Add or remove resources to the application. Edit the yaml file and change the desired number of replicas
$ vim f5-hello-world-configmap-modify.yaml $ kubectl apply -f f5-hello-world-configmap-modify.yaml