Install the Cluster Agent with the Kubernetes CLI
This page describes how to install the Cluster Agent using the Kubernetes CLI which is an alternative toInstall the Cluster Agent with Helm Charts.
Requirements
Before you begin, verify that you have:
- installed kubectl >= 1.16
- met the requirements described here: Cluster Agent Requirements and Supported Environments
- the Cluster Agent and AppDynamics Operator images. To create a custom Cluster Agent image, seeBuild the Cluster Agent Container Image and to create a custom operator image, seeAppDynamics Operator Container Image.
Requirements
Before you begin, verify that you have:
- Installed kubectl >= 1.16
- Met the requirements described here: Cluster Agent Requirements and Supported Environments
Installation Procedure
Configuration to Use Custom Kubernetes API Server
To use Kubernetes API Server, you require to add the following to the cluster-agent-operator.yaml (for Kubernetes >=1.16) or cluster-agent-operator-openshift.yaml (OpenShift with Kubernetes >=1.16) spec :
- Update
configMapin thecluster-agent-operator.yamlfile with the Kubernetes API server details. These details are required:server: specify the URL of the Kubernetes API server.clusters.name: name of the cluster.users.name: name of the user who can access the Kubernetes API server.contexts.context: update the cluster name and user name to map the user details with the specific cluster.The following sample yaml file includes the required parameters:
Here,apiVersion: v1 kind: ConfigMap metadata: name: custom-kubeconfig namespace: appdynamics data: kubeconfig: | apiVersion: v1 clusters: - cluster: server: "https://kubernetes.default.svc" certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt name: psr-cluster contexts: - context: cluster: psr-cluster user: psr-user name: psr-context current-context: psr-context kind: Config preferences: {} users: - name: psr-user user: tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/tokenhttps://kubernetes.default.svcis the URL of the API server. Under clusters,psr-clusteris the name of the cluster. Under users, psr-user is the user who can use the Kubernetes API server.
- Set the
USE_CUSTOM_KUBECONFIGenv variable totruein thecluster-agent-operator.yaml(for Kubernetes >=1.16) orcluster-agent-operator-openshift.yaml(OpenShift with Kubernetes >=1.16) file.- name: USE_CUSTOM_KUBECONFIG value: "true