$ git clone git@github.com:dadrus/heimdall.git
Heimdall
Heimdall is shipped in multiple formats and architectures to suit a variety of deployment patterns. Available installation options are:
You can always build a copy of heimdall by following the following instructions for your OS/environment.
Retrieve the latest copy of heimdall source code by cloning the git repository
$ git clone git@github.com:dadrus/heimdall.git
Build using a single line with go build
$ CGO_ENABLED=0 go build -trimpath -ldflags="-buildid= -w -s -X heimdall/cmd.Version=my-custom-build"
The flags are set by intention. Using -trimpath
and -buildid=
as part of the -ldflags
argument ensures the build is reproducible (See also Reproducible Builds). Other flags remove unused symbols and debug information.
Prebuild binaries are available with every released version on GitHub, as well as for every merged PR to the main branch. The version of the latter is set to the git SHA1. Supported operating systems/architectures are:
linux/amd64
linux/arm64
linux/arm
- which is armv7
architecture
darwin/amd64
darwin/arm64
, and
windows/amd64
For Linux and Darwin the binaries are archived with tar.gz and for Windows with zip.
Retrieve the desired released version of heimdall binary for your operating system/architecture
ARCH=[your arch]
OS=[your os]
VERSION=[desired version]
curl -L https://github.com/dadrus/heimdall/releases/download/${VERSION}/heimdall-${VERSION}-${OS}-${ARCH}.tar.gz \
| tar -z -x
Heimdall utilizes a minimal docker multi-arch image which you can find on DockerHub. As with Binary releases, heimdall can be pulled in several flavors. These are however currently limited to the Linux OS. Supported architectures are:
amd64
arm64
armv7
All docker images are rootless - so heimdall will always run as a non-root user. Since Heimdall does not have any dependencies, the images contain only the binary of Heimdall and the settings related to the OS user and group permissions, heimdall is running with.
Following tag patterns exist:
x.y.z[-<prerelease-identifier>]
- will pull a specific tagged release.
$ docker pull dadrus/heimdall:0.4.1-alpha && docker run dadrus/heimdall:0.4.1-alpha --version
heimdall version v0.4.1-alpha
latest
- will pull the most recent tagged release.
$ docker pull dadrus/heimdall:latest && docker run dadrus/heimdall:latest --version
heimdall version v0.4.1-alpha
Heimdall can be installed via a Helm chart with a few simple steps, depending on if you are deploying for the first time, or upgrading from an existing installation.
A Kubernetes version >= 1.19 or >= 1.23 if you would like to use HPA
Helm 3.0+
The heimdall Helm Chart is published at https://dadrus.github.io/heimdall/charts
. You can add this repo with the following command:
$ helm repo add dadrus https://dadrus.github.io/heimdall/charts
$ helm repo update
This chart expects a heimdall configuration file with authentication, authorization and so on mechanisms, required for your particular setup, which can be passed by using the -f heimdall.yaml
flag during the installation.
If you need to override the name of the heimdall resources such as the deployment or services, the traditional nameOverride
and fullnameOverride
properties are supported.
By default, heimdall requires custom resource definitions (CRDs) installed in the cluster. The Helm client will install it for you.
To install the chart with the release name my-release
(my-release
is the name that you choose) and configure heimdall to operate in decision mode:
$ helm install my-release -f heimdall.yaml dadrus/heimdall
If you need proxy mode, install it with:
$ helm install my-release -f heimdall.yaml --set operationMode=proxy dadrus/heimdall
For more advanced configuration and details about helm values, please see the helm chart.
After having installed heimdall, you have to integrate it with your ingress controller. For decision mode that means setting corresponding annotations on Ingress resources to let the traffic first be verified by heimdall before it is forwarded to the upstream services by the Ingress Controller.
Since heimdall exposes a comprehensive set of Prometheus style metrics on the Metrics endpoint, you can, assuming you are running a Prometheus Operator in your cluster, create the following PodMonitor
resource to enable metrics collection.
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: heimdall-pod-monitor
labels:
release: prometheus
app.kubernetes.io/instance: my-release
app.kubernetes.io/name: heimdall
app.kubernetes.io/part-of: heimdall
spec:
selector:
matchLabels:
app.kubernetes.io/instance: my-release
app.kubernetes.io/name: heimdall
podMetricsEndpoints:
- path: /metrics
port: http-metrics
scheme: http
interval: 30s
jobLabel: heimdall-pod-monitor
namespaceSelector:
matchNames:
- default
The definition of the PodMonitor
above assumes, you’ve installed heimdall in the default namespace as shown in the Installing the Chart section. If this is not the case, you need to adjust the metadata
property by adding the corresponding namespace
information, as well as the namespaceSelector
.
Last updated on Jan 2, 2023