Create an 'LMA-Infra' Composite

This composite deploys the logging and prometheus operators
such that they are ready to collect logs and metrics from a k8s cluster.
The operators can be extended by introducing custom resources, allowing
any application running in the cluster to use these services

Note: Due to [0], this composite cannot be successfully deployed in the
initinfra-target phase, so a separate 'lma-infra' phase is introduced

[0] https://github.com/airshipit/airshipctl/issues/474

Change-Id: Ia20cc7bdaeb2b2f52ba4bcdc8e55a202ef4b0110
changes/96/769096/42
Steven Fitzpatrick 2 years ago
parent 1144e50bae
commit 772b18afd9
  1. 5
      manifests/composite/lma-infra/README.md
  2. 11
      manifests/composite/lma-infra/kustomization.yaml
  3. 4
      manifests/composite/lma-infra/namespace.yaml
  4. 42
      manifests/composite/lma-infra/patches/kube-prometheus-stack.yaml
  5. 15
      manifests/composite/lma-infra/patches/logging-operator.yaml
  6. 47
      manifests/composite/lma-infra/patches/logging-spec.yaml
  7. 19
      manifests/function/logging-operator/helmrelease-logging.yaml
  8. 1
      manifests/function/logging-operator/helmrelease-operator.yaml
  9. 3
      manifests/function/logging-operator/kustomization.yaml
  10. 2
      manifests/site/test-site/target/lma-infra/kustomization.yaml
  11. 1
      manifests/type/airship-core/phases/kustomization.yaml
  12. 11
      manifests/type/airship-core/phases/lma-infra-target.yaml
  13. 1
      manifests/type/airship-core/target/initinfra/kustomization.yaml
  14. 2
      tools/deployment/31_deploy_initinfra_target_node.sh

@ -0,0 +1,5 @@
# LMA Infra
This composite deploys the logging-operator and kube-prometheus-stack,
configured to provide basic LMA facilities to a cluster. Application Logs and
metrics can be collected by supplying the operators CRs.

@ -0,0 +1,11 @@
resources:
- namespace.yaml
- ../../function/logging-operator
- ../../function/kube-prometheus-stack
namespace: lma-infra
patches:
- path: patches/kube-prometheus-stack.yaml
- path: patches/logging-operator.yaml
- path: patches/logging-spec.yaml

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: lma-infra

@ -0,0 +1,42 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: kube-prometheus-stack
spec:
releaseName: lma-infra-monitoring
values:
fullnameOverride: lma-infra-monitoring
grafana:
enabled: false
prometheus:
prometheusSpec:
serviceMonitorSelectorNilUsesHelmValues: false
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
prometheusOperator:
admissionWebhooks:
patch:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
alertmanager:
alertmanagerSpec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
prometheus-node-exporter:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
kube-state-metrics:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule

@ -0,0 +1,15 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: logging-operator
spec:
dependsOn:
- name: kube-prometheus-stack
values:
fullnameOverride: lma-infra-logging-operator
monitoring:
serviceMonitor:
enabled: true
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule

@ -0,0 +1,47 @@
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: logging-operator-logging
spec:
releaseName: lma-infra-logging
dependsOn:
- name: logging-operator
# Reference values at
# https://github.com/banzaicloud/logging-operator/blob/master/charts/logging-operator-logging/values.yaml
values:
controlNamespace: lma-infra
loggingRef: lma-infra-logging
nameOverride: lma-infra-logging
fullnameOverride: lma-infra-logging
fluentbit:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
metrics:
serviceMonitor: true
fluentd:
fluentLogDestination: stdout
disablePvc: true
metrics:
serviceMonitor: true
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
clusterFlows:
- name: all-pods
spec:
globalOutputRefs:
- elasticsearch
clusterOutputs:
- name: elasticsearch
spec:
elasticsearch:
host: elasticsearch-elasticsearch-cluster.default.svc.cluster.local
port: 9200
scheme: https
ssl_verify: false
ssl_version: TLSv1_2
buffer:
timekey: 1m
timekey_wait: 30s
timekey_use_utc: true

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

@ -2,7 +2,6 @@ apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
kind: HelmRelease
metadata:
name: logging-operator
namespace: logging
spec:
releaseName: logging-operator
interval: 5m

@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helmrepository.yaml
- helmrelease.yaml
- helmrelease-operator.yaml
- helmrelease-logging.yaml
namespace: logging

@ -0,0 +1,2 @@
resources:
- ../../../../composite/lma-infra

@ -1,2 +1,3 @@
resources:
- ../../../../../airshipctl/manifests/phases/
- lma-infra-target.yaml

@ -0,0 +1,11 @@
apiVersion: airshipit.org/v1alpha1
kind: Phase
metadata:
name: lma-infra-target
clusterName: target-cluster
config:
executorRef:
apiVersion: airshipit.org/v1alpha1
kind: KubernetesApply
name: kubernetes-apply
documentEntryPoint: target/lma-infra

@ -3,5 +3,6 @@ resources:
- ../../../../../../airshipctl/manifests/function/hwcc
- ../../../../function/clusterctl
- ../../../../../../airshipctl/manifests/composite/flux-helm/
commonLabels:
airshipit.org/stage: initinfra

@ -28,3 +28,5 @@ kubectl \
label node $NODENAME node-type=controlplane
./tools/deployment/31_deploy_initinfra_target_node.sh
airshipctl phase run lma-infra-target --debug

Loading…
Cancel
Save