Skip to content

Commit

Permalink
Configure test cluster to use LOKI from obs cluster
Browse files Browse the repository at this point in the history
This PR configures the test cluster instead of prod cluster to verify
that the logging is forwarded to the LOKI deployed in the observability
(obs) cluster. The ArgoCD deploys LOKI app in the obs cluster.
  • Loading branch information
bnshr committed Jan 22, 2024
1 parent 75f3ac2 commit 03ad681
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:set textwidth=72

2 changes: 2 additions & 0 deletions file-28.11.2023.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Hello World!
Replication works!
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions logging/overlays/nerc-ocp-obs/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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-obs.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-obs.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-obs.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
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: openshift-logging-lokistack-gateway-bearer-token
namespace: openshift-logging
spec:
secretStoreRef:
kind: SecretStore
name: nerc-secret-store
dataFrom:
- extract:
# Command to extract the JSON pull secret: oc extract secret/pull-secret -n openshift-config --to=-
key: nerc/nerc-ocp-test/lokistack-gateway-bearer-token
9 changes: 9 additions & 0 deletions logging/overlays/nerc-ocp-test/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

patches:
- path: externalsecrets/openshift-logging-lokistack-gateway-bearer-token_patch.yaml
- path: clusterlogforwarders/instance_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: loki-thanos-object-storage
namespace: openshift-logging
spec:
dataFrom:
- extract:
key: nerc/nerc-ocp-obs/loki-thanos-object-storage
8 changes: 8 additions & 0 deletions loki/overlays/nerc-ocp-obs/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base

patches:
- path: externalsecrets/loki-thanos-object-storage_patch.yaml

0 comments on commit 03ad681

Please sign in to comment.