adm-agent-onboarding
by NetScaler
A Helm chart for ADM agent onboarding
About this chart
Deploy ADM agent onboarding as Kubernetes Job
Kubernetes job is an object that creates one or more pods and tracks the operations of pods. Kubernetes Jobs ensure that the specified number of pods are accomplished effectively. The job is considered complete when a specified number of successful run of pods is complete.
You can deploy ADM agent onboarding as a Kubernetes Job helps you to deploy container-based NetScaler ADM agent and also performs all the necessary settings in NetScaler ADM for generating service graph.
Table of Contents
- TL; DR;
- Introduction
- Generate authentication and authorization token from Access ID and Secret to access NetScaler ADM
- Deploy ADM agent onboarding using Helm chart
- Deploy ADM agent onboarding using Helm chart and register NetScaler VPX/MPX in NetScaler ADM
- Manual creating login secret for NetScaler ADM Agent
- Automatic login secret for NetScaler ADM Agent
- Clean Up
- Configuration Parameters
TL; DR;
A) Deploy adm-agent-onboarding Kubernetes job
A.1) Generate authentication and authorization token from Access ID and Secret to access NetScaler ADM
To generate the authentication and authorization bearer token using Access ID and secret see this.
A.2) To create ADM Agent login Secret automatically, use the following command:
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set token=<Token>
Note: If you are deploying NetScaler CPX and NetScaler ADM agent in different namespaces, please label namespace with citrix-cpx=enabled in which NetScaler CPX has been deployed. For more information, see Create Secret automatically.
A.2) To create NetScaler ADM agent login Secret manually, use the following command:
kubectl create secret generic admlogin --from-literal=username=nsroot --from-literal=password=<adm-agent-password> -n <namespace>
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set admAgent.loginSecret=admlogin --set token=<Token>
Note: You must create admlogin in all the namespaces in which NetScaler CPX is deployed.
A.2) To create ADM Agent login Secret automatically and register NetScaler VPX/MPX in ADM, use the following command:
kubectl create secret generic nslogin --from-literal=username=<NetScaler Username> --from-literal=password=<NetScaler password> -n <namespace>
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set adc.IP=<NetScaler ManagementIP>,adc.loginSecret=nslogin --set token=<Token>
Note: If you are deploying NetScaler CPX and NetScaler ADM agent in different namespaces, please label namespace with citrix-cpx=enabled in which NetScaler CPX has been deployed. For more information, see Create Secret automatically. nslogin is Kubernetes secret for credential of NetScaler VPX/MPX. Use the management IP address for the adc.IP argument.
A.2) To create ADM Agent login Secret automatically and register NetScaler VPX/MPX in ADM, use the following command:
kubectl create secret generic nslogin --from-literal=username=<NetScaler Username> --from-literal=password=<NetScaler password> -n <namespace>
kubectl create secret generic admlogin --from-literal=username=nsroot --from-literal=password=<adm-agent-password> -n <namespace>
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set admAgent.loginSecret=admlogin --set adc.IP=<NetScaler ManagementIP>,adc.loginSecret=nslogin --set token=<Token>
Note: You must create admlogin in all the namespaces in which NetScaler CPX is deployed. nslogin is Kubernetes secret for credential of NetScaler VPX/MPX. Use the management IP address for the adc.IP argument.
Introduction
NetScaler provides a Kubernetes Job known as ADM agent onboarding to simplify the container-based NetScaler ADM agent deployment and ADM settings configurations required for generating service graph. This Kubernetes Job automatically downloads the YAML file required for the NetScaler ADM agent, deploys it, and registers the cluster in NetScaler ADM.
For example to generate Service Graph with SMLite, see Service graph example. For example to generate Service Graph of NetScaler intergration with Istio Service Mesh, see Service graph with NetScaler Observability and ADM.
Prerequisites
-
Ensure that you have a NetScaler ADM account. To use NetScaler ADM, you must create a NetScaler Cloud account. To manage NetScaler ADM with an Express account, see Getting Started.
-
Ensure that you installed Kubernetes version 1.16 or later. For more information about Kubernetes installation, see Kubernetes.
-
Ensure that you have installed Helm version 3.x. For information about Helm chart installation, see Helm.
-
Ensure that the ports described in the Ports document are open.
-
For registering NetScaler VPX or MPX in NetScaler ADM using ADM agent onboarding, you should establish the connectivity between NetScaler VPX or MPX and cluster nodes. This connectivity can be established by configuring routes on NetScaler as described here or by deploying NetScaler Node Controller.
Generate Authentication and Authorization Token from Access ID and Secret
Perform the following steps to get access ID and secret for accessing NetScaler ADM:
-
Log in to NetScaler Cloud account.
-
On the left Menu panel, select Identity and Access Management.
-
Go to API Access.
-
Specify the client name and click Create Client.
-
Download and save the
access-idandaccess-secretgenerated.
Now, you can generate authorization bearer token using access ID and access secret using below script:
wget https://raw.githubusercontent.com/netscaler/netscaler-helm-charts/master/generate_token.py
python3 generate_token.py --accessID=<accessID> --accessSecret=<accessSecret>
NOTE: The bearer token expires in an hour (3600 seconds).
Deploy ADM agent onboarding using the Helm chart
Before deploying the ADM agent onboarding, you must create a Kubernetes Secret containing the client ID and Secret to access NetScaler ADM. For information about getting the access ID and secret for accessing NetScaler ADM, see Access ID and Secret to access NetScaler ADM. After the Secret has been created, use the following commands to deploy NetScaler ADM Agent:
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set token=<Token>
It deploys the Kubernetes Job that deploys NetScaler ADM Agent and registers the cluster on the NetScaler ADM. it also performs the other settings required for servicegraph in NetScaler ADM. It also deploys a sidecar along with NetScaler ADM Agent which can create a Kubernetes Secret containing login credentials of NetScaler ADM Agent automatically when namespace is labelled with citrix-cpx=enabled, more detail here.
Note: If you do not want to run a sidecar, see Create Secret manually for NetScaler agent.
Deploy ADM agent onboarding and register NetScaler VPX/MPX with NetScaler ADM
Important Note: For registering NetScaler VPX/MPX in NetScaler ADM, you should establish the connectivity between NetScaler VPX or MPX and cluster nodes. This connectivity can be established by configuring routes on NetScaler as described in the document: Static route on Ingress NetScaler or by deploying NetScaler node controller.
To register NetScaler VPX/MPX with NetScaler ADM, create a Kubernetes secret containing login credentials of NetScaler VPX/MPX in the namespace in which ADM agent onboarding Job will be functional. Use the following command:
kubectl create secret generic nslogin --from-literal=username=<username> --from-literal=password=<netscaler-password> -n <namespace>
You have to pass the management IP address of NetScaler VPX/MPX as an environment variable: adc.IP.
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set adc.IP=<NetScaler ManagementIP>,adc.loginSecret=nslogin --set token=<Token>
Note: Using environment variables, you can specify the management HTTP port adc.mgmtHTTPPort and HTTPS port adc.mgmtHTTPSPort as 80 and 443 respectively.
Create login secret manually for NetScaler ADM agent
NetScaler ADM agent login credentials are required by NetScaler CPX while registering itself to NetScaler ADM. You can create it manually on all the namespaces in which NetScaler CPX will be deployed and also on the namespace in which the NetScaler ADM agent Adaptor Kubernetes job will be created.
kubectl create secret generic admlogin --from-literal=username=nsroot --from-literal=password=<adm-agent-password> -n <namespace>
After the Secret has been created, you can deploy the NetScaler ADM agent using the following command:
helm install netscaler-adm netscaler/adm-agent-onboarding --namespace <namespace> --set admAgent.loginSecret=admlogin --set token=<Token>
Automatic login secret for NetScaler ADM agent
NetScaler ADM agent can create the secret for NetScaler ADM agent and deploys a sidecar along with the NetScaler ADM agent that creates the secret automatically whenever a namespace is labelled with citrix-cpx=enabled.
To label a namespace, use the following command:
kubectl label namespace <namespace> citrix-cpx=enabled
Clean up
To delete the resources created during the deployment of ADM agent onboarding adm-agent-onboarding with the release name netscaler-adm, use the following command:
helm delete netscaler-adm -n <namespace>
To delete NetScaler ADM Agent pods and other resources use the following commands:
kubectl delete deployment admagent -n <namespace>
kubectl delete secret admagent -n <namespace>
kubectl delete configmaps admagent -n <namespace>
kubectl delete svc admagent -n <namespace>
kubectl delete secret admlogin -n <namespace>
kubectl delete secret nslogin -n <namespace>
kubectl delete sa admagent -n <namespace>
kubectl delete clusterroles admagent -n <namespace>
kubectl delete clusterrolebindings admagent -n <namespace>
NOTE You need remove the Cluster and Agent from NetScaler ADM UI manually.
Configuration parameters
The following table provides the configurable parameters and their default values in the Helm chart.
| Parameter | Description | Default |
|---|---|---|
imageRegistry | Image registry of the ADM agent onboarding container | quay.io |
imageRepository | Image repository of the ADM agent onboarding container | citrix/adm-agent-onboarding |
imageTag | Image tag of the ADM agent onboarding container | 1.1.0 |
pullPolicy | Specifies the image pull policy for ADM agent onboarding. | IfNotPresent |
token | Authentication and authorization bearer token generated using access ID and access secret. | nil |
apiURL | Provide Kubernetes API URL in https://<host>:port format | nil |
clusterName | Kubernetes cluster name to be registered in ADM Service. | nil |
admAgent.name | Name for the ADM Agent. | "admagent" |
admAgent.imageRegistry | Image registry of the NetScaler ADM agent | quay.io |
admAgent.imageRepository | Image repository of the NetScaler ADM agent | citrix/adm-agent |
admAgent.imageTag | Image tag of the NetScaler ADM agent | latest |
admAgent.helperImageRegistry | Image registry of NetScaler ADM agent helper | quay.io |
admAgent.helperImageRepository | Image repository of NetScaler ADM agen |
Deploy adm-agent-onboarding with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has adm-agent-onboarding on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartadm-agent-onboarding is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply