Docker
Below are the instructions to install the Aperture Controller on Docker.
Prerequisites
Install Docker on your system.
Create a Docker network:
docker network create aperture --driver bridge
Installation of etcd
etcd is required for the Aperture Controller to function. If you already have an etcd cluster running, you can skip these steps.
Create a volume which will be used by etcd:
docker volume create etcd-dataCreate a file named
etcd.envwith below content for passing the environment variables to the etcd:ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
ETCD_DATA_DIR=/bitnami/etcd/data
ETCDCTL_API=3
ETCD_ON_K8S=no
ETCD_START_FROM_SNAPSHOT=no
ETCD_DISASTER_RECOVERY=no
ALLOW_NONE_AUTHENTICATION=yes
ETCD_AUTH_TOKEN=simple
ETCD_AUTO_COMPACTION_MODE=periodic
ETCD_AUTO_COMPACTION_RETENTION=24
BITNAMI_DEBUG=falseRun the below command to start the etcd container:
docker run -d \
-p 2379:2379 \
--env-file etcd.env \
--name etcd \
--network aperture \
--volume etcd-data:/bitnami/etcd:rw \
--health-cmd /opt/bitnami/scripts/etcd/healthcheck.sh \
--health-interval 10s \
--health-retries 5 \
--health-start-period 30s \
--health-timeout 5s \
docker.io/bitnami/etcd:3.5.8-debian-11-r0Verify that the etcd container is in the
healthystate:CONTAINER_ID="etcd"; \
while [[ "$(docker inspect -f '{{.State.Health.Status}}' "${CONTAINER_ID}")" != "healthy" ]]; \
do echo "${CONTAINER_ID}" is starting; sleep 1; done; \
echo "${CONTAINER_ID}" is now healthy!
Installation of Prometheus
Prometheus is required for the Aperture Controller to function. If you already have a Prometheus instance running, you can skip these steps.
Create a volume which will be used by Prometheus:
docker volume create prometheus-dataCreate a file named
prometheus.yamlfor passing the configuration to the Prometheus:global:
evaluation_interval: 1m
scrape_interval: 1m
scrape_timeout: 10s
scrape_configs: []Run the below command to set correct permissions for the Prometheus data volume:
docker run --rm -v prometheus-data:/data:rw busybox chown -R 65534:65534 /dataRun the below command to start the Prometheus container:
docker run -d \
-p 9090:9090 \
--name prometheus \
--network aperture \
--volume prometheus-data:/data:rw \
--volume "$(pwd)"/prometheus.yaml:/etc/config/prometheus.yaml:ro \
--health-cmd "wget --quiet --output-document=/dev/null --server-response --spider localhost:9090/-/ready 2>&1 | grep \"200 OK\" || exit 1" \
--health-interval 10s \
--health-retries 5 \
--health-start-period 30s \
--health-timeout 5s \
quay.io/prometheus/prometheus:v2.33.5 \
--config.file=/etc/config/prometheus.yaml \
--storage.tsdb.path=/data \
--storage.tsdb.retention.time=1d \
--web.enable-remote-write-receiver \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.console.templates=/etc/prometheus/consolesVerify that the Prometheus container is in the
healthystate:CONTAINER_ID="prometheus"; \
while [[ "$(docker inspect -f '{{.State.Health.Status}}' "${CONTAINER_ID}")" != "healthy" ]]; \
do echo "${CONTAINER_ID}" is starting; sleep 1; done; \
echo "${CONTAINER_ID}" is now healthy!
Installation of Aperture Controller
Create a file named
controller.yamlwith below content for passing the configuration to the Aperture Controller:etcd:
endpoints:
- http://etcd:2379
prometheus:
address: "http://prometheus:9090"
log:
level: info
pretty_console: true
non_blocking: falseAll the configuration parameters for the Aperture Controller are available here.
Run the below command to start the Aperture Controller container:
docker run -d \
-p 8080:8080 \
--name aperture-controller \
--network aperture \
-v "$(pwd)"/controller.yaml:/etc/aperture/aperture-controller/config/aperture-controller.yaml:ro \
docker.io/fluxninja/aperture-controller:2.32.2
Installation using docker compose
Install docker-compose.
Create
prometheus.yamlandcontroller.yamlfiles with the same content as mentioned in the above steps.Create a file named
docker-compose.yamlwith below content:docker-compose.yaml
Run the below command to start the etcd, Prometheus and Aperture Controller containers:
docker compose up -d
Verifying the Installation
Run the below command to verify that the Aperture Controller container is in the
healthystate:docker run -it --rm \
--network aperture curlimages/curl \
sh -c \
'while [[ \"$(curl -s -o /dev/null -w %{http_code} aperture-controller:8080/v1/status/system/readiness)\" != \"200\" ]]; \
do echo "aperture-controller is starting"; sleep 1; done && \
echo "aperture-controller is now healty!"'
Installation of Aperture Agent
Once the Aperture Controller is installed, you can create a configuration file for the Aperture Agent and install it using the Aperture Agent installation guide.
Uninstall
If the Aperture Controller installation is done using
docker compose, run the below command to stop and remove the Aperture Controller, Prometheus and etcd containers:docker compose downRun the below command to stop and remove the Aperture Controller container:
docker rm -f aperture-controllerRun the below command to stop and remove the Prometheus container:
docker rm -f prometheusRun the below command to stop and remove the etcd container:
docker rm -f etcdRun the below command to remove the Docker network:
docker network rm aperture