Skip to content

Commit

Permalink
Improve Sales Portal logging parameters (#35)
Browse files Browse the repository at this point in the history
* Add missing game 2048 link in README

* Improve charts with log levels and default values

* Update comments and default values for OpenTelemetry Collector

* Add optional mimir in grafana stack chart

* Update Sales Portal default image tag
  • Loading branch information
devpro authored Feb 20, 2024
1 parent ae287cc commit e7e03f8
Show file tree
Hide file tree
Showing 13 changed files with 86 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Helm charts to ease the deployment of containers on Kubernetes clusters and get
* [Devpro Sales Portal](charts/devpro-salesportal/README.md) 🗸
* [Drupal](charts/drupal/README.md)
* [E Corp Demo](charts/ecorp-demo/README.md) 🗸
* [Game 2048](charts/game-2048/README.md) 🗸
* [HobbyFarm](charts/hobbyfarm/README.md) 🗸
* [Podinfo](charts/podinfo/README.md) 🗸
* [WordPress](charts/wordpress/README.md) 🗸
Expand Down Expand Up @@ -52,7 +53,6 @@ Helm charts to ease the deployment of containers on Kubernetes clusters and get
* [Rancher Cluster Templates](charts/rancher-cluster-templates/README.md) 🗸
* Observability
* [Elastic Stack](charts/elastic-stack/README.md)
* [Grafana](charts/grafana/README.md)
* [Grafana Stack](charts/grafana-stack/README.md) 🗸
* [OpenTelemetry Collector](charts/opentelemetry-collector/README.md) 🗸
* [Prometheus](charts/prometheus/README.md) 🗸
Expand Down
2 changes: 1 addition & 1 deletion charts/devpro-salesportal/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: devpro-salesportal
description: Helm chart for Devpro Sales Portal
type: application
version: 0.2.2
version: 0.2.3
appVersion: "1.1.0"
dependencies:
- name: mongodb
Expand Down
26 changes: 13 additions & 13 deletions charts/devpro-salesportal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Run `helm template sales-portal . -f values.yaml > temp.yaml` to look at what is
```bash
# installs or updates the Helm release
helm upgrade --install sales-portal-beta . -f values.yaml --create-namespace \
--set mongodb.enabled=true,mongodb.auth.rootPassword=admin \
--set data.db.connectionString=mongodb://root:admin@sales-portal-beta-mongodb:27017/sales-portal-beta?authSource=admin \
--set data.db.databaseName=sales-portal-beta \
--namespace sales-portal-beta
--set mongodb.enabled=true,mongodb.auth.rootPassword=admin \
--set data.db.connectionString=mongodb://root:admin@sales-portal-beta-mongodb:27017/sales-portal-beta?authSource=admin \
--set data.db.databaseName=sales-portal-beta \
--namespace sales-portal-beta

# (optional) forwards MongoDB port for local access
kubectl port-forward service/sales-portal-beta-mongodb 27017:27017 -n sales-portal-beta
Expand All @@ -73,13 +73,13 @@ NGINX_PUBLIC_IP=`kubectl get service -n ingress-nginx ingress-nginx-controller -

# applies the manifest (add "--debug > output.yaml" in case of issue)
helm upgrade --install sales-portal-beta . -f values.yaml --create-namespace \
--set mongodb.enabled=true,mongodb.auth.rootPassword=admin \
--set data.db.connectionString=mongodb://root:admin@sales-portal-beta-mongodb:27017/sales-portal-beta?authSource=admin \
--set data.db.databaseName=sales-portal-beta \
--set ingress.enabled=true,ingress.className=nginx,ingress.annotations.'cert-manager\.io/cluster-issuer'=letsencrypt-prod \
--set front.host=sales-portal.${NGINX_PUBLIC_IP}.sslip.io,front.tls.secretName=sales-portal-tls \
--set adapter.host=crm-adapter.${NGINX_PUBLIC_IP}.sslip.io,adapter.tls.secretName=crm-adapter-tls \
--set data.host=crm-data.${NGINX_PUBLIC_IP}.sslip.io,data.tls.secretName=crm-data-tls \
--set dotnet.environment=Development,dotnet.enableSwagger=true,dotnet.enableOpenTelemetry=true \
--namespace sales-portal-beta
--set mongodb.enabled=true,mongodb.auth.rootPassword=admin \
--set data.db.connectionString=mongodb://root:admin@sales-portal-beta-mongodb:27017/sales-portal-beta?authSource=admin \
--set data.db.databaseName=sales-portal-beta \
--set ingress.enabled=true,ingress.className=nginx,ingress.annotations.'cert-manager\.io/cluster-issuer'=letsencrypt-prod \
--set front.host=sales-portal.${NGINX_PUBLIC_IP}.sslip.io,front.tls.secretName=sales-portal-tls \
--set adapter.host=crm-adapter.${NGINX_PUBLIC_IP}.sslip.io,adapter.tls.secretName=crm-adapter-tls \
--set data.host=crm-data.${NGINX_PUBLIC_IP}.sslip.io,data.tls.secretName=crm-data-tls \
--set dotnet.environment=Development,dotnet.enableSwagger=true,dotnet.enableOpenTelemetry=true \
--namespace sales-portal-beta
```
8 changes: 4 additions & 4 deletions charts/devpro-salesportal/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ spec:
- name: CrmDataWebApi__Url
value: "https://{{ $.Values.data.host }}"
- name: Logging__LogLevel__Default
value: {{ $.Values.dotnet.logLevel }}
- name: Logging__LogLevel__Microsoft__AspNetCore
value: {{ $.Values.dotnet.logLevel }}
value: {{ $.Values.dotnet.logLevels.default }}
- name: Logging__LogLevel__Microsoft.AspNetCore
value: {{ $.Values.dotnet.logLevels.framework }}
- name: Logging__LogLevel__Devpro
value: {{ $.Values.dotnet.logLevel }}
value: {{ $.Values.dotnet.logLevels.application }}
{{- if $.Values.dotnet.skipCertificateValidation }}
- name: Application__IsCertificateValidationSkipped
value: "true"
Expand Down
28 changes: 17 additions & 11 deletions charts/devpro-salesportal/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ front:
host: sales-portal.random
name: salesportal-wasmapp
image: docker.io/devprofr/salesportal-wasmapp
tag: 1.1.7818547414
tag: 1.1.7976633545
port: 80
replicaCount: 1
healthEndpoint: /health
Expand All @@ -12,9 +12,8 @@ front:
# - name: xxx
# value: "yyyy"
additionalPodLabels: {}
api: {}
tls: {}
# secretName: chart-example-tls
tls:
secretName: sales-portal-tls
resources: {}
# limits:
# cpu: 200m
Expand All @@ -28,36 +27,41 @@ adapter:
host: crm-adapter.random
name: salesportal-crmadapterwebapi
image: docker.io/devprofr/salesportal-crmadapterwebapi
tag: 1.1.7818547414
tag: 1.1.7976633545
replicaCount: 1
port: 8080
healthEndpoint: /health
db: {}
extraEnv: []
additionalPodLabels: {}
tls: {}
tls:
secretName: crm-adapter-tls
resources: {}

data:
enabled: true
host: crm-data.random
name: salesportal-crmdatawebapi
image: docker.io/devprofr/salesportal-crmdatawebapi
tag: 1.1.7818547414
tag: 1.1.7976633545
replicaCount: 1
port: 8080
healthEndpoint: /health
db:
connectionString: ""
databaseName: ""
connectionString: "someconnstring"
databaseName: "somedb"
extraEnv: []
additionalPodLabels: {}
tls: {}
tls:
secretName: crm-data-tls
resources: {}

dotnet:
environment: Production
logLevel: Information
logLevels:
default: Information
framework: Information
application: Information
enableSwagger: false
enableOpenTelemetry: false
skipCertificateValidation: false
Expand All @@ -66,8 +70,10 @@ ingress:
enabled: false
className: ""
annotations: {}
# cert-manager.io/cluster-issuer: letsencrypt-prod

mongodb:
enabled: false
# https://github.com/bitnami/charts/blob/main/bitnami/mongodb/values.yaml
auth: {}
# rootPassword: ""
7 changes: 5 additions & 2 deletions charts/grafana-stack/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ dependencies:
- name: tempo
repository: https://grafana.github.io/helm-charts
version: 1.7.1
digest: sha256:e919e1e0aa7e42fca6345e467b9e83db2df55aa9e73f38866dcfbe3a6de22f00
generated: "2024-02-12T15:05:39.167125367+01:00"
- name: mimir-distributed
repository: https://grafana.github.io/helm-charts
version: 5.2.1
digest: sha256:c1910995f543721161a068a93136d6ea10fe9da751a9f8ac1a11a3b49164a25c
generated: "2024-02-20T21:25:42.603612274+01:00"
9 changes: 8 additions & 1 deletion charts/grafana-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ apiVersion: v2
name: grafana-stack
description: Helm chart for managing Grafana Stack
type: application
version: "0.2.0"
version: "0.2.1"
appVersion: "10.3.1"
dependencies:
- name: grafana
version: 7.3.0 # appVersion: 10.3.1
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
- name: loki
version: 5.42.2 # appVersion: 2.9.4
repository: https://grafana.github.io/helm-charts
condition: loki.enabled
- name: tempo
version: 1.7.1 # appVersion: 2.3.0
repository: https://grafana.github.io/helm-charts
condition: tempo.enabled
- name: mimir-distributed
version: 5.2.1 # appVersion: 2.11.0
repository: https://grafana.github.io/helm-charts
condition: mimir-distributed.enabled
maintainers:
- name: devpro
email: [email protected]
Expand Down
1 change: 1 addition & 0 deletions charts/grafana-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ kubectl get pod -n grafana
```bash
# searches for the latest version
helm search repo grafana/grafana
helm search repo grafana/mimir-distributed
helm search repo grafana/loki
helm search repo grafana/tempo

Expand Down
19 changes: 13 additions & 6 deletions charts/grafana-stack/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml
grafana: {}
grafana:
enabled: true
# https://github.com/grafana/helm-charts/blob/main/charts/grafana/values.yaml
# ingress:
# enabled: false
# ingressClassName: nginx
Expand All @@ -11,8 +12,14 @@ grafana: {}
# hosts:
# - grafana.local

# https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml
loki: {}
loki:
enabled: true
# https://github.com/grafana/loki/blob/main/production/helm/loki/values.yaml

# https://github.com/grafana/helm-charts/blob/main/charts/tempo/values.yaml
tempo: {}
tempo:
enabled: true
# https://github.com/grafana/helm-charts/blob/main/charts/tempo/values.yaml

mimir-distributed:
enabled: false
# https://github.com/grafana/mimir/blob/main/operations/helm/charts/mimir-distributed/values.yaml
3 changes: 0 additions & 3 deletions charts/grafana/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion charts/opentelemetry-collector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: opentelemetry-collector
description: Helm chart for managing OpenTelemetry Collector
type: application
version: "0.2.1"
version: "0.2.2"
appVersion: "0.93.0"
dependencies:
- name: opentelemetry-collector
Expand Down
19 changes: 13 additions & 6 deletions charts/opentelemetry-collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
This Helm chart will install [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/)
by using the [official Helm chart](https://github.com/open-telemetry/opentelemetry-helm-charts).

💡 By default, [OpenTelemetry Collector Contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) will be installed (which is a good think 😊)

## How to use

- Review the default configuration from [values.yaml](values.yaml) and identify the changes specific to your environment

- With Helm CLI (see [README](../../README.md#from-helm-cli) for requirements)

```bash
# install with default parameters
# install with optional parameters
helm upgrade --install opentelemetry-collector devpro/opentelemetry-collector --create-namespace \
--namespace opentelemetry-collector
--namespace opentelemetry-collector
# --set myvariable=xxx
# -f myvalues.yaml

# watches the installation and checks all pods are running after some time
kubectl get pod -n opentelemetry-collector --watch
Expand All @@ -19,8 +25,9 @@ kubectl get pod -n opentelemetry-collector --watch
## How to create or update the chart

```bash
# update helm repositories
../../scripts/add_helm_repos.sh
# adds & updates upstream repository
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update

# searches for the latest version
helm search repo -l open-telemetry/opentelemetry-collector
Expand All @@ -35,8 +42,8 @@ helm dependency update

```bash
# creates the release from the local files
helm upgrade --install opentelemetry-collector . -f values.yaml --create-namespace \
--namespace opentelemetry-collector
kubectl create ns opentelemetry-collector
helm upgrade --install opentelemetry-collector . -f values.yaml --namespace opentelemetry-collector

# (optional) forwards port for local access
kubectl port-forward daemonsets/opentelemetry-collector-agent 4317:4317 -n opentelemetry-collector
Expand Down
10 changes: 9 additions & 1 deletion charts/opentelemetry-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ opentelemetry-collector:
config:
receivers:
jaeger: null
prometheus: null
zipkin: null
service:
pipelines:
Expand Down Expand Up @@ -33,3 +32,12 @@ opentelemetry-collector:
- batch
receivers:
- otlp
ports:
jaeger-compact:
enabled: false
jaeger-thrift:
enabled: false
jaeger-grpc:
enabled: false
zipkin:
enabled: false

0 comments on commit e7e03f8

Please sign in to comment.