Skip to content

Commit

Permalink
fix: added ingress resources (#9)
Browse files Browse the repository at this point in the history
* fix: added ingress ressources

* fix: namespace set
  • Loading branch information
mati007thm authored Jan 12, 2024
1 parent 8092653 commit b1e3869
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 30 deletions.
14 changes: 14 additions & 0 deletions dapr-distributed-calendar/fluent/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: kibana-ingress
namespace: observability
spec:
entryPoints:
- web
routes:
- match: Host(`kibana.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`)
kind: Rule
services:
- name: kibana-kibana
port: 5601
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/jaeger/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: jaeger-ingress
spec:
entryPoints:
- web
routes:
- match: Host(`jaeger.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`)
kind: Rule
services:
- name: simplest-query
port: 16686
19 changes: 3 additions & 16 deletions dapr-distributed-calendar/kubernetes-deploy.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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/
Expand Down
28 changes: 14 additions & 14 deletions dapr-distributed-calendar/kubernetes/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`)
# kind: Rule
# services:
# - name: controller
# port: 80
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: controller-ingress
# namespace: 12-factor-app
spec:
entryPoints:
- web
routes:
- match: Host(`controller.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`)
kind: Rule
services:
- name: controller
port: 3000
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/prometheus/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: prometheus-ingress
spec:
entryPoints:
- web
routes:
- match: Host(`prom.<ENV-NAME>-<ENV-USER-ID>-01.<ENV-ANIMAL>.<ENV-DOMAIN>`) && PathPrefix(`/`)
kind: Rule
services:
- name: prometheus-kube-prometheus-prometheus
port: 9090
13 changes: 13 additions & 0 deletions dapr-distributed-calendar/replace-variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Replace 01
find * -type f -exec sed -i -e "s/<ENV-USER-ID>/$USER_ID/g" {} \;

# Replace owl
find * -type f -exec sed -i -e "s/<ENV-ANIMAL>/$ANIMAL/g" {} \;

# Replace cno
find * -type f -exec sed -i -e "s/<ENV-NAME>/$ENVIRONMENT/g" {} \;

# Replace co-pla.training
find * -type f -exec sed -i -e "s/<ENV-DOMAIN>/$DOMAIN/g" {} \;

0 comments on commit b1e3869

Please sign in to comment.