F5 Container Integrations v1.2

Current Page

Application Services Proxy

Cloud Foundry

Kubernetes

Mesos Marathon

OpenShift

Support

Troubleshooting

Tutorials

Cloud Docs Home > F5 Container Integrations Index

Install the ASP in Kubernetes

Summary

The Application Services Proxy, or ASP, runs on each node in a Kubernetes Cluster. Create a ConfigMap to configure the ASP; then, create a DaemonSet to run the ASP in a pod on each node in your cluster.

Initial Setup

Before you can use the Application Services Proxy, you must complete the following tasks:

  1. Accept the Terms of Service in Docker Store.

  2. Create a Kubernetes Secret containing your Docker login credentials (required to pull the asp image from Docker Store). The Kubernetes documentation provides instructions for creating the Secret:

    Important

    You must create the Secret in the same namespace the ASP runs in: kube-system.

Set up the ASP using a ConfigMap

  1. Define the ASP’s global and orchestration configurations in a ConfigMap.

    kind: ConfigMap
    apiVersion: v1
    metadata:
      name: f5-asp-config
      namespace: kube-system
    data:
      asp.config.json: |
        {
          "global": {
            "console-log-level": "info"
          },
          "orchestration": {
            "kubernetes": {
              "config-file": "/var/run/kubernetes/proxy-plugin/service-ports.json",
              "poll-interval": 500
            }
          }
        }
    

    f5-asp-k8s-example-configmap.yaml

  2. Upload the ConfigMap to Kubernetes.

    user@k8s-master:~$ kubectl create -f f5-asp-configmap.yaml
    configmap "f5-asp-config" created
    
  3. Verify creation of the ConfigMap.

    user@k8s-master:~$ kubectl get configmap f5-asp-config -o yaml --namespace kube-system
    apiVersion: v1
    data:
      asp.config.json: |
        {
          "global": {
            "console-log-level": "debug"
          },
          "orchestration": {
            "kubernetes": {
              "config-file": "/var/run/kubernetes/proxy-plugin/service-ports.json",
              "poll-interval": 500
            }
          }
        }
    kind: ConfigMap
    metadata:
      creationTimestamp: 2017-02-16T17:55:04Z
      name: f5-asp-config
      namespace: kube-system
      resourceVersion: "1589344"
      selfLink: /api/v1/namespaces/kube-system/configmaps/f5-asp-config
      uid: 0bdc4be2-f471-11e6-92a8-fa163e4f44e9
    

Create a DaemonSet and launch ASP Pods

  1. Create a DaemonSet.

    Important

    Be sure to include the Secret containing your Docker login credentials.

    apiVersion: extensions/v1beta1
    kind: DaemonSet
    metadata:
      name: f5-asp
      namespace: kube-system
    spec:
      template:
        metadata:
          labels:
            name: f5-asp
        spec:
          hostNetwork: true
          containers:
            - name: f5-asp
              image: "store/f5networks/asp:1.0.0"
              args:
                # the config file is loaded from the ConfigMap; it contains the
                # ASP global config
                - --config-file
                - /etc/configmap/asp.config.json
              securityContext:
                privileged: false
              volumeMounts:
              # mount a new directory
              - name: plugin-config
                # the path the directory will be added to; do not change
                mountPath: /var/run/kubernetes/proxy-plugin
                readOnly: true
              # mount a new directory
              - name: asp-config
                # the path the directory will be added to; do not change
                mountPath: /etc/configmap
          # provide the name of the Secret containing the Docker login credentials
          # REQUIRED TO PULL THE ASP IMAGE FROM DOCKER STORE
          imagePullSecrets:
            - name: <my-secret>
          volumes:
            - name: plugin-config
              hostPath:
                path: /var/run/kubernetes/proxy-plugin
            - name: asp-config
              # replace with name of your ASP ConfigMap
              configMap:
                name: f5-asp-config
    

    f5-asp-k8s-example-daemonset.yaml

  2. Upload the DaemonSet to Kubernetes.

    user@k8s-master:~$ kubectl create -f f5-asp-daemonset.yaml
    daemonset "f5-asp" created
    
  3. Verify the DaemonSet successfully created Pods for each node in the cluster.

    Note

    You should see one (1) f5-asp and one (1) kube-proxy per node in the cluster.

    user@k8s-master:~$ kubectl get pods --namespace kube-system -o wide
    NAME                                  READY     STATUS    RESTARTS   AGE       IP            NODE
    f5-asp-2uore                          1/1       Running   0          55m       172.16.1.21   172.16.1.21
    f5-asp-r4e94                          1/1       Running   0          55m       172.16.1.19   172.16.1.19
    k8s-bigip-ctlr-1439955937-fkfb2       1/1       Running   0          1d        10.2.5.3      172.16.1.21
    kube-apiserver-172.16.1.19            1/1       Running   0          11d       172.16.1.19   172.16.1.19
    kube-controller-manager-172.16.1.19   1/1       Running   0          11d       172.16.1.19   172.16.1.19
    kube-dns-v11-mp8ts                    4/4       Running   0          2d        10.2.5.2      172.16.1.21
    kube-proxy-172.16.1.19                1/1       Running   7          12m       172.16.1.19   172.16.1.19
    kube-proxy-172.16.1.21                1/1       Running   11         4m        172.16.1.21   172.16.1.21
    kube-scheduler-172.16.1.19            1/1       Running   0          11d       172.16.1.19   172.16.1.19
    kubernetes-dashboard-172.16.1.19      1/1       Running   2          11d       172.16.1.19   172.16.1.19