We use seq to view our logs. The hosting is done in Kubernetes. For management we tried jobs with the seqcli container. This works great if you mount the SeqCli.json config file.
First we tried the environment variables as described in the documentation. (https://docs.datalust.co/docs/command-line-client) We couldn’t get it to work. Then we found the SeqCli.json config file – now we have all rainbows and unicorns.
The job below sets the license for seq. When we get the new license, we create a new job to apply it.
apiVersion: batch/v1
kind: Job
metadata:
name: licensejob2024
spec:
template:
spec:
containers:
- name: seqcli
image: datalust/seqcli:latest
args:
- "license"
- "apply"
- "--certificate=/mnt/license/seq_license_2024.txt"
volumeMounts:
- name: seqcli-json
mountPath: /root/SeqCli.json
subPath: SeqCli.json
- name: license
mountPath: /mnt/license
volumes:
- name: seqcli-json
secret:
secretName: seqcli
- name: license
configMap:
name: seqlicense
restartPolicy: Never
backoffLimit: 4
The SeqCli.json is in a secret as it contains the api key. The data looks like this.
{
"connection": {
"serverUrl": "http://seq.logging.svc.cluster.local",
"apiKey": "Secret-Api-Key"
},
"output": {
"disableColor": false,
"forceColor": false
},
"profiles": {}
}
π¦ π