-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix down command * Add tempo
- Loading branch information
Showing
15 changed files
with
151 additions
and
94 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: tyk-jaeger | ||
namespace: replace_namespace | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app.kubernetes.io/instance: tyk-tempo | ||
app.kubernetes.io/name: tempo | ||
ports: | ||
- name: tempo-query-jaeger-ui | ||
port: 16686 | ||
protocol: TCP | ||
targetPort: 16686 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,8 @@ | ||
logger "$INFO" "installing $jaegerReleaseName in $namespace namespace..."; | ||
|
||
setVerbose; | ||
helm upgrade "$jaegerReleaseName" jaegertracing/jaeger-operator --version v2.46.2 \ | ||
--install \ | ||
--namespace "$namespace" \ | ||
"${helmFlags[@]}" > /dev/null; | ||
|
||
sed "s/replace_service_type/$JAEGER_SERVICE_TYPE/g" "$jaegerDeploymentPath/jaeger.yaml" | \ | ||
sed "s/replace_enabled_ingress/$JAEGER_INGRESS_ENABLED/g" | \ | ||
sed "s/replace_ingress_className/$INGRESS_CLASSNAME/g" | \ | ||
sed "s/replace_namespace/$namespace/g" "$jaegerDeploymentPath/jaeger-svc-template.yaml" | \ | ||
kubectl apply --namespace "$namespace" -f - > /dev/null; | ||
|
||
helm upgrade tyk-otel-collector open-telemetry/opentelemetry-collector --version 0.99.0 \ | ||
--install \ | ||
--set "mode=deployment" \ | ||
--set "image.repository=otel/opentelemetry-collector-k8s" \ | ||
--set "config.receivers.otlp.protocols.http.endpoint=0.0.0.0:4318" \ | ||
--set "config.receivers.otlp.protocols.grpc.endpoint=0.0.0.0:4317" \ | ||
--set "config.exporters.otlphttp.endpoint=$jaegerReleaseName-collector.$namespace.svc:14250" \ | ||
--set "config.exporters.otlphttp.tls.insecure=true" \ | ||
--set "config.extensions.pprof.endpoint=\:1888" \ | ||
--set "config.extensions.zpages.endpoint=\:55679" \ | ||
--set "config.service.extensions[0]=pprof" \ | ||
--set "config.service.extensions[1]=zpages" \ | ||
--set "config.service.extensions[2]=health_check" \ | ||
--set "config.service.pipelines.traces.receivers[0]=otlp" \ | ||
--set "config.service.pipelines.traces.processors[0]=batch" \ | ||
--set "config.service.pipelines.traces.exporters[0]=otlphttp" \ | ||
--namespace "$namespace" \ | ||
"${helmFlags[@]}" > /dev/null; | ||
unsetVerbose; | ||
|
||
args=(--set-string "tyk-gateway.gateway.extraEnvs[$gatewayExtraEnvsCtr].name=TYK_GW_OPENTELEMETRY_ENABLED" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$gatewayExtraEnvsCtr].value=true" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 1))].name=TYK_GW_OPENTELEMETRY_EXPORTER" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 1))].value=grpc" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 2))].name=TYK_GW_OPENTELEMETRY_ENDPOINT" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 2))].value=tyk-otel-collector-opentelemetry-collector:4317"); | ||
|
||
gatewayExtraEnvsCtr=$((gatewayExtraEnvsCtr + 3)); | ||
|
||
addDeploymentArgs "${args[@]}"; | ||
|
||
sed "s/replace_release_name/$jaegerReleaseName/g" "$jaegerDeploymentPath/health-svc-template.yaml" | \ | ||
sed "s/replace_namespace/$namespace/g" | \ | ||
kubectl apply --namespace "$namespace" -f - > /dev/null; | ||
|
||
addService "$jaegerReleaseName-query"; | ||
addService "$jaegerReleaseName-health"; | ||
addService "tyk-jaeger"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
## OpenTelemetry | ||
Deploys the OpenTelemetry collector using the | ||
`open-telemetryopentelemetry-collector` chart version `0.108.1` and configures | ||
the Tyk deployment to send telemetry data to Grafana Tempo through the OpenTelemetry | ||
collector. | ||
|
||
### Example | ||
``` | ||
./up.sh --deployments opentelemetry tyk-stack | ||
``` | ||
|
||
### Support | ||
| Item | Status | | ||
|:------------:|:------------------:| | ||
| OpenShift | :white_check_mark: | | ||
| ARM | :white_check_mark: | | ||
| CI Tests | N/A | | ||
| Postman Test | N/A | | ||
| SSL | N/A | | ||
|
||
### Supported Service Types with `--expose` flag | ||
| Item | Status | | ||
|:-------------:|:------:| | ||
| Port Forward | N/A | | ||
| Ingress | N/A | | ||
| Load Balancer | N/A | | ||
|
||
| Icon | Description | | ||
|:------------------:|:-------------------------:| | ||
| :white_check_mark: | Supported and tested | | ||
| :warning: | Not tested | | ||
| :x: | Not supported | | ||
| :no_entry: | Not supported by the tool | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
if [ -z "$opentelemetryRegistered" ]; then | ||
opentelemetryRegistered=true; | ||
|
||
opentelemetrReleaseName="tyk-opentelemetry"; | ||
opentelemetryDeploymentPath="src/deployments/opentelemetry"; | ||
|
||
source "src/deployments/cert-manager/main.safe.sh"; | ||
source "$opentelemetryDeploymentPath/main.sh"; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
logger "$INFO" "installing $opentelemetrReleaseName in $namespace namespace..."; | ||
|
||
setVerbose; | ||
helm upgrade tyk-otel-collector open-telemetry/opentelemetry-collector --version 0.108.1 \ | ||
--install \ | ||
--set "mode=deployment" \ | ||
--set "image.repository=otel/opentelemetry-collector-contrib" \ | ||
--set "config.receivers.otlp.protocols.http.endpoint=0.0.0.0:4318" \ | ||
--set "config.receivers.otlp.protocols.grpc.endpoint=0.0.0.0:4317" \ | ||
--set "config.processors.transform.error_mode=ignore" \ | ||
--set "config.processors.transform.metric_statements[0].context=datapoint" \ | ||
--set "config.processors.transform.metric_statements[0].statements[0]=replace_all_patterns(attributes\, \"value\"\, \"[^a-zA-Z0-9]\"\, \"_\")" \ | ||
--set "config.exporters.otlp/tempo.endpoint=$tempoReleaseName.$namespace.svc:4317" \ | ||
--set "config.exporters.otlp/tempo.tls.insecure=true" \ | ||
--set "config.extensions.pprof.endpoint=\:1888" \ | ||
--set "config.extensions.zpages.endpoint=\:55679" \ | ||
--set "config.service.extensions[0]=pprof" \ | ||
--set "config.service.extensions[1]=zpages" \ | ||
--set "config.service.extensions[2]=health_check" \ | ||
--set "config.service.pipelines.traces.receivers[0]=otlp" \ | ||
--set "config.service.pipelines.traces.processors[0]=batch" \ | ||
--set "config.service.pipelines.traces.exporters[0]=otlp/tempo" \ | ||
--namespace "$namespace" \ | ||
"${helmFlags[@]}" > /dev/null; | ||
unsetVerbose; | ||
|
||
args=(--set-string "tyk-gateway.gateway.extraEnvs[$gatewayExtraEnvsCtr].name=TYK_GW_OPENTELEMETRY_ENABLED" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$gatewayExtraEnvsCtr].value=true" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 1))].name=TYK_GW_OPENTELEMETRY_EXPORTER" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 1))].value=grpc" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 2))].name=TYK_GW_OPENTELEMETRY_ENDPOINT" \ | ||
--set-string "tyk-gateway.gateway.extraEnvs[$(($gatewayExtraEnvsCtr + 2))].value=tyk-otel-collector-opentelemetry-collector:4317"); | ||
|
||
gatewayExtraEnvsCtr=$((gatewayExtraEnvsCtr + 3)); | ||
addDeploymentArgs "${args[@]}"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Tempo | ||
Deploys the Tempo using the `grafana/tempo` chart version `v1.10.3`. | ||
|
||
### Example | ||
``` | ||
./up.sh --deployments tempo tyk-stack | ||
``` | ||
|
||
### Support | ||
| Item | Status | | ||
|:------------:|:------------------:| | ||
| OpenShift | :white_check_mark: | | ||
| ARM | :white_check_mark: | | ||
| CI Tests | :white_check_mark: | | ||
| Postman Test | :white_check_mark: | | ||
| SSL | :no_entry: | | ||
|
||
### Supported Service Types with `--expose` flag | ||
| Item | Status | | ||
|:-------------:|:------------------:| | ||
| Port Forward | :white_check_mark: | | ||
| Ingress | :white_check_mark: | | ||
| Load Balancer | :white_check_mark: | | ||
|
||
| Icon | Description | | ||
|:------------------:|:-------------------------:| | ||
| :white_check_mark: | Supported and tested | | ||
| :warning: | Not tested | | ||
| :x: | Not supported | | ||
| :no_entry: | Not supported by the tool | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
if [ -z "$tempoRegistered" ]; then | ||
tempoRegistered=true; | ||
|
||
tempoReleaseName="tyk-tempo"; | ||
tempoDeploymentPath="src/deployments/tempo"; | ||
|
||
source "src/deployments/opentelemetry/main.safe.sh"; | ||
source "src/deployments/prometheus-grafana/main.safe.sh"; | ||
source "$tempoDeploymentPath/main.sh"; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
logger "$INFO" "installing $tempoReleaseName in $namespace namespace..."; | ||
|
||
setVerbose; | ||
helm upgrade "$tempoReleaseName" grafana/tempo --version v1.10.3 \ | ||
--install \ | ||
--namespace "$namespace" \ | ||
--set "tempoQuery.enabled=true" \ | ||
"${helmFlags[@]}" > /dev/null; | ||
unsetVerbose; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
set +e; | ||
policies=$(kubectl get tykpolicies --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
apis=$(kubectl get tykapis --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
oasapis=$(kubectl get tykoasapis --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
oasapis=$(kubectl get tykoas --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
supergraphs=$(kubectl get supergraphs --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
subgraphs=$(kubectl get subgraphs --namespace "$namespace" 2> /dev/null | awk '{print $1}' | tail -n +2 | tr '\n' ' '); | ||
|
||
kubectl delete --namespace "$namespace" tykpolicies $policies &> /dev/null; | ||
kubectl delete --namespace "$namespace" tykapis $apis &> /dev/null; | ||
kubectl delete --namespace "$namespace" tykoasapis $oasapis &> /dev/null; | ||
kubectl delete --namespace "$namespace" tykoas $oasapis &> /dev/null; | ||
kubectl delete --namespace "$namespace" supergraphs $supergraphs &> /dev/null; | ||
kubectl delete --namespace "$namespace" subgraphs $subgraphs &> /dev/null; | ||
set -e; |