
Before, invoking the Loki Helm test was skipped if the environment had a proxy configured. Now, the configmap for the test is modified with the proxy vars. The Loki stach Helm chart does not provide any configuration around this, so we can modify the configmap. As of right now, the certificates are not needed for `apk add` and only proxy vars are required. Change-Id: If58d99555ed299b99bd9bda441856aac326d8379
51 lines
1.5 KiB
Bash
Executable File
51 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
set -ex
|
|
|
|
make -C ./charts loki
|
|
|
|
# shellcheck disable=SC2046
|
|
helm upgrade \
|
|
--create-namespace \
|
|
--install \
|
|
--namespace=loki \
|
|
loki \
|
|
./charts/loki \
|
|
$(./tools/deployment/common/get-values-overrides.sh loki)
|
|
|
|
./tools/deployment/common/wait-for-pods.sh loki
|
|
|
|
# todo(dustinspecker): create a pull request for Loki Helm chart
|
|
# to provide proxy configuration to prevent having to modify the
|
|
# configmap. Then provide proxy configuration as overrides to the
|
|
# `helm upgrade` command above.
|
|
proxy_export="\
|
|
export HTTP_PROXY=\"$HTTP_PROXY\"\n\
|
|
export HTTPS_PROXY=\"$HTTPS_PROXY\"\n\
|
|
export NO_PROXY=\"$NO_PROXY,\$LOKI_SERVICE\"\n\
|
|
export http_proxy=\"$http_proxy\"\n\
|
|
export https_proxy=\"$https_proxy\"\n\
|
|
export no_proxy=\"$no_proxy,\$LOKI_SERVICE\"\
|
|
"
|
|
|
|
configmap_yaml="$(mktemp)"
|
|
|
|
kubectl get configmap loki-loki-stack-test \
|
|
--namespace loki \
|
|
--output yaml \
|
|
> "$configmap_yaml"
|
|
|
|
# install gawk because older versions of awk and alternatives such as mawk
|
|
# don't support inplace
|
|
sudo -E apt-get install gawk --yes
|
|
|
|
# prepend proxy_export only for the first match of LOKI_URI=
|
|
# This enables the script to be idempotent and prevent modifying the
|
|
# last-applied-configuration annotation and breaking the YAML format.
|
|
gawk --assign proxy_export="$proxy_export" \
|
|
--include inplace \
|
|
'/LOKI_URI=/ && !matched { print proxy_export ; matched=1 } 1' "$configmap_yaml"
|
|
|
|
kubectl apply --filename "$configmap_yaml"
|
|
|
|
helm -n loki test loki --logs
|