forked from tumblr/k8s-sidecar-injector
-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
executable file
·25 lines (25 loc) · 1.05 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
set -e
LIFECYCLE_PORT="${LIFECYCLE_PORT:-9000}"
TLS_PORT="${TLS_PORT:-9443}"
CONFIG_DIR="${CONFIG_DIR:-/conf}"
TLS_CERT_FILE="${TLS_CERT_FILE:-/var/lib/secrets/cert.crt}"
TLS_KEY_FILE="${TLS_KEY_FILE:-/var/lib/secrets/cert.key}"
ANNOTATION_NAMESPACE="${ANNOTATION_NAMESPACE:-injector.tumblr.com}"
CONFIGMAP_LABELS="${CONFIGMAP_LABELS:-app=k8s-sidecar-injector}"
CONFIGMAP_NAMESPACE="${CONFIGMAP_NAMESPACE:-}"
ANNOTATION_NAMESPACE="${ANNOTATION_NAMESPACE:-injector.tumblr.com}"
LOG_LEVEL="${LOG_LEVEL:-2}"
echo "k8s-sidecar-injector starting at $(date) with TLS_PORT=${TLS_PORT} CONFIG_DIR=${CONFIG_DIR} TLS_CERT_FILE=${TLS_CERT_FILE} TLS_KEY_FILE=${TLS_KEY_FILE}"
set -x
exec k8s-sidecar-injector \
--v="${LOG_LEVEL}" \
--lifecycle-port="${LIFECYCLE_PORT}" \
--tls-port="${TLS_PORT}" \
--config-directory="${CONFIG_DIR}" \
--tls-cert-file="${TLS_CERT_FILE}" \
--tls-key-file="${TLS_KEY_FILE}" \
--configmap-labels="${CONFIGMAP_LABELS}" \
--configmap-namespace="${CONFIGMAP_NAMESPACE}" \
--annotation-namespace="${ANNOTATION_NAMESPACE}" \
"$@"