Skip to content

Commit cec401c

Browse files
committed
fix: add systemWorker TLS config and remove unnecessary dynamic config
The system worker was failing to connect to frontend because frontend requires mTLS but the worker was connecting over plaintext. Add systemWorker TLS config using the internode cert, which frontend already trusts. Also remove the dynamicconfig directory and config since the server falls back to a noop client when none is configured, and document how the config diverges from the default development-cass-es.yaml.
1 parent 6a8b928 commit cec401c

3 files changed

Lines changed: 46 additions & 12 deletions

File tree

tls/tls-full/config_template.yaml

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# enable-template
22
#
3-
# This comment enables Go template rendering with sprig functions when loaded
4-
# via TEMPORAL_SERVER_CONFIG_FILE_PATH. Environment variables are accessed with
5-
# the sprig env function: {{ default "fallback" (env "VAR_NAME") }}
3+
# Custom server config for the tls-full sample. Based on the default
4+
# development-cass-es.yaml embedded in the server binary, with the following
5+
# changes:
6+
#
7+
# - Uses # enable-template directive with sprig env() for environment variable
8+
# substitution (the default config uses hardcoded values)
9+
# - Adds global.tls block with internode mTLS and per-namespace frontend
10+
# hostOverrides (the reason this custom config exists)
11+
# - Uses bindOnIP instead of bindOnLocalHost so services are reachable
12+
# across containers
13+
# - Omits pprof, metrics, archival, dcRedirectionPolicy, and
14+
# dynamicConfigClient (not relevant to this sample; the server uses
15+
# a noop dynamic config client when none is configured)
616
#
717
# To preview the rendered config, run:
818
# temporal-server --config-file /path/to/this/file render-config
@@ -33,6 +43,10 @@ global:
3343
membership:
3444
maxJoinDuration: 30s
3545
broadcastAddress: {{ default "" (env "TEMPORAL_BROADCAST_ADDRESS") }}
46+
# TLS config -- this is the only section not present in the default config.
47+
# Internode mTLS secures cluster-internal traffic. Frontend hostOverrides
48+
# map SNI hostnames to per-namespace cert/CA pairs, allowing each namespace
49+
# to authenticate with its own client certificate.
3650
tls:
3751
internode:
3852
server:
@@ -65,13 +79,42 @@ global:
6579
requireClientAuth: true
6680
clientCaFiles:
6781
- /certs/client/ca/client-intermediate-ca-development.pem
82+
# The system worker must connect to frontend over TLS. There are two
83+
# approaches:
84+
#
85+
# 1. systemWorker (used here) -- give the worker a client cert that
86+
# frontend trusts. Simpler, no extra service needed.
87+
#
88+
# 2. internal-frontend -- run a separate frontend that uses internode
89+
# TLS (no client auth required). To use this instead, remove
90+
# systemWorker, uncomment internal-frontend under services, and add
91+
# "internal-frontend" to TEMPORAL_SERVICES in docker-compose.yml.
92+
#
93+
# See the PublicClient comment for guidance on when to use each:
94+
# https://github.com/temporalio/temporal/blob/8e6e905428f0ec5257402cb003ead5f4924cdc95/common/config/config.go#L548-L564
95+
systemWorker:
96+
certFile: /certs/cluster/internode/cluster-internode.pem
97+
keyFile: /certs/cluster/internode/cluster-internode.key
98+
client:
99+
serverName: internode.cluster-x.contoso.com
100+
rootCaFiles:
101+
- /certs/cluster/ca/server-intermediate-ca.pem
68102

69103
services:
70104
frontend:
71105
rpc:
72106
grpcPort: 7233
73107
membershipPort: 6933
108+
# bindOnIP instead of bindOnLocalHost so services bind to the
109+
# container's network interface rather than loopback only.
74110
bindOnIP: {{ default "127.0.0.1" (env "BIND_ON_IP") }}
111+
# Alternative to systemWorker: uncomment to run a dedicated internal
112+
# frontend that the system worker connects to via internode TLS.
113+
# internal-frontend:
114+
# rpc:
115+
# grpcPort: 7236
116+
# membershipPort: 6936
117+
# bindOnIP: {{ default "127.0.0.1" (env "BIND_ON_IP") }}
75118
matching:
76119
rpc:
77120
grpcPort: 7235
@@ -99,7 +142,3 @@ clusterMetadata:
99142
initialFailoverVersion: 1
100143
rpcName: "frontend"
101144
rpcAddress: "127.0.0.1:7233"
102-
103-
dynamicConfigClient:
104-
filepath: {{ default "/etc/temporal/config/dynamicconfig" (env "DYNAMIC_CONFIG_FILE_PATH") }}
105-
pollInterval: "60s"

tls/tls-full/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ services:
5656
ports:
5757
- "7233:7233"
5858
volumes:
59-
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
6059
- ${TEMPORAL_LOCAL_CERT_DIR}:${TEMPORAL_TLS_CERTS_DIR}
6160
- ./config_template.yaml:/etc/temporal/config/config_template.yaml
6261
depends_on:
@@ -66,7 +65,6 @@ services:
6665
- "TEMPORAL_SERVER_CONFIG_FILE_PATH=/etc/temporal/config/config_template.yaml"
6766
- "CASSANDRA_SEEDS=cassandra"
6867
- "ES_SEEDS=elasticsearch"
69-
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-cass.yaml"
7068
- "BIND_ON_IP=0.0.0.0"
7169
healthcheck:
7270
test: ["CMD", "nc", "-z", "localhost", "7233"]

tls/tls-full/dynamicconfig/development-cass.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)