-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb9a07f
commit c991816
Showing
424 changed files
with
677 additions
and
49 deletions.
There are no files selected for viewing
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
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,4 @@ | ||
apiVersion: jaegertracing.io/v1 | ||
kind: Jaeger | ||
metadata: | ||
name: simplest |
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,87 @@ | ||
#!/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 | ||
|
||
# create OTel collector | ||
# helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | ||
# helm repo update | ||
# helm upgrade --install my-opentelemetry-collector open-telemetry/opentelemetry-collector \ | ||
# --set mode=deployment \ | ||
# --values otel/otel-collector-values.yaml | ||
# --namespace 12-factor-app | ||
|
||
# install OTel Operator | ||
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts | ||
helm repo update | ||
helm install my-opentelemetry-operator open-telemetry/opentelemetry-operator \ | ||
--set admissionWebhooks.certManager.enabled=false \ | ||
--set admissionWebhooks.certManager.autoGenerateCert.enabled=true \ | ||
--wait | ||
|
||
# create OTel collector and instrumentation | ||
kubectl apply -f otel/. | ||
|
||
# install cert-manager | ||
helm repo add jetstack https://charts.jetstack.io | ||
helm repo update | ||
helm upgrade --install \ | ||
cert-manager jetstack/cert-manager \ | ||
--namespace cert-manager \ | ||
--create-namespace \ | ||
--version v1.7.1 \ | ||
--set installCRDs=true \ | ||
--wait | ||
|
||
# install jaeger | ||
kubectl create namespace observability | ||
kubectl create -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.38.0/jaeger-operator.yaml -n observability --wait | ||
kubectl apply -f jaeger/simplest.yaml --wait | ||
|
||
# install prometheus | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo update | ||
helm install prometheus prometheus-community/kube-prometheus-stack \ | ||
--version 51.3.0 \ | ||
--namespace default \ | ||
--values prometheus/kube-prometheus-stack-values.yaml \ | ||
--wait | ||
|
||
# install dapr | ||
helm repo add dapr https://dapr.github.io/helm-charts/ | ||
helm repo update | ||
helm upgrade --install dapr dapr/dapr \ | ||
--namespace dapr-system \ | ||
--create-namespace \ | ||
--set global.logAsJson=true \ | ||
--wait | ||
|
||
# install dapr dashboard | ||
helm install dapr-dashboard dapr/dapr-dashboard --namespace dapr-system --wait | ||
|
||
# install redis | ||
helm repo add bitnami https://charts.bitnami.com/bitnami | ||
helm repo update | ||
helm install redis bitnami/redis --wait | ||
# helm install redis bitnami/redis --set image.tag=6.2 -f redis/values.yaml --wait | ||
|
||
# deploy the 12-factor-app | ||
kubectl apply -f kubernetes/. | ||
|
||
# get redis password | ||
kubectl get secret redis -o jsonpath='{.data.redis-password}' | base64 --decode |
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,26 @@ | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Configuration | ||
metadata: | ||
name: appconfig | ||
# namespace: 12-factor-app | ||
spec: | ||
tracing: | ||
samplingRate: "1" | ||
stdout: true | ||
otel: | ||
endpointAddress: otel-dapr-collector:4317 | ||
isSecure: false | ||
protocol: grpc | ||
# metrics: | ||
# enabled: true | ||
# rules: | ||
# - name: dapr_runtime_service_invocation_req_sent_total | ||
# labels: | ||
# - name: method | ||
# regex: | ||
# "orders/": "orders/.+" # match all methods under orders | ||
# logging: | ||
# apiLogging: | ||
# enabled: true | ||
# obfuscateURLs: true | ||
# omitHealthChecks: true |
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,44 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: go-events | ||
# namespace: 12-factor-app | ||
labels: | ||
app: go-events | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: go-events | ||
template: | ||
metadata: | ||
labels: | ||
app: go-events | ||
annotations: | ||
instrumentation.opentelemetry.io/inject-go: "go-instrumentation" | ||
instrumentation.opentelemetry.io/otel-go-auto-target-exe: '/root/' | ||
dapr.io/enabled: "true" | ||
dapr.io/app-id: "go-events" | ||
dapr.io/app-port: "6000" | ||
dapr.io/config: "appconfig" | ||
dapr.io/log-as-json: "true" | ||
# our daprd memory settings | ||
# dapr.io/sidecar-memory-limit: "1000Mi" # your memory limit | ||
# dapr.io/env: "GOMEMLIMIT=900MiB" # 90% of your memory limit. Also notice the suffix "MiB" instead of "Mi" | ||
spec: | ||
containers: | ||
- name: go-events | ||
image: mati007thm/dapr-distributed-calendar_go-events:latest | ||
env: | ||
- name: APP_PORT | ||
value: "6000" | ||
- name: DAPR_HTTP_PORT | ||
value: "3500" | ||
- name: OTEL_SERVICE_NAME | ||
value: "go-events" | ||
ports: | ||
- containerPort: 6000 | ||
imagePullPolicy: Always | ||
securityContext: | ||
runAsUser: 0 | ||
privileged: true |
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,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 |
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,54 @@ | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: controller | ||
# namespace: 12-factor-app | ||
labels: | ||
app: controller | ||
spec: | ||
selector: | ||
app: controller | ||
ports: | ||
- protocol: TCP | ||
port: 3000 | ||
targetPort: 3000 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: controller | ||
# namespace: 12-factor-app | ||
labels: | ||
app: controller | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: controller | ||
template: | ||
metadata: | ||
labels: | ||
app: controller | ||
annotations: | ||
instrumentation.opentelemetry.io/inject-nodejs: "node-instrumentation" | ||
dapr.io/enabled: "true" | ||
dapr.io/app-id: "controller" | ||
dapr.io/app-port: "3000" | ||
dapr.io/config: "appconfig" | ||
dapr.io/log-as-json: "true" | ||
# our daprd memory settings | ||
# dapr.io/sidecar-memory-limit: "1000Mi" # your memory limit | ||
# dapr.io/env: "GOMEMLIMIT=900MiB" # 90% of your memory limit. Also notice the suffix "MiB" instead of "Mi" | ||
spec: | ||
containers: | ||
- name: controller | ||
image: mati007thm/dapr-distributed-calendar_controller:latest | ||
env: | ||
- name: APP_PORT | ||
value: "3000" | ||
- name: OTEL_SERVICE_NAME | ||
value: "controller" | ||
ports: | ||
- containerPort: 3000 | ||
imagePullPolicy: Always |
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,40 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: messages | ||
# namespace: 12-factor-app | ||
labels: | ||
app: messages | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: messages | ||
template: | ||
metadata: | ||
labels: | ||
app: messages | ||
annotations: | ||
# instrumentation.opentelemetry.io/inject-python: "python-instrumentation" | ||
dapr.io/enabled: "true" | ||
dapr.io/app-id: "messages" | ||
dapr.io/app-port: "5000" | ||
dapr.io/config: "appconfig" | ||
dapr.io/log-as-json: "true" | ||
# our daprd memory settings | ||
# dapr.io/sidecar-memory-limit: "1000Mi" # your memory limit | ||
# dapr.io/env: "GOMEMLIMIT=900MiB" # 90% of your memory limit. Also notice the suffix "MiB" instead of "Mi" | ||
spec: | ||
containers: | ||
- name: messages | ||
image: mati007thm/dapr-distributed-calendar_messages:latest | ||
env: | ||
- name: "APP_PORT" | ||
value: "5000" | ||
- name: FLASK_RUN_PORT | ||
value: "5000" | ||
# - name: OTEL_SERVICE_NAME | ||
# value: "messages" | ||
ports: | ||
- containerPort: 5000 | ||
imagePullPolicy: Always |
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,37 @@ | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: events | ||
# namespace: 12-factor-app | ||
spec: | ||
type: state.redis | ||
version: v1 | ||
metadata: | ||
- name: redisHost | ||
value: redis-master:6379 | ||
- name: redisPassword | ||
# value: "jW6UBn6aea" # kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" | base64 --decode | ||
secretKeyRef: | ||
name: redis | ||
key: redis-password | ||
auth: | ||
secretStore: kubernetes | ||
--- | ||
apiVersion: dapr.io/v1alpha1 | ||
kind: Component | ||
metadata: | ||
name: pubsub | ||
# namespace: 12-factor-app | ||
spec: | ||
type: pubsub.redis | ||
version: v1 | ||
metadata: | ||
- name: redisHost | ||
value: redis-master:6379 | ||
- name: redisPassword | ||
# value: "jW6UBn6aea" # kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" | base64 --decode | ||
secretKeyRef: | ||
name: redis | ||
key: redis-password | ||
auth: | ||
secretStore: kubernetes |
Oops, something went wrong.