Treasuremap Storage for LMA composite

This change introduces a minio function, and deploys it as part of
the lma-stack. It has no persistence for now.

Custom resources are added to lma-configs
  - logging flows to collect logs from minio (pod logs)
  - logging output to send logs to minio
  - monitoring servicemonitor to collect logs from minio
  - monitoring thanos objectstore & storeendpoint for minio

Change-Id: Ic116f499e55a748a033c1b28534c3a38a5cb8788
This commit is contained in:
Steven Fitzpatrick 2021-01-14 04:54:58 +00:00
parent 7aef5fe7a7
commit 5b05aa77ab
23 changed files with 174 additions and 3 deletions

View File

@ -20,6 +20,9 @@ spec:
thanos:
image: quay.io/thanos/thanos:v0.17.2
version: v0.17.2
objectStorageConfig:
name: lma-infra-object-store
key: thanos-config.yaml
prometheusOperator:
admissionWebhooks:

View File

@ -0,0 +1,2 @@
resources:
- minio.yaml

View File

@ -0,0 +1,12 @@
apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
name: lma-infra-minio
spec:
loggingRef: lma-infra-logging
match:
- select:
labels:
app: minio
localOutputRefs:
- lma-infra-minio

View File

@ -1 +1,3 @@
resources: []
resources:
- flows
- outputs

View File

@ -0,0 +1,2 @@
resources:
- minio.yaml

View File

@ -0,0 +1,25 @@
apiVersion: logging.banzaicloud.io/v1beta1
kind: Output
metadata:
name: lma-infra-minio
spec:
loggingRef: lma-infra-logging
s3:
aws_key_id:
valueFrom:
secretKeyRef:
key: fluentd-accesskey
name: lma-infra-object-store
aws_sec_key:
valueFrom:
secretKeyRef:
key: fluentd-secretkey
name: lma-infra-object-store
buffer:
timekey: 10s
timekey_use_utc: true
timekey_wait: 0s
force_path_style: "true"
path: ${tag}/%Y/%m/%d/
s3_bucket: logs
s3_endpoint: http://minio.lma-infra.svc.cluster.local:9000

View File

@ -1,2 +1,3 @@
resources:
- prometheus
- thanos

View File

@ -0,0 +1,2 @@
resources:
- servicemonitors/lma-infra-minio.yaml

View File

@ -0,0 +1,13 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: lma-infra-minio
labels:
app: minio
spec:
selector:
matchLabels:
app: minio
endpoints:
- port: metrics
path: /minio/prometheus/metrics

View File

@ -1,3 +1,4 @@
resources:
- lma-infra-thanos.yaml
- store-endpoints/lma-infra-prometheus.yaml
- storeendpoints
- objectstores

View File

@ -0,0 +1,2 @@
resources:
- lma-infra-thanos-minio.yaml

View File

@ -0,0 +1,12 @@
apiVersion: monitoring.banzaicloud.io/v1alpha1
kind: ObjectStore
metadata:
name: lma-infra-thanos-minio
spec:
config:
mountFrom:
secretKeyRef:
name: lma-infra-object-store
key: thanos-config.yaml
bucketWeb: {}
compactor: {}

View File

@ -0,0 +1,3 @@
resources:
- lma-infra-prometheus.yaml
- lma-infra-minio.yaml

View File

@ -0,0 +1,11 @@
apiVersion: monitoring.banzaicloud.io/v1alpha1
kind: StoreEndpoint
metadata:
name: lma-infra-minio
spec:
thanos: lma-infra-thanos
config:
mountFrom:
secretKeyRef:
name: lma-infra-object-store
key: thanos-config.yaml

View File

@ -0,0 +1,20 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: minio
spec:
releaseName: minio
interval: 5m
chart:
spec:
chart: minio
sourceRef:
kind: HelmRepository
name: minio
version: 8.0.9
interval: 1m
wait: false
timeout: 5m
# Reference values at
# https://github.com/minio/charts/blob/master/minio/values.yaml
values: {}

View File

@ -0,0 +1,7 @@
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: minio
spec:
url: https://helm.min.io/
interval: 10m

View File

@ -0,0 +1,3 @@
resources:
- helmrelease.yaml
- helmrepository.yaml

View File

@ -1,2 +1,5 @@
resources:
- ../../../../composite/lma-infra
- lma-infra-object-store.yaml
namespace: lma-infra

View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Secret
metadata:
name: lma-infra-object-store
type: Opaque
stringData:
fluentd-accesskey: admin
fluentd-secretkey: changeme
thanos-config.yaml: |
type: s3
config:
insecure: true
endpoint: minio.lma-infra.svc.cluster.local:9000
bucket: metrics
region: lma-infra
access_key: admin
secret_key: changeme

View File

@ -1,4 +1,9 @@
resources:
- ../../../../composite/monitoring-stack
- ../../../../function/minio
- minio-admin-secret.yaml
namespace: lma-infra
namespace: lma-infra
patches:
- path: patches/minio.yaml

View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: minio-admin-secret
type: Opaque
stringData:
accesskey: admin
secretkey: changeme

View File

@ -0,0 +1,17 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: minio
spec:
values:
replicas: 1
persistence:
enabled: false
existingSecret: minio-admin-secret
buckets:
- name: logs
policy: none
purge: false
- name: metrics
policy: none
purge: false