Skip to content

Commit

Permalink
fixes for agent
Browse files Browse the repository at this point in the history
  • Loading branch information
schoren committed Jul 16, 2024
1 parent b61a1b9 commit 27562c7
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 22 deletions.
2 changes: 1 addition & 1 deletion charts/tracetest-agent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version: v1.3.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: v1.2.0
appVersion: v1.4.3
dependencies:
- name: tracetest-common
version: v1.0.0
Expand Down
4 changes: 3 additions & 1 deletion charts/tracetest-agent-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ data:
TRACETEST_NATS_ENDPOINT: "{{ .Values.global.nats.endpoint }}"
TRACETEST_TARGET_VERSION: "{{ .Values.config.targetVersion }}"
TRACETEST_TARGET_NAMESPACE: "{{ .Values.config.targetNamespace }}"
TRACETEST_TARGET_SERVER: "{{ include "tracetest-common.url" .Values.global.urls.controlPlane }}"
TRACETEST_TARGET_SERVER: {{ include "tracetest-common.url" .Values.global.urls.web }}
TRACETEST_TARGET_DOMAIN: "{{ .Values.global.urls.agents.domain }}"
TRACETEST_AGENT_EXTRA_ENV: |
TRACETEST_DEV_FORCE_URL=true
TRACETEST_TRACING_COLLECTORENDPOINT: ""
5 changes: 5 additions & 0 deletions charts/tracetest-agent-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
configMapKeyRef:
name: {{ include "tracetest-agent-operator.fullname" . }}-config
key: TRACETEST_TRACING_COLLECTORENDPOINT
- name: TRACETEST_AGENT_EXTRA_ENV
valueFrom:
configMapKeyRef:
name: {{ include "tracetest-agent-operator.fullname" . }}-config
key: TRACETEST_AGENT_EXTRA_ENV

imagePullPolicy: Always
resources:
Expand Down
15 changes: 6 additions & 9 deletions charts/tracetest-agent-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
global:
tracetestFrontend:
service:
httpPort: 3000

nats:
endpoint: &natsEndpoint "nats://nats:4222"

Expand All @@ -14,16 +18,9 @@ global:
path: "/"

config:
targetVersion: v0.0.0
targetVersion: v1.4.1
targetNamespace: agents

service:
type: ClusterIP
grpcPort: 8089
httpPort: 8090
controlPlanePort: 8091
metricsPort: 9100

deployment:
replicas: 1

Expand All @@ -42,5 +39,5 @@ deployment:

image:
repository: ghcr.io/kubeshop/tracetest-agent-operator
# tag: v0.1.0
tag: v1.4.3

6 changes: 0 additions & 6 deletions charts/tracetest-auth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,6 @@ kratos:
secretKeyRef:
name: kratos-secrets
key: GOOGLE_CLIENT_SECRET

- name: SECRETS_COOKIE
valueFrom:
secretKeyRef:
name: kratos-secrets
key: COOKIE

- name: SECRETS_COOKIE
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion charts/tracetest-cloud/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version: v1.8.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: v1.2.0
appVersion: v1.4.3

dependencies:
- name: tracetest-common
Expand Down
2 changes: 1 addition & 1 deletion charts/tracetest-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version: v1.3.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: v1.0.4
appVersion: v1.0.5

dependencies:
- name: tracetest-common
Expand Down
6 changes: 5 additions & 1 deletion charts/tracetest-frontend/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
global:
tracetestFrontend:
service:
httpPort: &httpPort 3000

urls:
web:
protocol: "https"
Expand Down Expand Up @@ -54,7 +58,7 @@ securityContext: {}

service:
type: ClusterIP
port: 3000
port: *httpPort

resources:
limits:
Expand Down
43 changes: 43 additions & 0 deletions scripts/coredns_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Check that exactly two arguments are passed
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <hostname> <namespace/serviceName>"
exit 1
fi

# Assign arguments to variables
HOSTNAME=$1
INTERNAL_HOSTNAME=$2

# Default CoreDNS configuration with the custom entry
DEFAULT_COREDNS_CONFIG=$(cat <<EOF
.:53 {
errors
health {
lameduck 5s
}
ready
rewrite name $HOSTNAME $INTERNAL_HOSTNAME
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus :9153
forward . /etc/resolv.conf {
max_concurrent 1000
}
cache 30
loop
reload
loadbalance
}
EOF
)

# Update the CoreDNS ConfigMap with the new configuration
kubectl create configmap -n kube-system coredns --from-literal=Corefile="$DEFAULT_COREDNS_CONFIG" -o yaml --dry-run=client | kubectl apply -f -
kubectl rollout restart -n kube-system deployment/coredns

printf "\e[42m\e[1mCoreDNS configuration has been updated. The hostname %s is now replaced to %s\e[0m\e[0m\n" "$HOSTNAME" "$INTERNAL_HOSTNAME"
9 changes: 7 additions & 2 deletions scripts/setup_kind_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ ENV_FILE=$PROJECT_ROOT/cluster.env
SETUP_CLUSTER=false

if [[ "$@" == *"--reset"* ]]; then
printf "\e[41m\e[1mDeleting existing cluster\e[0m\e[0m\n"
kind delete cluster --name tracetest
fi

if ! kind get clusters | grep -q tracetest; then
printf "\e[42m\e[1mCreate new cluster\e[0m\e[0m\n"
SETUP_CLUSTER=true
kind create cluster \
--name tracetest \
--config $PROJECT_ROOT/kind-config.yaml \
--kubeconfig $KUBECONFIG_FILE
else
echo "Cluster already exists"
printf "\e[1mCluster already exists\e[0m\n"
fi

cat <<EOF > $ENV_FILE
Expand Down Expand Up @@ -69,4 +71,7 @@ if [[ "$@" == *"--build-deps"* ]]; then
fi

helm upgrade --install ttdeps $PROJECT_ROOT/charts/tracetest-dependencies -f $PROJECT_ROOT/values-kind.yaml
helm upgrade --install tt $PROJECT_ROOT/charts/tracetest-onprem -f $PROJECT_ROOT/values-kind.yaml
helm upgrade --install tt $PROJECT_ROOT/charts/tracetest-onprem -f $PROJECT_ROOT/values-kind.yaml

printf "\e[42m\e[1mConfiguring CoreDNS\e[0m\e[0m\n"
$PROJECT_ROOT/scripts/coredns_config.sh tracetest.localdev ttdeps-traefik.default.svc.cluster.local

0 comments on commit 27562c7

Please sign in to comment.