Skip to content

Commit f632cf7

Browse files
committed
provision and validate opensearch CA secret for tier-2
1 parent 918d34a commit f632cf7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

showroom/kubectl/secrets.example.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# - tier-2 otel: secret otel-otlp-ingest-htpasswd key htpasswd -> file /etc/otelcol-secrets/htpasswd
77
# The htpasswd line MUST authenticate the same user/password as otel-otlp-client-auth (tier-1 exporter).
88
# - tier-2 otel OpenSearch: secret opensearch-credentials keys username, password -> OPENSEARCH_*
9+
# - tier-2 otel OpenSearch TLS: secret opensearch-ca-cert key ca.crt -> /etc/opensearch-ca/ca.crt
910
#
1011
# Legacy (optional): copy this file to secrets.local.yaml (gitignored), replace REPLACE_ME, then:
1112
# kubectl apply -f secrets.local.yaml
@@ -17,6 +18,8 @@
1718
# (for example: `htpasswd -nbB otel-client strong-password`).
1819
# - opensearch-credentials.username/password: OpenSearch ingest user credentials (for example: admin/<strong-password> for local dev),
1920
# preferably stored in OpenBao and injected from there.
21+
# - opensearch-ca-cert.ca.crt: PEM-encoded CA certificate that signs the OpenSearch HTTP certificate
22+
# (for example: root-ca.pem from the OpenSearch deployment).
2023
---
2124
apiVersion: v1
2225
kind: Secret
@@ -56,3 +59,13 @@ type: Opaque
5659
stringData:
5760
username: REPLACE_ME # OpenSearch username with index/write permissions (example local dev: admin), preferably stored/retrieved in OpenBao
5861
password: REPLACE_ME # Matching OpenSearch password (example local dev: admin password), preferably stored/retrieved in OpenBao
62+
---
63+
apiVersion: v1
64+
kind: Secret
65+
metadata:
66+
name: opensearch-ca-cert
67+
namespace: tier-2
68+
type: Opaque
69+
stringData:
70+
ca.crt: |
71+
REPLACE_ME_PEM_CA_CERTIFICATE

showroom/tasks/otelcol-agent.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ tasks:
2525
preconditions:
2626
- sh: "{{ .KUBECTL_CMD }} cluster-info >/dev/null 2>&1"
2727
msg: "Please ensure that you have a k8s-cluster running. Try:\ttask garden:set-kubeconfig"
28+
- sh: "{{ .KUBECTL_CMD }} get secret opensearch-ca-cert -n {{ .NAMESPACE }} >/dev/null 2>&1"
29+
msg: "Missing required secret tier-2/opensearch-ca-cert (key: ca.crt). Apply showroom/kubectl/secrets.example.yaml first."
2830
status:
2931
- "{{ .KUBECTL_CMD }} get pods -n {{ .NAMESPACE }} | grep otelcol-agent >/dev/null 2>&1"
3032
cmds:
@@ -40,6 +42,8 @@ tasks:
4042
preconditions:
4143
- sh: "{{ .KUBECTL_CMD }} cluster-info >/dev/null 2>&1"
4244
msg: "Please ensure that you have a k8s-cluster running. Try:\ttask garden:set-kubeconfig"
45+
- sh: "{{ .KUBECTL_CMD }} get secret opensearch-ca-cert -n {{ .NAMESPACE }} >/dev/null 2>&1"
46+
msg: "Missing required secret tier-2/opensearch-ca-cert (key: ca.crt). Apply showroom/kubectl/secrets.example.yaml first."
4347
cmds:
4448
- "{{ .KUBECTL_CMD }} apply -f kubectl/tier-2.yaml -n {{ .NAMESPACE }}"
4549
- echo "OpenTelemetry Collector agent setup upgraded successfully!"

0 commit comments

Comments
 (0)