From 635820b46c0f932df35327c6d0efeb30797edf6a Mon Sep 17 00:00:00 2001 From: bnshr Date: Mon, 27 Nov 2023 15:27:05 +0100 Subject: [PATCH] Modify log forwarder --- .../base/clusterlogforwarders/instance.yaml | 8 +++- ...-lokistack-gateway-bearer-token_patch.yaml | 10 +++++ .../overlays/nerc-ocp-obs/kustomization.yaml | 8 ++++ .../clusterlogforwarders/instance_patch.yaml | 41 ------------------- .../overlays/nerc-ocp-prod/kustomization.yaml | 1 - 5 files changed, 24 insertions(+), 44 deletions(-) create mode 100644 logging/overlays/nerc-ocp-obs/externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml create mode 100644 logging/overlays/nerc-ocp-obs/kustomization.yaml delete mode 100644 logging/overlays/nerc-ocp-prod/clusterlogforwarders/instance_patch.yaml diff --git a/logging/base/clusterlogforwarders/instance.yaml b/logging/base/clusterlogforwarders/instance.yaml index e584e8c7..40de04da 100644 --- a/logging/base/clusterlogforwarders/instance.yaml +++ b/logging/base/clusterlogforwarders/instance.yaml @@ -4,11 +4,15 @@ metadata: name: instance namespace: openshift-logging spec: + outputs: + - name: remoteloki + type: loki + url: https://logging-loki-openshift-logging.apps.nerc-ocp-obs.rc.fas.harvard.edu/api/logs/v1/application pipelines: - - name: all-to-default + - name: all-to-loki inputRefs: - infrastructure - application - audit outputRefs: - - default + - remoteloki diff --git a/logging/overlays/nerc-ocp-obs/externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml b/logging/overlays/nerc-ocp-obs/externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml new file mode 100644 index 00000000..bcd53fd3 --- /dev/null +++ b/logging/overlays/nerc-ocp-obs/externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml @@ -0,0 +1,10 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: openshift-logging-lokistack-gateway-bearer-token + namespace: openshift-logging +spec: + dataFrom: + - extract: + # Command to extract the JSON pull secret: oc extract secret/pull-secret -n openshift-config --to=- + key: nerc/nerc-ocp-obs/lokistack-gateway-bearer-token diff --git a/logging/overlays/nerc-ocp-obs/kustomization.yaml b/logging/overlays/nerc-ocp-obs/kustomization.yaml new file mode 100644 index 00000000..b42043c1 --- /dev/null +++ b/logging/overlays/nerc-ocp-obs/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../../base + +patches: + - path: externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml diff --git a/logging/overlays/nerc-ocp-prod/clusterlogforwarders/instance_patch.yaml b/logging/overlays/nerc-ocp-prod/clusterlogforwarders/instance_patch.yaml deleted file mode 100644 index 28edcae7..00000000 --- a/logging/overlays/nerc-ocp-prod/clusterlogforwarders/instance_patch.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: logging.openshift.io/v1 -kind: ClusterLogForwarder -metadata: - name: instance - namespace: openshift-logging -spec: - outputs: - - name: loki-app - type: loki - url: https://logging-loki-openshift-logging.apps.nerc-ocp-infra.rc.fas.harvard.edu/api/logs/v1/application - secret: - name: lokistack-gateway-bearer-token - loki: - - name: loki-infra - type: loki - url: https://logging-loki-openshift-logging.apps.nerc-ocp-infra.rc.fas.harvard.edu/api/logs/v1/infrastructure - secret: - name: lokistack-gateway-bearer-token - loki: - - name: loki-audit - type: loki - url: https://logging-loki-openshift-logging.apps.nerc-ocp-infra.rc.fas.harvard.edu/api/logs/v1/audit - secret: - name: lokistack-gateway-bearer-token - loki: - pipelines: - - name: send-app-logs - inputRefs: - - application - outputRefs: - - loki-app - - name: send-infra-logs - inputRefs: - - infrastructure - outputRefs: - - loki-infra - - name: send-audit-logs - inputRefs: - - audit - outputRefs: - - loki-audit diff --git a/logging/overlays/nerc-ocp-prod/kustomization.yaml b/logging/overlays/nerc-ocp-prod/kustomization.yaml index 42d630b8..345bbc5f 100644 --- a/logging/overlays/nerc-ocp-prod/kustomization.yaml +++ b/logging/overlays/nerc-ocp-prod/kustomization.yaml @@ -6,4 +6,3 @@ resources: patchesStrategicMerge: - externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml - - clusterlogforwarders/instance_patch.yaml