adm-agent
by NetScaler
A Helm chart for NetScaler ADM Agent
About this chart
Deploy ADM agent
Deploy container-based ADM agent to connect NetScaler CPX with ADM Service for management and monitoring.
Table of Contents
- TL; DR;
- Introduction
- Generate authentication and authorization token from Access ID and Secret to access ADM
- Deploy ADM agent onboarding using Helm chart
- 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
A.1) Get Access ID and Secret to access ADM
For Access ID and secret see this.
A.2) To create ADM agent login Secret, 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 agent netscaler/adm-agent --namespace <namespace> --set accessSecret=<Access-Seret-Name>,loginSecret=<ADM-Login-Secret-Name>
Note: By default, helper.required=false and the customer is advised to create admlogin secret in every namespace where CPX is deployed if the namespace of CPX and ADM agent is different.
kubectl create secret generic admlogin --from-literal=username=nsroot --from-literal=password=<adm-agent-password> -n <namespace>
If you are deploying Netscaler CPX and ADM agent in different namespaces, please label namespace with citrix-cpx=enabled in which Netscaler CPX has been deployed and and deploy adm-agent with helper.required=true. In this case, the agent will take care of creating admlogin secret in other namespaces itself.For more information, see Create Secret automatically.
Introduction
NetScaler provides a container based ADM agent to connect NetScaler CPX with ADM service for management and monitoring of NetScaler CPX.
Prerequisites
-
Ensure that you have a NetScaler ADM account. To use ADM, you must create a Cloud account. To manage 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.
-
Ensure that serviceaccount adm-agent-serviceaccount is given privilege access. For more information, please see this
Get Access ID and Secret
Perform the following steps to get access ID and secret for accessing ADM:
-
Log in to NetScaler ADM Service 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. -
You have to create Kubernetes secret using
access-idandaccess-secretgenerated in previous step. These credentials are required for the agent to connect with NetScaler Console service.kubectl create secret generic accesssecret --from-literal=accessid= --from-literal=accesssecret= -n namespace
Deploy ADM agent using the Helm chart
Before deploying the ADM agent, you must create a Kubernetes Secret containing the access ID and Secret to access ADM. For information about getting the access ID and secret for accessing ADM, see Access ID and Secret to access ADM. After the Secret has been created, use the following commands to deploy ADM Agent:
helm repo add netscaler https://netscaler.github.io/netscaler-helm-charts
helm install agent netscaler/adm-agent --namespace <namespace> --set accessSecret=<Access-Seret-Name>,loginSecret=<ADM-Login-Secret-Name>
It deploys ADM Agent and registers with ADM service. It also deploys a sidecar along with ADM Agent which can create a Kubernetes Secret containing login credentials of ADM Agent automatically when namespace is labelled with citrix-cpx=enabled, more detail here. By default, helper.required=false and the customer is advised to create admlogin secret in every namespace where CPX is deployed if the namespace of CPX and ADM agent is different.
kubectl create secret generic admlogin --from-literal=username=nsroot --from-literal=password=<adm-agent-password> -n <namespace>
If you are deploying Netscaler CPX and ADM agent in different namespaces, please label namespace with citrix-cpx=enabled in which Netscaler CPX has been deployed and and deploy adm-agent with helper.required=true. In this case, the agent will take care of creating admlogin secret in other namespaces itself.For more information, see Create Secret automatically.
Create login secret manually for NetScaler ADM agent
ADM agent login credentials are required by NetScaler CPX while registering itself to ADM Service. You can create it manually on all the namespaces in which Netscaler CPX will be deployed and also on the namespace in which the ADM agent 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 ADM agent using the following command:
helm install agent netscaler/adm-agent --namespace <namespace> --set accessSecret=<Access-Seret-Name>,loginSecret=<ADM-Login-Secret-Name>
Automatic login secret for NetScaler ADM agent
ADM agent can create the secret for ADM agent and deploys a sidecar along with the 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 adm-agent with the release name agent, use the following command:
helm uninstall agent -n <namespace>
NOTE While removing Agent, it removes CPX & cluster registered with Agent from ADM Service. You need remove the Cluster and Agent from NetScaler ADM UI manually in case any error happen.
ServiceAccount
To provide privileged permissions to the service account used by ADM Agent, please use following command
oc adm policy add-scc-to-user privileged system:serviceaccount:<namespace>:adm-agent-serviceaccount
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 |
imageTag | Image tag of the ADM agent container | 141.37.40 |
pullPolicy | Specifies the image pull policy for ADM agent. | IfNotPresent |
accessSecret | Specifies the ID and Secret to access ADM Service. | Nil |
loginSecret | Specifies the login Secret of NetScaler ADM agent. | Nil |
clusterPrefix | Kubernetes/Openshift Cluster Prefix. This will be used while registering cluster to ADM. | Nil |
helper.helperImageRegistry | Image registry of NetScaler ADM agent helper | quay.io |
helper.helperImageRepository | Image repository of NetScaler ADM agent helper | citrix/adm-agent-helper |
helper.helperImageTag | Image tag of NetScaler ADM agent helper | 2.0.1 |
helper.pullPolicy | Specifies the image pull policy for ADM agent Helper. | IfNotPresent |
helper.required | Set this to true, to create admlogin secret in all namespaces where CPX is deployed, in case the namespace of CPX and adm-agent is different. | false |
hpa.required | Set this to true, to run hpa which scales CORE POD when memory and cpu threshold breaches | true |
hpa.minReplicas | Minimum replicas for CORE POD | 1 |
hpa.maxReplicas | Maximum replicas for CORE POD to be scaled when memory or cpu threshold breaches | 10 |
hpa.targetCPUUtilization | CPU Utilization threshold value to scale up CORE POD | 1000m |
hpa.targetMemoryUtilization | Memory Utilization threshold value to scale up CORE POD | 4000Mi |
core.resources | CPU/Memory resource requests/limits for CORE POD | {} |
lic.resources | CPU/Memory resource requests/limits for lic POD | {} |
kad.resources | CPU/Memory resource requests/limits for kad POD | {} |
redis.resources | CPU/Memory resource requests/limits for redis POD | {} |
sharding.resources | CPU/Memory resource requests/limits for sharding POD | {} |
helper.resources | CPU/Memory resource requests/limits for helper container | {} |
core.livenessProbe | liveness probe for CORE POD | For Default values please refer this |
core.readinessProbe | Readiness probe for CORE POD | For Default values please refer this |
redis.livenessProbe | liveness probe for REDIS POD | For Default values please refer this |
redis.readinessProbe | Readiness probe for REDIS POD | For Default values please refer this |
lic.livenessProbe | liveness probe for LIC POD | For Default values please refer this |
Note: You can use the values.yaml file packaged in the chart. This file contains the default configuration values for the chart.
Deploy adm-agent 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 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 is pinned at v141.37.40 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