Skip to content

Commit d1b4648

Browse files
authored
SYS-672 retire logspout, add fluent-bit (#258)
1 parent 1f96a34 commit d1b4648

15 files changed

Lines changed: 137 additions & 196 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ The cluster-deployment tools here include helm charts and ansible playbooks to s
6464
| data-sync | [![](https://img.shields.io/docker/v/instantlinux/data-sync?sort=date)](https://hub.docker.com/r/instantlinux/data-sync "Version badge") | poor-man's SAN for persistent storage |
6565
| ddclient | [![](https://img.shields.io/docker/v/instantlinux/ddclient?sort=date)](https://hub.docker.com/r/instantlinux/ddclient "Version badge") | Dynamic DNS client |
6666
| ez-ipupdate | [![](https://img.shields.io/docker/v/instantlinux/ez-ipupdate?sort=date)](https://hub.docker.com/r/instantlinux/ez-ipupdate "Version badge") | Dynamic DNS client |
67+
| fluent-bit | ** | central logging for Kubernetes |
6768
| haproxy-keepalived | [![](https://img.shields.io/docker/v/instantlinux/haproxy-keepalived?sort=date)](https://hub.docker.com/r/instantlinux/haproxy-keepalived "Version badge") | load balancer |
6869
| grafana | ** | monitoring dashboard with prometheus-based alerting |
6970
| guacamole | ** | authenticated remote-desktop server |
70-
| logspout | ** | central logging for Docker |
7171
| mysqldump | [![](https://img.shields.io/docker/v/instantlinux/mysqldump?sort=date)](https://hub.docker.com/r/instantlinux/mysqldump "Version badge") | per-database alternative to xtrabackup |
7272
| nagios | [![](https://img.shields.io/docker/v/instantlinux/nagios?sort=date)](https://hub.docker.com/r/instantlinux/nagios "Version badge") | Nagios Core v4 for monitoring |
7373
| nagiosql | [![](https://img.shields.io/docker/v/instantlinux/nagiosql?sort=date)](https://hub.docker.com/r/instantlinux/nagiosql "Version badge") | NagiosQL for configuring Nagios Core v4 |
@@ -121,4 +121,4 @@ Thank you to the following contributors!
121121
* [Alberto Galera](https://github.com/agalera)
122122
* [Andrew Eacott](https://github.com/andreweacott)
123123

124-
Contents created 2017-25 under [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) by Rich Braun.
124+
Contents created 2017-26 under [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0) by Rich Braun.

ansible/ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ managed_str = This file is managed by Ansible.%n
55
user: {uid}
66
host: {host}
77
callback_whitelist = profile_tasks
8+
interpreter_python = /usr/bin/python3
89
inventory = ./hosts
910
remote_user = ubuntu
1011

ansible/roles/docker_node/defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ docker_defaults:
55
apt_repo:
66
key: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
77
package_name: docker-ce
8-
package_ver: 5:28.4.0-1~ubuntu.24.04~noble
8+
package_ver: 5:29.2.0-1~ubuntu.24.04~noble
99
repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
1010
url: https://download.docker.com/linux/ubuntu/gpg
1111
certs:
@@ -29,6 +29,7 @@ docker_defaults:
2929
log-opts:
3030
max-size: 50m
3131
max-file: "3"
32+
min-api-version: "1.43"
3233
storage-driver: overlay2
3334
# storage-opts:
3435
# - dm.thinpooldev=/dev/mapper/{{ thinpool_vg_alt }}-thinpool

ansible/roles/kubernetes/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ k8s_defaults:
3232
name: kubelet
3333
state: restarted
3434
service_network: 10.96.0.0/12
35-
version: 1.34.1
35+
version: 1.34.3
3636
coredns_version: v1.11.3
3737
cni_version: 1.7.1
3838
k8s_override: {}

ansible/roles/mythfrontend/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- include_tasks: "{{ ansible_os_family | lower }}/ir-keytable.yml"
1313

1414
- include_tasks: autosuspend.yml
15-
when: suspend
15+
when: suspend | length > 0
1616

1717
- include_tasks: drivers/{{ display_driver.type }}.yml
1818

ansible/roles/ntp/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22

33
ntp_defaults:
4+
driftfile: /var/lib/ntpsec/ntp.drift
5+
leapfile: /usr/share/zoneinfo/leap-seconds.list
46
query_ok:
57
- localhost
68
- ::1

ansible/roles/ntp/templates/ntp.conf.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{ ansible_managed | comment }}
2-
driftfile /var/lib/ntp/ntp.drift
3-
2+
driftfile {{ ntp.driftfile }}
3+
leapfile {{ ntp.leapfile }}
44
{% if 'symmetric_key' in ntp %}
55
keys /etc/ntp.keys # path for keys file
66
trustedkey 1 # define trusted keys

images/dovecot/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,25 @@ Configuration is defined as files in a volume mounted as
2525
./mkcert.sh
2626
```
2727

28-
For settings, see etc-example directory and [helm]((https://github.com/instantlinux/docker-tools/tree/main/images/dovecot/helm) / kubernetes.yaml / docker-compose.yml. The [k8s/Makefile.vars](https://github.com/instantlinux/docker-tools/blob/main/k8s/Makefile.vars) file defines default values.
28+
For settings, see etc-example directory and [helm](https://github.com/instantlinux/docker-tools/tree/main/images/dovecot/helm) / docker-compose.yml. The [k8s/Makefile.vars](https://github.com/instantlinux/docker-tools/blob/main/k8s/Makefile.vars) file defines default values.
2929

3030
Also configure postfix as described in the postfix image.
3131

3232
This repo has complete instructions for
33-
[building a kubernetes cluster](https://github.com/instantlinux/docker-tools/blob/main/k8s/README.md) where you can launch with [helm](https://github.com/instantlinux/docker-tools/tree/main/images/dovecot/helm) or [kubernetes.yaml](https://github.com/instantlinux/docker-tools/blob/main/images/dovecot/kubernetes.yaml) using _make_ and customizing [Makefile.vars](https://github.com/instantlinux/docker-tools/blob/main/k8s/Makefile.vars) after cloning this repo:
33+
[building a kubernetes cluster](https://github.com/instantlinux/docker-tools/blob/main/k8s/README.md) where you can launch with [helm](https://github.com/instantlinux/docker-tools/tree/main/images/dovecot/helm) using _make_ after customizing overrides of [values.yaml](https://github.com/instantlinux/docker-tools/blob/main/images/dovecot/helm/values.yaml) after cloning this repo:
3434
~~~
3535
git clone https://github.com/instantlinux/docker-tools.git
3636
cd docker-tools/k8s
3737
make dovecot
3838
~~~
3939

40-
See the Makefile and Makefile.vars files under k8s directory for default values referenced within kubernetes.yaml.
41-
4240
To provide high availability across the cluster, the helm chart here includes an optional data-sync service to keep the inbox, mail and spool directories synchronized across 2 or more worker nodes. Minor data loss can occur when the service shifts from one worker to another, so this feature isn't recommended for large production deployments (when running on a cloud provider, simply use their block storage capabilities). That said, unison-based data-sync service has been rock-solid on a bare-metal cluster for years.
4341

4442
Auth is the most challenging aspect of implementing dovecot. Use the following command from with the container to verify user authentication:
4543
```
4644
doveadm auth login <user>
4745
```
48-
If using openldap, turn on log setting `BER` to view raw packet contents as you troubleshoot login from dovecot.
46+
If using openldap, turn on openldap's log setting `BER` to view raw packet contents as you troubleshoot login from dovecot.
4947

5048
### Variables
5149

@@ -72,7 +70,7 @@ Need more configurability? Edit the ConfigMap defined in the helm chart.
7270

7371
| Helm var | 2.3 | 2.4 | Notes |
7472
| -------- | --- | --- | ----- |
75-
| uris | hosts | ldap_uris | <host> becomes ldap://<host>:389 |
73+
| uris | hosts | ldap_uris | host becomes ldap://host:389 |
7674
| | ldap_version | (unchanged) | |
7775
| base | base | ldap_base | |
7876
| bind | auth_bind | ldap_bind | |

k8s/Makefile

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ VOLUMES_YAML = $(basename $(wildcard volumes/*.yaml))
103103
install: install/admin-user cluster_network \
104104
install/local-storage storage_localdefault imports \
105105
install_imports namespace_config install/prometheus-rbac \
106-
install/k8s-backup install/logspout remote_volumes \
106+
install/k8s-backup fluent-bit remote_volumes \
107107
sops data-sync-ssh persistent secrets install/ingress-nginx \
108108
install/cert-manager
109109

@@ -166,17 +166,6 @@ storage_localdefault:
166166
kubectl $(ADMIN_CTX) patch storageclass local-storage -p \
167167
'{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
168168

169-
##########
170-
# etcd
171-
##########
172-
imports/etcd-token:
173-
@-kubectl delete secret $(@F)
174-
(cd imports && \
175-
basename \
176-
`curl -s 'https://discovery.etcd.io/new?size=$(ETCD_NUM_NODES)'` \
177-
> $(@F) && \
178-
kubectl create secret generic $(@F) --from-file $(@F))
179-
180169
##########
181170
# Helm
182171
##########
@@ -232,11 +221,14 @@ install_metrics: imports/kube-state-metrics
232221
imports/traefik-prom.yaml:
233222
curl -sLo $@ https://raw.githubusercontent.com/mateobur/prometheus-monitoring-guide/master/traefik-prom.yaml
234223

235-
# As of Jan-2019, the helm chart for etcd doesn't reliably construct multi-node
236-
# cluster, just use 'make etcd' rather than 'make etcd_chart'
237-
etcd_chart:
238-
helm install --name etcd --namespace $(K8S_NAMESPACE) \
239-
--kube-context=kubernetes-admin@$(CLUSTER) \
240-
bitnami/etcd --set auth.rbac.enabled=false
241-
sleep 30
242-
kubectl scale statefulset etcd-etcd --namespace=$(K8S_NAMESPACE) --replicas=3
224+
SPLUNK_OPT = $(if $(LOG_TO_SPLUNK), -f install/fluent-bit-splunk.yaml, )
225+
fluent-bit: install/namespace.yaml
226+
K8S_NAMESPACE=$(LOG_NAMESPACE) envsubst < $< | \
227+
kubectl apply --context=sudo -f -
228+
helm repo add fluent https://fluent.github.io/helm-charts
229+
helm repo update
230+
@$(eval OVERRIDE := $(shell [ -s ../admin/services/values/$@.yaml ] \
231+
&& echo "-f ../admin/services/values/$@.yaml"))
232+
envsubst < install/fluent-bit.yaml | \
233+
helm install -f - $(SPLUNK_OPT) $(OVERRIDE) \
234+
--kube-context=sudo --namespace=$(LOG_NAMESPACE) $@ fluent/fluent-bit

k8s/Makefile.vars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export LIMIT_CPU_DEFAULT ?= 500m
1818
export LIMIT_CPU_REQUEST ?= 50m
1919
export LIMIT_MEM_DEFAULT ?= 256Mi
2020
export LIMIT_MEM_REQUEST ?= 64Mi
21+
export LOG_NAMESPACE ?= logging
22+
export LOG_TO_SPLUNK ?=
2123
export MYTHTV_VOL_SIZE ?= 400Gi
2224
export NAMED_VOLUMES ?= share $(LOCAL_VOLUMES)
2325
export NFS_HOST ?= nfs.$(DOMAIN)
@@ -46,5 +48,3 @@ export PORT_DOVECOT_SMTP ?= 825
4648
export PORT_GIT_SSH ?= 8999
4749
export PORT_POSTFIX_INTERNAL ?= 3425
4850
export PORT_POSTFIX_EXTERNAL ?= 3525
49-
# Port configured in install/logspout.yaml
50-
export PORT_RSYSLOGD ?= 514

0 commit comments

Comments
 (0)