Install Vigie
Vigie is one static binary, vigie, built without cgo. It reads one YAML file and listens on one port, 8080 by
default. This page installs it in one of four ways:
- From a release, the binary alone.
- As a systemd service, with the unit of the repository.
- In a container, with the image the repository builds.
- In a Kubernetes cluster, with a Deployment and the permissions of the
kubernetessourceWhere a service reads its endpoints, one ofdns,file,urlorkubernetes. See Services and sources..
Whichever way you pick, check the configuration with vigie check-config before you start the server, because vigie serve ignores the keys it doesn’t know.
Install from a release
Section titled “Install from a release”Each tag v* of the repository publishes archives on the releases page,
for Linux and macOS on amd64 and arm64, with Windows zips next to them. checksums.txt holds the SHA-256 of every
archive.
-
Download the archive of your system and its checksums. Replace
<version>with the version without itsv, such as0.1.0.Terminal window VERSION=<version>curl -LO "https://github.com/seagalia/vigie/releases/download/v${VERSION}/vigie_${VERSION}_linux_amd64.tar.gz"curl -LO "https://github.com/seagalia/vigie/releases/download/v${VERSION}/checksums.txt" -
Check the archive.
Terminal window sha256sum --check --ignore-missing checksums.txt -
Unpack it and put the binary on your
PATH. The archive holds a directory named like the archive.Terminal window tar -xzf "vigie_${VERSION}_linux_amd64.tar.gz"sudo install "vigie_${VERSION}_linux_amd64/vigie" /usr/local/bin/vigievigie version
To build from source instead, run CGO_ENABLED=0 go build . in a clone of the repository, as in the
quickstart.
Run as a systemd service
Section titled “Run as a systemd service”The repository ships a unit in assets/systemd/vigie.service. It runs /usr/local/bin/vigie serve with
/etc/vigie/config.yml, under a dynamic user, and maps systemctl reload to SIGHUP.
-
Install the binary in
/usr/local/bin/vigie, as in Install from a release. -
Write the configuration in
/etc/vigie/config.yml, starting fromassets/config.ymlof the repository, then check it.Terminal window sudo mkdir -p /etc/vigiesudo cp assets/config.yml /etc/vigie/config.ymlvigie check-config -c /etc/vigie/config.ymlThe dynamic user of the unit can only read files that every user can read, so keep the configuration and the endpointOne IP address and port that a service gives, with its load balancing weight. See HTTP API. files readable by all, or give them to a group the unit joins with
SupplementaryGroups=. -
Install and start the unit.
Terminal window sudo cp assets/systemd/vigie.service /etc/systemd/system/sudo systemctl daemon-reloadsudo systemctl enable --now vigie -
Check that it answers.
Terminal window curl -s http://localhost:8080/healthz
After a change to the services of the file, run sudo systemctl reload vigie. A change to server or log needs sudo systemctl restart vigie. Reload the services gives the details.
Run in a container
Section titled “Run in a container”The Dockerfile of the repository builds an image with the binary alone, on
gcr.io/distroless/static-debian13:nonroot. The image runs vigie serve -c /etc/vigie/config.yml and exposes port
8080. No image is published yet, so you build it and push it to your own registry.
-
Build the image.
make dockertags itvigie:devand stamps the binary with the version of the checkout.Terminal window make docker -
Run it with your configuration mounted on
/etc/vigie/config.yml.Terminal window docker run --rm -p 8080:8080 -v "$PWD/config.yml:/etc/vigie/config.yml:ro" vigie:devMount the endpoint files of the
fileservices too, at the paths the configuration gives. The configuration must listen on all addresses, such as:8080(the default), for the published port to reach it.
The image keeps the CA certificates of distroless, which the url sources need to check an HTTPS server.
Run in a Kubernetes cluster
Section titled “Run in a Kubernetes cluster”In a cluster, Vigie reads the configuration from a ConfigMap and, for its kubernetes sources, uses the service account
of its pod. The manifests below run it in the namespace vigie and let it read the Service web of the namespace
shop. Replace registry.example.com/vigie:0.1.0 with the image you pushed.
apiVersion: v1kind: Namespacemetadata: name: vigie---apiVersion: v1kind: ServiceAccountmetadata: name: vigie namespace: vigie---apiVersion: v1kind: ConfigMapmetadata: name: vigie namespace: vigiedata: config.yml: | server: listen_addr: :8080 log: in_json: true # nothing sends SIGHUP to the pods, a restart applies a new ConfigMap disable_reload_by_request: true services: - name: web default_port: 8080 kubernetes: namespace: shop service: web port_name: http---apiVersion: apps/v1kind: Deploymentmetadata: name: vigie namespace: vigiespec: replicas: 2 selector: matchLabels: app: vigie template: metadata: labels: app: vigie spec: serviceAccountName: vigie containers: - name: vigie image: registry.example.com/vigie:0.1.0 ports: - name: http containerPort: 8080 readinessProbe: httpGet: path: /healthz port: http livenessProbe: httpGet: path: /healthz port: http volumeMounts: - name: config mountPath: /etc/vigie readOnly: true volumes: - name: config configMap: name: vigie---apiVersion: v1kind: Servicemetadata: name: vigie namespace: vigiespec: selector: app: vigie ports: - name: http port: 8080 targetPort: httpThen give the service account the right to read the Services it serves, with a Role and a RoleBinding in each namespace it reads:
apiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata: name: vigie namespace: shoprules: - apiGroups: [""] resources: [services] verbs: [get] - apiGroups: [discovery.k8s.io] resources: [endpointslices] verbs: [list]---apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata: name: vigie namespace: shoproleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: vigiesubjects: - kind: ServiceAccount name: vigie namespace: vigiekubectl apply -f vigie.yml -f vigie-rbac.ymlkubectl -n vigie rollout status deployment/vigieAfter a change to the ConfigMap, run kubectl -n vigie rollout restart deployment/vigie. Read Kubernetes
Services covers the kubernetes source in depth.
Next steps
Section titled “Next steps”- Configuration lists every key of the file.
- Serve HTTPS when clients reach Vigie over a network you don’t trust.
- Troubleshooting lists the errors you can meet and what they mean.