From b1e38694a65eea2daa09d1a351a59df5d31f6c11 Mon Sep 17 00:00:00 2001 From: Matthias Theuermann <73223147+mati007thm@users.noreply.github.com> Date: Fri, 12 Jan 2024 12:19:18 +0100 Subject: [PATCH] fix: added ingress resources (#9) * fix: added ingress ressources * fix: namespace set --- dapr-distributed-calendar/fluent/ingress.yaml | 14 ++++++++++ dapr-distributed-calendar/jaeger/ingress.yaml | 13 +++++++++ .../kubernetes-deploy.sh | 19 ++----------- .../kubernetes/ingress.yaml | 28 +++++++++---------- .../prometheus/ingress.yaml | 13 +++++++++ .../replace-variables.sh | 13 +++++++++ 6 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 dapr-distributed-calendar/fluent/ingress.yaml create mode 100644 dapr-distributed-calendar/jaeger/ingress.yaml create mode 100644 dapr-distributed-calendar/prometheus/ingress.yaml create mode 100755 dapr-distributed-calendar/replace-variables.sh diff --git a/dapr-distributed-calendar/fluent/ingress.yaml b/dapr-distributed-calendar/fluent/ingress.yaml new file mode 100644 index 0000000..3396c71 --- /dev/null +++ b/dapr-distributed-calendar/fluent/ingress.yaml @@ -0,0 +1,14 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: kibana-ingress + namespace: observability +spec: + entryPoints: + - web + routes: + - match: Host(`kibana.--01..`) && PathPrefix(`/`) + kind: Rule + services: + - name: kibana-kibana + port: 5601 \ No newline at end of file diff --git a/dapr-distributed-calendar/jaeger/ingress.yaml b/dapr-distributed-calendar/jaeger/ingress.yaml new file mode 100644 index 0000000..56cc4bf --- /dev/null +++ b/dapr-distributed-calendar/jaeger/ingress.yaml @@ -0,0 +1,13 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: jaeger-ingress +spec: + entryPoints: + - web + routes: + - match: Host(`jaeger.--01..`) && PathPrefix(`/`) + kind: Rule + services: + - name: simplest-query + port: 16686 \ No newline at end of file diff --git a/dapr-distributed-calendar/kubernetes-deploy.sh b/dapr-distributed-calendar/kubernetes-deploy.sh index 60cab08..60d1cc8 100755 --- a/dapr-distributed-calendar/kubernetes-deploy.sh +++ b/dapr-distributed-calendar/kubernetes-deploy.sh @@ -1,20 +1,5 @@ #!/bin/sh -# # Replace -# find kubernetes* -type f -exec sed -i -e "s//$USER_ID/g" {} \; - -# # Replace -# find kubernetes* -type f -exec sed -i -e "s//$ANIMAL/g" {} \; - -# # Replace -# find kubernetes* -type f -exec sed -i -e "s//$HOST_IP/g" {} \; - -# # Replace -# find kubernetes* -type f -exec sed -i -e "s//$ENVIRONMENT/g" {} \; - -# # Replace -# find kubernetes* -type f -exec sed -i -e "s//$DOMAIN/g" {} \; - # create namespace # kubectl create namespace 12-factor-app @@ -45,7 +30,7 @@ helm upgrade --install \ kubectl create namespace observability kubectl create -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.38.0/jaeger-operator.yaml -n observability kubectl wait --for=condition=ready pod --all --timeout=200s -n observability -kubectl apply -f jaeger/simplest.yaml +kubectl apply -f jaeger/. # install prometheus OPTIONAL helm repo add prometheus-community https://prometheus-community.github.io/helm-charts @@ -55,6 +40,7 @@ helm install prometheus prometheus-community/kube-prometheus-stack \ --namespace default \ --values prometheus/kube-prometheus-stack-values.yaml \ --wait +kubectl apply -f ./prometheus/ingress.yaml # install elastic (requires namespace 'observability') OPTIONAL helm repo add elastic https://helm.elastic.co @@ -64,6 +50,7 @@ helm install kibana elastic/kibana --version 7.17.3 -n observability --wait kubectl apply -f ./fluent/fluentd-config-map.yaml kubectl apply -f ./fluent/fluentd-dapr-with-rbac.yaml kubectl wait --for=condition=ready pod --all --timeout=200s -n observability +kubectl apply -f ./fluent/ingress.yaml # install dapr helm repo add dapr https://dapr.github.io/helm-charts/ diff --git a/dapr-distributed-calendar/kubernetes/ingress.yaml b/dapr-distributed-calendar/kubernetes/ingress.yaml index f07166e..2415030 100644 --- a/dapr-distributed-calendar/kubernetes/ingress.yaml +++ b/dapr-distributed-calendar/kubernetes/ingress.yaml @@ -1,14 +1,14 @@ -# apiVersion: traefik.containo.us/v1alpha1 -# kind: IngressRoute -# metadata: -# name: controller-ingress -# namespace: 12-factor-app -# spec: -# entryPoints: -# - web -# routes: -# - match: Host(`controller.--01..`) && PathPrefix(`/`) -# kind: Rule -# services: -# - name: controller -# port: 80 \ No newline at end of file +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: controller-ingress + # namespace: 12-factor-app +spec: + entryPoints: + - web + routes: + - match: Host(`controller.--01..`) && PathPrefix(`/`) + kind: Rule + services: + - name: controller + port: 3000 \ No newline at end of file diff --git a/dapr-distributed-calendar/prometheus/ingress.yaml b/dapr-distributed-calendar/prometheus/ingress.yaml new file mode 100644 index 0000000..af56d23 --- /dev/null +++ b/dapr-distributed-calendar/prometheus/ingress.yaml @@ -0,0 +1,13 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: prometheus-ingress +spec: + entryPoints: + - web + routes: + - match: Host(`prom.--01..`) && PathPrefix(`/`) + kind: Rule + services: + - name: prometheus-kube-prometheus-prometheus + port: 9090 \ No newline at end of file diff --git a/dapr-distributed-calendar/replace-variables.sh b/dapr-distributed-calendar/replace-variables.sh new file mode 100755 index 0000000..fa9744c --- /dev/null +++ b/dapr-distributed-calendar/replace-variables.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Replace 01 +find * -type f -exec sed -i -e "s//$USER_ID/g" {} \; + +# Replace owl +find * -type f -exec sed -i -e "s//$ANIMAL/g" {} \; + +# Replace cno +find * -type f -exec sed -i -e "s//$ENVIRONMENT/g" {} \; + +# Replace co-pla.training +find * -type f -exec sed -i -e "s//$DOMAIN/g" {} \; \ No newline at end of file