SPK CWC¶
Overview¶
The Service Proxy for Kubernetes (SPK) Cluster Wide Controller (CWC) enables SPK’s software licensing and billing capabilities. Once the SPK software is installed and licensed, the CWC collects and reports software usage telemetry statistics based on the number of SPK CRs used by the licensed BIG-IP Controller instances in the cluster. SPK uses F5’s flexible consumption software licensing model, billing only for the SPK features used.
Note: SPK Licensing applies to the cluster level, and is performed prior to installing the BIG-IP Controller instances.
This document guides you through installing the CWC controller.
CPCL module¶
The CWC contains the Common Product Component and Libraries (CPCL) module that helps with license activation, and with generating and maintaining the monthly license reports. The CPCL requires these two important licensing objects:
- A JWKS (JSON Web Key Set) that must be installed prior to installing the CWC Pod. The JWKS can be downloaded and installed using the Install the JWKS procedure.
- A JWT (JSON Web Token) that is associated with your unique CAT (Customer Association Token). The JWT can be obtained from your MyF5 account and will be installed using the Install the CWC procedure.
Installing the CWC Pod is demonstrated in this overview, and licensing the cluster will demonstrated in the SPK Licensing overview.
CPCL modes¶
The CPCL module supports two licensing modes:
- disconnected - When the CWC does not have access to the internet, each licensing task must be performed manually.
- connected - When the CWC has access the internet, it can automatically perform each of the licensing tasks.
The CWC configurations required to enable each mode are available in the Procedures section of this document.
Cluster namespace¶
The CWC Pod can install to any cluster namespace. In this document, the CWC will install to the spk-telemetry namespace. As mentioned previously, CWC licensing applies to the entire cluster, not a single namespace (namespace).
RabbitMQ¶
The CWC and BIG-IP Controller Pod communicate through the RabbitMQ open source message broker to determine the cluster licensing status. Ensure connectivity is permitted for the service ports listed in the sections below.
CWC Service¶
After installing the CWC, a CWC Service object is created that receives REST API data on TCP service port 30881, and forwards the data to the CWC Pod on TCP service port 38081. Ensure the Service ports are available, and the cluster has CoreDNS enabled. In this example, the SPK components will need to resolve the f5-spk-cwc.spk-telemetry DNS hostname.
Name: f5-spk-cwc
Namespace: spk-telemetry
IP: 10.109.102.215
Port: cwc-rest 30881/TCP
Endpoints: 10.244.1.75:38081
RabbitMQ Service¶
After installing the RabbitMQ Pod, a RabbitMQ Service object is created, to pass messages between the BIG-IP Controllers and the CWC on TCP service port 5671. Ensure the Service port is available, and the cluster’s core DNS is enabled. In this example, the SPK components will need to resolve the rabbitmq-server.spk-telemetry hostname.
Name: rabbitmq-server
Namespace: spk-telemetry
IP: 10.109.105.210
Port: ampqst 5671/TCP
Endpoints: 10.244.1.80:5671
CWC capabilities¶
The CWC supports the following capabilities:
- Licensing. Refer to the SPK Licensing guide for more information.
- Debugging. Refer to the Debug API guide for more information.
Requirements¶
Ensure you have:
- Installed the SPK software.
- Installed the SPK Cert Manager.
- A Linux workstation with Helm, OpenSSL and make installed.
- Obtained the CPCL SSL/TLS key and the JWT from your MyF5 account.
Procedures¶
Create API certificates¶
Use this procedure to create the SSL/TLS certificates required to authenticate the CWC REST API when using CWC in disconnected mode.
Change into directory with the SPK Software files, and list the files in the tar directory:
In this example, the SPK files are in the spkinstall directory.
cd spkinstall
ls -1 tar
This procedure requires the f5-cert-gen-0.5.2.tgz file.
csrc-0.3.7.tgz cwc-2.0.8.tgz f5-cert-gen-0.5.2.tgz f5-cert-manager-0.5.12.tgz f5-dssm-3.0.25.tgz f5-toda-fluentd-3.0.16.tgz f5ingress-10.0.60.tgz rabbitmq-2.0.5.tgz spk-docker-images.tgz
Extract the cert-gen utility to generate the SSL/TLS certificates and Secrets:
tar xvf tar/f5-cert-gen-0.5.2.tgz
Generate the SSL/TLS certificates and Secret for the CWC REST API:
Note: The certificates will be referenced in the Configure Postman section of the SPK Licensing guide.
sh cert-gen/gen_cert.sh -s=api-server -a=f5-spk-cwc.<namespace> -n=1
In this example, the CWC installs to the spk-telemetry namespace.
sh cert-gen/gen_cert.sh -s=api-server -a=f5-spk-cwc.spk-telemetry -n=1
The command output indicates the Secret has been created:
Generating /path/cwc-license-certs.yaml
Install the CWC REST API Secret:
In this example, the CWC installs to the spk-telemetry Project.
kubectl apply -f cwc-license-certs.yaml -n spk-telemetry
The command output indicates the Secret was created successfully:
secret/cwc-license-certs created
Continue to the next procedure.
Install RabbitMQ¶
Use these steps to install the RabbitMQ Pod.
Change into directory with the SPK Software files, and list the files in the tar directory:
In this example, the SPK files are in the spkinstall directory.
cd spkinstall
ls -1 tar
This procedure requires the rabbitmq-2.0.5.tgz file.
csrc-0.3.7.tgz cwc-2.0.8.tgz f5-cert-gen-0.5.2.tgz f5-cert-manager-0.5.12.tgz f5-dssm-3.0.25.tgz f5-toda-fluentd-3.0.16.tgz f5ingress-10.0.60.tgz rabbitmq-2.0.5.tgz spk-docker-images.tgz
To pull the RabbitMQ software image from the local software registry, create a rabbitmq-values.yaml file, and set the
image.repository
parameter:image: repository: "local.registry.com"
Install the RabbitMQ Pod:
In this example, the RabbitMQ Pod installs to the spk-telemetry namespace.
helm install spk-rabbit tar/rabbitmq-2.0.5.tgz -f rabbitmq-values.yaml -n spk-telemetry
Verify the RabbitMQ Pod STATUS:
kubectl get pods -n spk-telemetry
In this example, the RabbitMQ Pod STATUS is Running.
NAME READY STATUS f5-rabbit-5688f9c8c7-f7d9d 1/1 Running
Continue to the next section.
Install the JWKS¶
Use these steps to download and install the JWKS ConfigMap.
Download the JWKS cpcl-key-cm (key) ConfigMap here.
Install the JWKS cpcl-key-cm ConfigMap:
In this example, the ConfigMap installs to the spk-telemetry namespace:
kubectl apply -f cpcl-key.yaml -n spk-telemetry
Continue to either the Install CWC - connected or the Install CWC - disconnected procedure.
Install CWC - connected¶
Use these steps to install the CWC Pod using connected
mode.
Important: Ensure the CWC Pod has access to the product.apis.f5.com licensing server over TCP service port 443.
Change into the directory with the SPK software files, and list the files in the tar directory:
In this example, the SPK files are in the spkinstall directory:
cd spkinstall
ls -1 tar
This procedure requires the cwc-2.0.8.tgz Helm chart.
csrc-0.3.7.tgz cwc-2.0.8.tgz f5-cert-gen-0.5.2.tgz f5-cert-manager-0.5.12.tgz f5-dssm-3.0.25.tgz f5-toda-fluentd-3.0.16.tgz f5ingress-10.0.60.tgz rabbitmq-2.0.5.tgz spk-docker-images.tgz
To pull the CWC software image from the local software registry, create a cwc-values.yaml file, and set the
image.repository
parameter:image: repository: "local.registry.com"
Set the
rabbitmqNamespace
parameter to the CWC namespace in the cwc-values.yaml file:rabbitmqNamespace: "spk-telemetry"
To automatically obtain the cluster license from the F5 license server, add the F5 provided JWT to the
jwt
parameter in the cwc-values.yaml file:Note: The
jwt
value “eyJhbGciOiJSUzUxMiIsInR5cCI6” has been shortened for readability.cpclConfig: operationMode: "connected" jwt: "eyJhbGciOiJSUzUxMiIsInR5cCI6" teemCertUrl: "https://product.apis.f5.com/ee/v1/entitlements/telemetry" teemEntitlementUrl: "https://product.apis.f5.com/ee/v1/entitlements/telemetry" teemInitialConfigUrl: "https://product.apis.f5.com/ee/v1/entitlements/telemetry"
Add the SPK CWC default serviceAccount to the Project’s privileged security context constraint (SCC):
oc adm policy add-scc-to-user privileged -n <project> -z <serviceaccount>
In this example, the default serviceAccount is added to the spk-telemetry Project’s privileged SCC:
oc adm policy add-scc-to-user privileged -n spk-telemetry -z default
Install the CWC Pod:
In this example, the CWC Pod installs to the spk-telemetry namespace.
helm install spk-cwc tar/cwc-2.0.8.tgz -f cwc-values.yaml -n spk-telemetry
Verify the STATUS of the CWC Pod:
kubectl get pods -n spk-telemetry
In this example, the CWC Pod STATUS is Running.
NAME READY STATUS f5-rabbit-5688f9c8c7-lv49b 1/1 Running f5-spk-cwc-94bcd64bd-42xdc 1/1 Running
Continue to the Next steps section.
Install CWC - disconnected¶
Use these steps to install the CWC Pod using disconnected
mode.
Change into the directory with the SPK software files, and list the files in the tar directory:
In this example, the SPK files are in the spkinstall directory:
cd spkinstall
ls -1 tar
This procedure requires the cwc-2.0.8.tgz Helm chart.
csrc-0.3.7.tgz cwc-2.0.8.tgz f5-cert-gen-0.5.2.tgz f5-cert-manager-0.5.12.tgz f5-dssm-3.0.25.tgz f5-toda-fluentd-3.0.16.tgz f5ingress-10.0.60.tgz rabbitmq-2.0.5.tgz spk-docker-images.tgz
To pull the CWC software image from the local software registry, create a cwc-values.yaml file, and set the
image.repository
parameter:image: repository: "local.registry.com"
Set the
rabbitmqNamespace
parameter to the CWC namespace in the cwc-values.yaml file:rabbitmqNamespace: "spk-telemetry"
Add the SPK CWC serviceAccount to the Project’s privileged security context constraint (SCC):
Note: The spk-cwc serviceAccount name is based on the Helm release name. See Step 6.
oc adm policy add-scc-to-user privileged -n <project> -z <serviceaccount>
In this example, the spk-cwc serviceAccount is added to the spk-telemetry Project’s privileged SCC:
oc adm policy add-scc-to-user privileged -n spk-telemetry -z spk-cwc
Install the CWC Pod, and reference the JWT:
In this example, the
cpcpConfig.jwt
value eyJhbGciOiJSUzUxMiIsInR5cCI6 has been truncated for readabilityhelm install spk-cwc tar/cwc-2.0.8.tgz -f cwc-values.yaml \ --set cpclConfig.jwt=eyJhbGciOiJSUzUxMiIsInR5cCI6 -n spk-telemetry
Verify the STATUS of the CWC Pod:
kubectl get pods -n spk-telemetry
In this example, the CWC Pod STATUS is Running.
NAME READY STATUS f5-rabbit-5688f9c8c7-lv49b 1/1 Running f5-spk-cwc-94bcd64bd-42xdc 1/1 Running
Continue to the Next steps section.
Next steps¶
- If the CPCL is running in
connected
mode, continue to the SPK Controller guide. - If the CPCL is running in
disconnected
mode, continue to the SPK Licensing guide to license the cluster.
Feedback¶
Provide feedback to improve this document by emailing spkdocs@f5.com.