Skip to content

Commit 0a16647

Browse files
committed
add tier-2 veryfiy hash
Signed-off-by: MJarmo <michal.jarmolkiewicz@sap.com>
1 parent a2980b8 commit 0a16647

2 files changed

Lines changed: 50 additions & 10 deletions

File tree

showroom/kubectl/tier-1.yaml

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ data:
1414
client_auth:
1515
# TEST-ONLY: plaintext credentials in a ConfigMap are NOT production-ready.
1616
# For production use a Kubernetes Secret and/or external secret store, and rotate credentials.
17-
username: tier1-ingest
18-
password: tier1-ingest-secret
17+
username: "##########"
18+
password: "##########"
1919
2020
receivers:
2121
otlp:
@@ -26,6 +26,14 @@ data:
2626
endpoint: 0.0.0.0:4318
2727
2828
processors:
29+
certificatehash:
30+
hash_algorithm: SHA256
31+
sign_content: body
32+
k8s_secret:
33+
name: dice-java-openbao-tls
34+
namespace: tier-1
35+
cert_key: cert
36+
key_key: key
2937
batch:
3038
send_batch_size: 1024
3139
timeout: 5s
@@ -44,7 +52,7 @@ data:
4452
pipelines:
4553
logs:
4654
receivers: [otlp]
47-
processors: [batch]
55+
processors: [certificatehash, batch]
4856
exporters: [otlphttp, debug]
4957
metrics:
5058
receivers: [otlp]
@@ -81,14 +89,39 @@ roleRef:
8189
kind: Role
8290
name: dice-java-cert-sync
8391
---
92+
apiVersion: rbac.authorization.k8s.io/v1
93+
kind: Role
94+
metadata:
95+
name: otelcol-agent-secret-reader
96+
rules:
97+
- apiGroups: [""]
98+
resources: ["secrets"]
99+
resourceNames: ["dice-java-openbao-tls"]
100+
verbs: ["get"]
101+
---
102+
apiVersion: rbac.authorization.k8s.io/v1
103+
kind: RoleBinding
104+
metadata:
105+
name: otelcol-agent-secret-reader
106+
subjects:
107+
- kind: ServiceAccount
108+
name: otelcol-agent
109+
namespace: tier-2
110+
roleRef:
111+
apiGroup: rbac.authorization.k8s.io
112+
kind: Role
113+
name: otelcol-agent-secret-reader
114+
---
84115
apiVersion: apps/v1
85116
kind: Deployment
86117
metadata:
87118
name: dice-java
88119
labels:
89120
app: dice-java
90121
spec:
91-
replicas: 2
122+
replicas: 1
123+
strategy:
124+
type: Recreate
92125
selector:
93126
matchLabels:
94127
app: dice-java
@@ -121,7 +154,7 @@ spec:
121154
- name: OPENBAO_CERT_PATH
122155
value: "kv/data/secret"
123156
- name: OPENBAO_TOKEN
124-
value: "###"
157+
value: "##########"
125158
volumeMounts:
126159
- name: dice-java-certs
127160
mountPath: /etc/dice-java/certs
@@ -166,8 +199,8 @@ spec:
166199
memory: 128Mi
167200
cpu: 100m
168201
- name: otel-collector
169-
image: otel/opentelemetry-collector-contrib:latest
170-
imagePullPolicy: Always
202+
image: ghcr.io/apeirora/otelcol-contrib:signlogsinsideprocesor-0fbeec707ed4
203+
imagePullPolicy: IfNotPresent
171204
args:
172205
- "--config=/etc/otelcol-contrib/config.yaml"
173206
ports:

showroom/kubectl/tier-2.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data:
2323
# TEST-ONLY: plaintext htpasswd entries are NOT production-ready.
2424
# For production generate a bcrypt htpasswd line (e.g. `htpasswd -nbBC 10 USER PASS`)
2525
# and store it in a Kubernetes Secret (or external secret store).
26-
#####
26+
##########:##########
2727
basicauth/client:
2828
client_auth:
2929
username: ${env:OPENSEARCH_USERNAME}
@@ -42,6 +42,13 @@ data:
4242
authenticator: basicauth/server
4343
4444
processors:
45+
certificatelogverify:
46+
hash_algorithm: SHA256
47+
sign_content: body
48+
k8s_secret:
49+
name: dice-java-openbao-tls
50+
namespace: tier-1
51+
cert_key: cert
4552
batch:
4653
send_batch_size: 1024
4754
timeout: 5s
@@ -72,7 +79,7 @@ data:
7279
pipelines:
7380
logs:
7481
receivers: [otlp]
75-
processors: [batch]
82+
processors: [certificatelogverify, batch]
7683
exporters: [opensearch, debug/logs]
7784
metrics:
7885
receivers: [otlp]
@@ -139,7 +146,7 @@ spec:
139146
name: storage
140147
containers:
141148
- name: otel-collector
142-
image: otel/opentelemetry-collector-contrib:latest
149+
image: ghcr.io/apeirora/otelcol-certificatelogverify:latest
143150
imagePullPolicy: Always
144151
args:
145152
- "--config=/etc/otelcol-contrib/config.yaml"

0 commit comments

Comments
 (0)