DaemonSet
The Aperture Agent can be installed as a Kubernetes DaemonSet, where it will get deployed on all the nodes of the cluster.
Prerequisites
You can do the installation using the aperturectl CLI tool or using Helm.
Install the tool of your choice using the following links:
- Refer
aperturectl install agent to see all the available command line arguments.
Once the Helm CLI is installed, add the Aperture Agent Helm chart repository in your environment for install or upgrade:
helm repo add aperture https://fluxninja.github.io/aperture/
helm repo update
Installation
The Aperture Agent in the DaemonSet mode will be installed using the Kubernetes Custom Resource, which will be managed by the Aperture Operator.
By following these instructions, you will have deployed the Aperture Agent into your cluster.
Kubernetes Objects which will be created by following steps are listed here.
Configure the below parameters of etcd and Prometheus for the Agent Custom Resource by creating a
values.yamland passing it withinstallcommand:agent:
config:
etcd:
endpoints: ["ETCD_ENDPOINT_HERE"]
prometheus:
address: "PROMETHEUS_ADDRESS_HERE"
agent_functions:
endpoints: ["CONTROLLER_ENDPOINT_HERE"]Replace the values of
ETCD_ENDPOINT_HEREandPROMETHEUS_ADDRESS_HEREwith the actual values of etcd and Prometheus, which is also being used by the Aperture Controller you want these Agents to connect to.CONTROLLER_ENDPOINT_HEREshould point to the Aperture Controller. If you skip it, some sub commandsaperturectlcommands won't work.If you have installed the Aperture Controller on the same cluster in
defaultnamespace, with etcd and Prometheus usingcontrolleras release name, the values for the values forETCD_ENDPOINT_HERE,PROMETHEUS_ADDRESS_HEREandCONTROLLER_ENDPOINT_HEREwould be as below:agent:
config:
etcd:
endpoints: ["http://controller-etcd.default.svc.cluster.local:2379"]
prometheus:
address: "http://controller-prometheus-server.default.svc.cluster.local:80"
agent_functions:
endpoints: ["aperture-controller.default.svc.cluster.local:8080"]- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yamlhelm install agent aperture/aperture-agent -f values.yamlIf you want to modify the default parameters or the Aperture Agent configuration, for example
log, you can create or update thevalues.yamlfile and pass it withinstallcommand:agent:
config:
etcd:
endpoints: ["http://controller-etcd.default.svc.cluster.local:2379"]
prometheus:
address: "http://controller-prometheus-server.default.svc.cluster.local:80"
log:
level: debug
pretty_console: true
non_blocking: false- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yamlhelm install agent aperture/aperture-agent -f values.yamlAll the configuration parameters for the Aperture Agent are available here.
A list of configurable parameters for the installation can be found in the README.
If you want to deploy the Aperture Agent into a namespace other than
default, use the--namespaceflag:- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yaml --namespace aperture-agenthelm install agent aperture/aperture-agent -f values.yaml --namespacen aperture-agent --create-namespaceAlternatively, you can create the Agent Custom Resource directly on the Kubernetes cluster using the below steps:
Create a
values.yamlfor just starting the operator and disabling the creation of Agent Custom Resource and pass it withinstallcommand:agent:
create: false- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yamlhelm install agent aperture/aperture-agent -f values.yamlCreate a YAML file with the following specifications:
apiVersion: fluxninja.com/v1alpha1
kind: Agent
metadata:
name: Agent
spec:
config:
etcd:
endpoints: ["ETCD_ENDPOINT_HERE"]
prometheus:
address: "PROMETHEUS_ADDRESS_HERE"Replace the values of
ETCD_ENDPOINT_HEREandPROMETHEUS_ADDRESS_HEREwith the actual values of etcd and Prometheus, which is also being used by the Aperture Controller you want these Agents to connect to.All the configuration parameters for the Agent Custom Resource are listed on the README file of the Helm chart.
Apply the YAML file to Kubernetes cluster using
kubectlkubectl apply -f agent.yaml
Refer to steps on the Istio Configuration if you do not have the Envoy Filter configured on your cluster.
Upgrade Procedure
By following these instructions, you will have deployed the upgraded version of Aperture Agent into your cluster.
Use the same
values.yamlfile created as part of the Installation Steps and pass it with below command:- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yamlhelm template --include-crds --no-hooks agent aperture/aperture-agent -f values.yaml | kubectl apply -f -Once all the pods are in a running state after upgrade, run the below command to keep the Helm release updated:
helm upgrade agent aperture/aperture-agent -f values.yamlIf you have deployed the Aperture Agent into a namespace other than
default, use the--namespaceflag:- aperturectl
- Helm
aperturectl install agent --version v2.8.0 --values-file values.yaml --namespace aperture-agenthelm template --include-crds --no-hooks agent aperture/aperture-agent -f values.yaml --namespace aperture-agent | kubectl apply -f -Once all the pods are in a running state after upgrade, run the below command to keep the Helm release updated:
helm upgrade agent aperture/aperture-agent -f values.yaml --namespace aperture-agent
Verifying the Installation
Once you have successfully deployed the resources, confirm that the Aperture Agent is up and running:
kubectl get pod -A
kubectl get agent -A
You should see pods for Aperture Agent and Agent Manager in RUNNING state and
Agent Custom Resource in created state.
Uninstall
You can uninstall the Aperture Agent and its components installed above by following these steps:
Uninstall the Aperture Agent:
- aperturectl
- Helm
aperturectl uninstall agent --version v2.8.0helm uninstall agentAlternatively, if you have installed the Aperture Agent Custom Resource as a standalone installation, follow the steps below:
Delete the Aperture Agent Custom Resource:
kubectl delete -f agent.yamlDelete the Aperture Agent to uninstall the Aperture Operator:
- aperturectl
- Helm
aperturectl uninstall agent --version v2.8.0helm uninstall agent
If you have installed the chart in some other namespace than the
default, execute the following commands:- aperturectl
- Helm
aperturectl uninstall agent --namespace aperture-agenthelm uninstall agent --namespace aperture-agent
kubectl delete namespace aperture-agentBy default, the Secret having SSL/TLS certificates generated by the Kubernetes Operator for itself is not deleted with above steps. If you want to delete it, run the following commands:
kubectl delete secret -l app.kubernetes.io/instance=agent-aperture-agent-managerOptional: Delete the CRD installed by the Helm chart:
noteDeleting a Helm chart using Helm does not delete the Custom Resource Definitions (CRD) installed from the chart.
kubectl delete crd agents.fluxninja.com