diff --git a/README.md b/README.md index 89e0aab..84201df 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,163 @@ # tracetest-cloud-charts -TODO: make this nice +This is the helm repo for the on prem instalation of Tracetest -this repo provides a script to create a local kind cluster with an entire Tracetest cloud instance. -while we have this repo private and all the private images, this is just deploying Tracetest cloud. -we need to use a secret so you need to use the create image pull secret script to configure that in the kind cluster. +## DNS -once everything is public, we can use kind to validate PRs before merging. -this can also become the main helm repo for cloud, since it has a much nicer approach, but we'll see if that works out without needing too much customization +Tracetest needs to be accesible from outside the cluster, exposed via a [Traefik's](#Traefik) IgressRoute. +For this, it requires a DNS resolvable name. You can use a public DNS, an intranet DNS, or even hostfile based, +as long as clients are able to resolve the hostnames to the correct IPs. + +You can choose any hostname you want. Tracetest imposes no limitation on this. + +If you choose to use a resolving mechanism that is not available within the Kuberetes cluster where Tracetest runs, +you can configure the clusters CoreDNS to point the selected hostname to the Traefik Service. We provide a [script for this](./scripts/coredns_config.sh) + +If you want to use managed agents, and send tracing info to them from outside the cluster, you need to set a wildcard subdomain. + +**Example** + +Your main domain is `tracetest.acme.com`. You need to setup `tracetest.acme.com` and `*.tracetest.acme.com` to the LoadBalancer IP. + + +## Cluster prerequisites + +Tracetest expects some preconditions in the environment where it runs. + +### Cert manager + +Tracetest uses cert-manager to create sign certificates for JWT tokens, and SSL certificates for Ingress. + +Quick install: +``` +helm repo add jetstack https://charts.jetstack.io --force-update + helm upgrade --install \ + cert-manager jetstack/cert-manager \ + --namespace cert-manager \ + --create-namespace \ + --version v1.15.0 \ + --set crds.enabled=true +``` + +Cert Manager defines Issuers. If you have existing Issuers that you want to use, you can configure them in `values.yaml`. + +You can also create a SelfSigned issuer and create self signed certificates: +``` +cat < $ENV_FILE @@ -68,7 +74,7 @@ source $ENV_FILE if [[ "$SETUP_CLUSTER" == true ]]; then for chart_dir in $PROJECT_ROOT/charts/*; do - printf "\e[42m\e[1mBuilding dependencies for $(basename "$chart_dir")\e[0m\e[0m\n" + printf "\n\e[42m\e[1mBuilding dependencies for $(basename "$chart_dir")\e[0m\e[0m\n" helm dependency update "$chart_dir" done @@ -96,13 +102,13 @@ else if [[ -z "$TRACETEST_LICENSE" ]]; then read -p $'\e[1;32m Enter your Tracetest license key:\e[0m ' TRACETEST_LICENSE else - printf "\e[1;32mreading Tracetest license username from env.\e[0m\n" + printf "\n\e[1;32mReading Tracetest license username from env.\e[0m\n" fi HELM_EXTRA_FLAGS+=(--set global.licenseKey="$TRACETEST_LICENSE") fi -echo "Starting Tracetest OnPrem installation on Kind" +printf "\n\e[42m\e[1mStarting Tracetest OnPrem installation\e[0m\e[0m\n" helm upgrade --install ttdeps $PROJECT_ROOT/charts/tracetest-dependencies -f $PROJECT_ROOT/values-kind.yaml "${HELM_EXTRA_FLAGS[@]}" helm upgrade --install tt $PROJECT_ROOT/charts/tracetest-onprem -f $PROJECT_ROOT/values-kind.yaml "${HELM_EXTRA_FLAGS[@]}" @@ -112,11 +118,14 @@ if [[ "$@" == *"--install-demo"* ]]; then fi if [[ "$@" == *"--reset"* ]]; then - printf "\e[42m\e[1mConfiguring CoreDNS\e[0m\e[0m\n" + printf "\n\e[42m\e[1mConfiguring CoreDNS\e[0m\e[0m\n" hosts=(tracetest.localdev) if [[ "$@" == *"--install-demo"* ]]; then hosts+=(pokeshop.localdev) fi $PROJECT_ROOT/scripts/coredns_config.sh ttdeps-traefik.default.svc.cluster.local "${hosts[@]}" -fi \ No newline at end of file + printf "\n" +fi + +printf "\e[42m\e[1mDone!\e[0m\e[0m\n" \ No newline at end of file diff --git a/scripts/start_k9s.sh b/scripts/start_k9s.sh new file mode 100644 index 0000000..a82395a --- /dev/null +++ b/scripts/start_k9s.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +export KUBECONFIG=$KUBECONFIG:$(pwd)/tracetest.kubeconfig +kubectl config use-context kind-tracetest + +k9s \ No newline at end of file diff --git a/values-kind.yaml b/values-kind.yaml index 9342e64..9facce9 100644 --- a/values-kind.yaml +++ b/values-kind.yaml @@ -1,32 +1,6 @@ global: urls: - rootDomain: "tracetest.localdev" - cookieDomain: "tracetest.localdev" - web: - protocol: "https" - hostname: "tracetest.localdev" - port: "30000" - path: "/" - - api: - protocol: "https" - hostname: "tracetest.localdev" - port: "30000" - path: "/api" - - auth: - protocol: "https" - hostname: "tracetest.localdev" - port: "30000" - path: "/auth" - - agents: - domain: "tracetest.localdev" - port: "30000" - - nats: - host: "tt-nats-headless" - endpoint: "nats://tt-nats-headless:4222" + rootDomain: &rootDomain "tracetest.localdev" postgresql: auth: @@ -52,7 +26,7 @@ traefik: type: NodePort dnsNames: - - "tracetest.localdev" + - *rootDomain - "pokeshop.localdev" tls: