Skip to content

Commit dfe012b

Browse files
committed
add simple gce setup for apiserver tracing
1 parent e18ea6e commit dfe012b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cluster/gce/gci/configure-helper.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,14 @@ users:
995995
EOF
996996
fi
997997

998+
if [[ "${ENABLE_APISERVER_TRACING:-false}" == "true" ]]; then
999+
cat <<EOF >/etc/srv/kubernetes/opentelemetry_config.yaml
1000+
apiVersion: apiserver.k8s.io/v1alpha1
1001+
kind: OpenTelemetryClientConfiguration
1002+
url: localhost:55680
1003+
EOF
1004+
fi
1005+
9981006
if [[ -n "${ADMISSION_CONTROL:-}" ]]; then
9991007
# Emit a basic admission control configuration file, with no plugins specified.
10001008
cat <<EOF >/etc/srv/kubernetes/admission_controller_config.yaml

cluster/gce/gci/configure-kubeapiserver.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ function start-kube-apiserver {
255255
params+=" --admission-control-config-file=/etc/srv/kubernetes/admission_controller_config.yaml"
256256
fi
257257

258+
if [[ "${ENABLE_APISERVER_TRACING:-false}" == "true" ]]; then
259+
params+=" --opentelemetry-config-file=/etc/srv/kubernetes/opentelemetry_config.yaml"
260+
fi
261+
258262
# If GKE exec auth support is requested for webhooks, then
259263
# gke-exec-auth-plugin needs to be mounted into the kube-apiserver container.
260264
local webhook_exec_auth_plugin_mount=""

0 commit comments

Comments
 (0)