Distributed Apps

Distributed Applications

Deploy and Advertise a container running inside a managed namespace

Configure a virtual k8s cluster, deploy and scale a containerized workload from a private registry.

A service with one or more containers with configurable number of replicas may be deployed on a selection of Regional Edge sites or customer sites and advertised within the cluster where is it deployed, on the Internet, or on other sites using TCP or HTTP or HTTPS load balancer.

https://github.com/richardjortega/ks8-blue-green

F5 Distributed Cloud documentation

Create Virtual k8s

Step 1
  1. Click Applications ‣ Virtual K8s, and then click Add Virtual K8s

    _images/distributedappclickaddvirtualk8s.png
  2. Name the Virtual K8s object, then under Virtual Sites click add-item, select shared/agility-k8s-vsite, and click Save and Exit

    _images/distributedappclickvirtualk8ssettings2.png

    Warning

    Virtual K8s “create-in-progress” may take five or more minutes to complete.

    _images/distributedappclickvirtualk8screate-in-progress.png

Deploy Workload

Step 2
  1. When Virtual K8s shows as “ready”, click the virtual site to display details.

    _images/distributedappclickvirtualk8sready.png
  2. Click Workloads in the properties tab, and then click Add VK8s Workload

    _images/apps-vk8s-add-vk8s-workload.png

Container Service

  1. Provide a Name, then under Select Type of Workload select Service, and click Configure.

    _images/vk8s-workload-create-workload-configure.png
  2. In Containers section click add-item

    _images/6add_container.png
  3. Complete the Container Configuration section by providing a Name and details for which image to use, then Add Item

    • Name: vk8s-container

    • Image Name: coleman.azurecr.io/f5xcdemoapp

    • Container Registry: Private Registry

    • Private Registry: shared/azure-registry

    _images/7container_config.png

Associate to Virtual Site

  1. Within the Deploy Options section, set Where to Deploy the workload to Customer Virtual Sites, then click Configure.

    _images/8deploy_options.png
  2. Select shared/agility-k8s-vsite under List of Virtual Sites to Deploy, then Apply

    _images/9select_customer_site.png

Service Advertisement

  1. Within the Advertise Options section, set Options to Advertise the Workload to Advertise in Cluster, then select Configure.

    _images/10select_advertise_options.png
  2. Set Select Port to Advertise to 3000, select Application Protocol to HTTP, and click Apply

    _images/11set_advertise_port.png
  3. The Deploy Options dialogue is dismissed, and click Apply to complete the Containers dialogue.

    _images/apply-vk8s-workload.png
  4. The Containers dialogue is now dismissed, to finalize the Workload, Click Save and Exit

    _images/create-workload-save-and-exit.png
  5. The workload has been added. The vsite that vk8s is deployed on consists of 3 sites, so there are 3 pods in total.

    _images/12verify_3_workload_sites_pods.png

Scale Deployment

Modify Virtual K8s Deployment to Scale Replicas.

Edit JSON

  1. Navigate the left-side menu to Applications ‣ Virtual K8s ‣ virtual-k8s, click Deployments, Actions, three-dots then click Edit.

    _images/14edit_deployment.png
  2. Enable edit-mode, and expand the spec section by clicking out-arrows

    _images/15modify_deployment_spec.png
  3. Change replicas: 1 to replicas: 3 and click Save

    _images/set-three-replicas-save.png
  4. After a few moments, the number of Running Pods will increase to 9.

    _images/16review_scaled_deployment.png

View Results with kubectl

Install kubectl

Insert instructions to install kubectl

Download kubeconfig

  1. Navigate to Applications ‣ Virtual K8s, click three-dots, and then click download-kubeconfig-button

    _images/distributedappclickvirtualk8kubeconfig.png
  2. Follow the kubernetes.io guide to install the kubeconfig

kubectl commands

Run the following commands and view the vk8s configuration.

View Nodes

$ kubectl get nodes
NAME                                                 STATUS   ROLES        AGE   VERSION
agility-vpc-site-one-agility-vpc-site-one-1w2h       Ready    ves-master   28s   v1.21.7-vesdev
agility-vpc-site-three-agility-vpc-site-three-xn79   Ready    ves-master   32s   v1.21.7-vesdev
agility-vpc-site-two-agility-vpc-site-two-j735       Ready    ves-master   33s   v1.21.7-vesdev

View pods

$ kubectl get pods
NAME                             READY   STATUS    RESTARTS   AGE
vk8s-workload-574ffc5cdd-sb5bm   2/2     Running   0          2m40s
vk8s-workload-64f8f87976-kh8zz   2/2     Running   0          2m37s
vk8s-workload-67b54bd74b-bqdx8   2/2     Running   0          2m41s
$ kubectl describe pod <podname>

View deployment

$ kubectl get deployment vk8s-workload
NAME            READY   UP-TO-DATE   AVAILABLE   AGE
vk8s-workload   3/1     3            3           4m43s

View service

$ kubectl get svc vk8s-workload
NAME            TYPE        CLUSTER-IP        EXTERNAL-IP   PORT(S)    AGE
vk8s-workload   ClusterIP   192.168.167.169   <none>        3000/TCP   8m33s

View all resources in the namespace

$ kubectl get all
NAME                                 READY   STATUS    RESTARTS   AGE
pod/vk8s-workload-574ffc5cdd-sb5bm   2/2     Running   0          9m18s
pod/vk8s-workload-64f8f87976-kh8zz   2/2     Running   0          9m15s
pod/vk8s-workload-67b54bd74b-bqdx8   2/2     Running   0          9m19s

NAME                    TYPE        CLUSTER-IP        EXTERNAL-IP   PORT(S)    AGE
service/vk8s-workload   ClusterIP   192.168.167.169   <none>        3000/TCP   9m21s

NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/vk8s-workload   3/1     3            3           9m22s

NAME                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/vk8s-workload-574ffc5cdd   1         1         1       9m22s
replicaset.apps/vk8s-workload-64f8f87976   1         1         1       9m22s
replicaset.apps/vk8s-workload-67b54bd74b   1         1         1       9m22s

View the output of the deployment in yaml format

$ kubectl get deployment -o yaml