Skip to content

Commit

Permalink
chore(): update private ob to 1.0.1 (#24)
Browse files Browse the repository at this point in the history
1. 升级 mo-ob-opensource chart 至1.0.7 (最新)
2. 修改默认配置,添加 mo.yaml 便于用户使用 & 简单修改
  • Loading branch information
EZ4BRUCE authored Nov 18, 2024
1 parent 4cd090b commit f47e5e5
Show file tree
Hide file tree
Showing 8 changed files with 441 additions and 111 deletions.
111 changes: 70 additions & 41 deletions Tiltfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,74 @@

command = os.getenv('TILT_COMMAND', 'default')
load('ext://helm_remote', 'helm_remote')
helm_remote(
'operator',
repo_url='https://operator.min.io',
release_name='minio-operator',
namespace='minio-operator',
version='6.0.2',
create_namespace=True,
)

helm_remote(
'tenant',
repo_url='https://operator.min.io',
release_name='loki-tenant',
namespace='loki-tenant',
version='6.0.2',
values=['./dev/loki-tenant.yaml'],
create_namespace=True,
)

# 设置 Helm Chart 的本地路径
mo_ob_opensource_chart = './charts/mo-ob-opensource'
mo_ruler_stack_chart = './charts/mo-ruler-stack'

local('kubectl get ns mo-ob || kubectl create ns mo-ob')

k8s_yaml(
helm(
mo_ruler_stack_chart,
name='mo-ruler-stack',
namespace='mo-ob',
values=['./dev/mo-ruler-stack.dev.yaml'],

def deploy_minio():
helm_remote(
'operator',
repo_url='https://operator.min.io',
release_name='minio-operator',
namespace='minio-operator',
version='6.0.2',
create_namespace=True,
)

helm_remote(
'tenant',
repo_url='https://operator.min.io',
release_name='loki-tenant',
namespace='loki-tenant',
version='6.0.2',
values=['./dev/loki-tenant.yaml'],
create_namespace=True,
)
)

k8s_yaml(
helm(
mo_ob_opensource_chart,
name='mo-ob-opensource',
namespace='mo-ob',
values=['./dev/mo-ob-opensource.dev.yaml'],

def deploy_moc_ob():
# 设置 Helm Chart 的本地路径
mo_ob_opensource_chart = './charts/mo-ob-opensource'
mo_ruler_stack_chart = './charts/mo-ruler-stack'

local('kubectl get ns mo-ob || kubectl create ns mo-ob')

k8s_yaml(
helm(
mo_ruler_stack_chart,
name='mo-ruler-stack',
namespace='mo-ob',
values=['./dev/mo-ruler-stack.dev.yaml'],
)
)

k8s_yaml(
helm(
mo_ob_opensource_chart,
name='mo-ob-opensource',
namespace='mo-ob',
values=['./dev/mo-ob-opensource.dev.yaml'],
)
)

k8s_yaml("./dev/loki_test_rule.yaml")

def deploy_ob_private():
local('kubectl get ns mo-ob || kubectl create ns mo-ob')
mo_ob_private_chart = './charts/mo-ob-private'

k8s_yaml(
helm(
mo_ob_private_chart,
name='mo-ob-private',
namespace='mo-ob',
values=['./dev/mo-ob-private.dev.yaml'],
)
)
)

k8s_yaml("./dev/loki_test_rule.yaml")
if command == 'moc':
deploy_minio()
deploy_moc_ob()
elif command == 'private':
deploy_minio()
deploy_ob_private()
elif command == 'minio':
deploy_minio()
else:
print('Unknown command, please use TILT_COMMAND=moc or TILT_COMMAND=private')
16 changes: 5 additions & 11 deletions charts/mo-ob-opensource/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,14 @@ loki:
# -- Storage config. Providing this will automatically populate all necessary storage configs in the templated config.
storage:
bucketNames:
# use same bucket
chunks: test-bucket
ruler: test-bucket
type: s3
s3:
# s3: null
# e.g. s3.us-west-2.amazonaws.com
endpoint: null
# e.g. us-west-2
region: null
secretAccessKey: null
accessKeyId: null
s3ForcePathStyle: false
insecure: false
endpoint: minio.loki-tenant
accessKeyId: obtest-access
secretAccessKey: obtest-secret
s3ForcePathStyle: true
insecure: true
# -- Check https://grafana.com/docs/loki/latest/configuration/#schema_config for more info on how to configure schemas
schemaConfig:
configs:
Expand Down
10 changes: 5 additions & 5 deletions charts/mo-ob-private/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apiVersion: v2
name: mo-ob-private
description: mo-ob-private's Helm chart for Kubernetes
type: application
version: 1.0.0-alpha.3
version: 1.0.1
appVersion: 0.9.0
dependencies:
- condition: mo-ob-opensource.enabled
name: mo-ob-opensource
repository: https://matrixone-cloud.github.io/observability-charts
version: 1.0.0-alpha.16
repository: https://matrixorigin.github.io/observability-charts
version: 1.0.7
- condition: mo-ruler-stack.enabled
name: mo-ruler-stack
repository: https://matrixone-cloud.github.io/observability-charts
version: 1.0.2
repository: https://matrixorigin.github.io/observability-charts
version: 1.0.4

213 changes: 213 additions & 0 deletions charts/mo-ob-private/mo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
mo-ob-opensource:

alloy:
image:
registry: "docker.io"
repository: grafana/alloy
tag: v1.3.1
alloy:
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 200m
memory: 200Mi

promtail:
image:
registry: docker.io
repository: grafana/promtail
tag: "2.8.4"
resources:
limits:
cpu: "200m"
memory: "200Mi"
requests:
cpu: "100m"
memory: "200Mi"
loki:
sidecar:
image:
repository: kiwigrid/k8s-sidecar
tag: 1.27.5
image:
registry: docker.io
repository: grafana/loki
tag: "3.2.0"
enabled: true
tableManager:
enabled: true
retention_deletes_enabled: true
retention_period: 720h

loki:
# disable log alert in paivate env
rulerConfig:
storage:
type: ""
# commonConfig:
# replication_factor: 1
storage_config:
object_prefix: loki-controlplane
storage:
bucketNames:
chunks: test-bucket
type: s3
s3:
endpoint: minio.loki-tenant
accessKeyId: obtest-access
secretAccessKey: obtest-secret
s3ForcePathStyle: true
insecure: true

write:
# -- Number of replicas for the write
replicas: 3
persistence:
enableStatefulSetAutoDeletePVC: false
size: 20Gi
storageClass:
resources:
requests:
memory: "2Gi"
cpu: "500m"
limits:
memory: "2Gi"
cpu: "1000m"

read:
replicas: 3
persistence:
enableStatefulSetAutoDeletePVC: true
size: 20Gi
storageClass:
resources:
requests:
memory: "2Gi"
cpu: "500m"
limits:
memory: "2Gi"
cpu: "1000m"

backend:
replicas: 1
persistence:
enableStatefulSetAutoDeletePVC: true
size: 20Gi
storageClass:
resources:
requests:
memory: "2Gi"
cpu: "500m"
limits:
memory: "2Gi"
cpu: "1000m"

# Configuration for the gateway
gateway:
image:
registry: docker.io
repository: nginxinc/nginx-unprivileged
tag: 1.27-alpine
enabled: true
replicas: 1
resources:
requests:
memory: "500Mi"
cpu: "500m"
limits:
memory: "1Gi"
cpu: "1000m"

kube-prometheus-stack:
prometheus-node-exporter:
image:
registry: quay.io
repository: prometheus/node-exporter
tag: v1.5.0

prometheusOperator:
image:
registry: quay.io
repository: prometheus-operator/prometheus-operator
tag: v0.63.0
prometheusConfigReloader:
image:
registry: quay.io
repository: prometheus-operator/prometheus-config-reloader
# if not set appVersion field from Chart.yaml is used
tag: v0.63.0

prometheus:
prometheusSpec:
image:
registry: quay.io
repository: prometheus/prometheus
tag: v2.42.0
retention: 14d
externalLabels:
clusterDetail: mo-ob-private-cluster
resources:
limits:
cpu: 2000m
memory: "6Gi"
requests:
cpu: 2000m
memory: "6Gi"
# [必要]根据部署的云厂商选择存储配置
storageSpec:
volumeClaimTemplate:
spec:
storageClassName: ""
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 100Gi

kube-state-metrics:
enabled: true
image:
registry: registry.k8s.io
repository: kube-state-metrics/kube-state-metrics
tag: v2.8.2


mo-ruler-stack:

alertmanager:
image:
repository: quay.io/prometheus/alertmanager
pullPolicy: IfNotPresent
tag: v0.27.0

grafana:
image:
repository: docker.io/grafana/grafana
tag: 10.1.6
initChownData:
image:
repository: docker.io/library/busybox
tag: 1.31.1
sidecar:
image:
repository: quay.io/kiwigrid/k8s-sidecar
tag: 1.25.1

persistence:
enabled: true
type: "statefulset"
storageClassName:
size: "5Gi"
resources:
limits:
cpu: "1000m"
memory: "2Gi"
requests:
cpu: "1000m"
memory: "2Gi"
service:
enabled: true
type: NodePort
targetPort: 3000
portName: service
Loading

0 comments on commit f47e5e5

Please sign in to comment.