-
Notifications
You must be signed in to change notification settings - Fork 3
/
.envrc
executable file
·68 lines (59 loc) · 2.87 KB
/
.envrc
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
# Go environment
# ===================
CACHE_PATH=".cache/gopath"
mkdir -p $CACHE_PATH
export GOPATH=$(realpath $CACHE_PATH)
# Local variables
# ===============
CURRENT_PATH=$(pwd)
REPO_NAME=$(basename $CURRENT_PATH)
REPO_HOST_PATH=$(realpath $CURRENT_PATH/..)
REPO_NODE_PATH="/srv/git"
REPO_URI="http://git-http-backend/git/${REPO_NAME}"
REPO_BRANCH=$(git branch --show-current)
OS_ARCH=$(uname -m)
if [ "$OS_ARCH" == "arm64" ] || [ "$OS_ARCH" == "aarch64" ]; then
K8S_VERSION="kindest/node:v1.27.3@sha256:de0b3dfe848ccf07e24f4278eaf93edb857b6231b39773f46b36a2b1a6543ae9" # arm64 image
else
K8S_VERSION="kindest/node:v1.27.3@sha256:9dd3392d79af1b084671b05bcf65b21de476256ad1dcc853d9f3b10b4ac52dde" # amd64 image
fi
CERT_VALIDITY_DAYS=180
# Export as environment variables if not already defined
# ======================================================
export INITIUM_REPO_NAME=${INITIUM_REPO_NAME:-${REPO_NAME}}
export INITIUM_REPO_HOST_PATH=${INITIUM_REPO_HOST_PATH:-${REPO_HOST_PATH}}
export INITIUM_REPO_NODE_PATH=${INITIUM_REPO_NODE_PATH:-${REPO_NODE_PATH}}
export INITIUM_REPO_URI=${INITIUM_REPO_URI:-${REPO_URI}}
export INITIUM_REPO_BRANCH=${INITIUM_REPO_BRANCH:-${REPO_BRANCH}}
export INITIUM_K8S_VERSION=${INITIUM_K8S_VERSION:-${K8S_VERSION}}
export INITIUM_CERT_VALIDITY_DAYS=${INITIUM_CERT_VALIDITY_DAYS:-${CERT_VALIDITY_DAYS}}
# Required by MetalLB - https://kind.sigs.k8s.io/docs/user/loadbalancer/
# ======================================================================
if [ $(docker network ls -f "name=kind" -q) ]; then
KIND_NET_CIDR=$(docker network inspect -f '{{ (index .IPAM.Config 0).Subnet }}' kind)
METALLB_IP_START=$(echo ${KIND_NET_CIDR} | sed "s@0.0/16@255.200@")
METALLB_IP_END=$(echo ${KIND_NET_CIDR} | sed "s@0.0/16@255.209@")
export INITIUM_METALLB_CIDR="${METALLB_IP_START}-${METALLB_IP_END}"
fi
# Enable this flag if you want to just deploy the K8s cluster
# with MetalLB in place, to allow Loadbalancer services to work
# =============================================================
export INITIUM_DEPLOY_MINIMAL="${INITIUM_DEPLOY_MINIMAL:-false}"
# Control which addons we might want to exclude from default deployment,
# if INITIUM_DEPLOY_MINIMAL == false
# ======================================================================
# Istio
export INITIUM_AOA_EXCLUDE_ISTIO="${INITIUM_AOA_EXCLUDE_ISTIO:-false}"
# Knative depends on Istio by default, if we exclude it we exclude Knative as well
if [ "${INITIUM_AOA_EXCLUDE_ISTIO}" = "true" ]; then
export INITIUM_AOA_EXCLUDE_KNATIVE="true"
else
export INITIUM_AOA_EXCLUDE_KNATIVE="${INITIUM_AOA_EXCLUDE_KNATIVE:-false}"
fi
# Prometheus + Grafana stack
export INITIUM_AOA_EXCLUDE_PROMETHEUSSTACK="${INITIUM_AOA_EXCLUDE_PROMETHEUSSTACK:-false}"
# Dex
export INITIUM_AOA_EXCLUDE_DEX="${INITIUM_AOA_EXCLUDE_DEX:-false}"
# OpenTelemetry
export INITIUM_AOA_EXCLUDE_OPENTELEMETRY="${INITIUM_AOA_EXCLUDE_OPENTELEMETRY:-false}"