feat: openebs local volume
This commit is contained in:
@@ -36,7 +36,7 @@ metadata:
|
|||||||
- name: StorageType
|
- name: StorageType
|
||||||
value: "hostpath"
|
value: "hostpath"
|
||||||
- name: BasePath
|
- name: BasePath
|
||||||
value: "/var/openebs/local"
|
value: "/var/mnt/local-volume"
|
||||||
openebs.io/cas-type: local
|
openebs.io/cas-type: local
|
||||||
name: openebs-hostpath
|
name: openebs-hostpath
|
||||||
provisioner: openebs.io/local
|
provisioner: openebs.io/local
|
||||||
@@ -2428,7 +2428,7 @@ spec:
|
|||||||
- name: OPENEBS_IO_ENABLE_ANALYTICS
|
- name: OPENEBS_IO_ENABLE_ANALYTICS
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: OPENEBS_IO_BASE_PATH
|
- name: OPENEBS_IO_BASE_PATH
|
||||||
value: /var/openebs/local
|
value: /var/mnt/local-volume
|
||||||
- name: OPENEBS_IO_HELPER_IMAGE
|
- name: OPENEBS_IO_HELPER_IMAGE
|
||||||
value: openebs/linux-utils:4.1.0
|
value: openebs/linux-utils:4.1.0
|
||||||
- name: OPENEBS_IO_HELPER_POD_HOST_NETWORK
|
- name: OPENEBS_IO_HELPER_POD_HOST_NETWORK
|
||||||
@@ -3602,7 +3602,7 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
image: docker.io/bitnami/kubectl:1.25.15
|
image: docker.io/openebs/kubectl:1.25.15
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
name: pre-upgrade-job
|
name: pre-upgrade-job
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ openebs-crds:
|
|||||||
localpv-provisioner:
|
localpv-provisioner:
|
||||||
rbac:
|
rbac:
|
||||||
create: true
|
create: true
|
||||||
|
localpv:
|
||||||
|
basePath: "/var/mnt/local-volume"
|
||||||
|
|
||||||
# Refer to https://github.com/openebs/zfs-localpv/blob/v2.7.1/deploy/helm/charts/values.yaml for complete set of values.
|
# Refer to https://github.com/openebs/zfs-localpv/blob/v2.7.1/deploy/helm/charts/values.yaml for complete set of values.
|
||||||
zfs-localpv:
|
zfs-localpv:
|
||||||
@@ -40,14 +42,28 @@ mayastor:
|
|||||||
enabled: false
|
enabled: false
|
||||||
crds:
|
crds:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
loki:
|
||||||
|
enabled: false
|
||||||
|
alloy:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
# -- Configuration options for pre-upgrade helm hook job.
|
# -- Configuration options for pre-upgrade helm hook job.
|
||||||
preUpgradeHook:
|
preUpgradeHook:
|
||||||
|
# -- Node tolerations for server scheduling to nodes with taints
|
||||||
|
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
|
||||||
|
##
|
||||||
|
tolerations: []
|
||||||
|
# -- Optional array of imagePullSecrets containing private registry credentials
|
||||||
|
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
imagePullSecrets: []
|
||||||
|
# - name: secretName
|
||||||
|
# -- Labels to be added to the pod hook job
|
||||||
|
podLabels: {}
|
||||||
image:
|
image:
|
||||||
# -- The container image registry URL for the hook job
|
# -- The container image registry URL for the hook job
|
||||||
registry: docker.io
|
registry: docker.io
|
||||||
# -- The container repository for the hook job
|
# -- The container repository for the hook job
|
||||||
repo: bitnami/kubectl
|
repo: openebs/kubectl
|
||||||
# -- The container image tag for the hook job
|
# -- The container image tag for the hook job
|
||||||
tag: "1.25.15"
|
tag: "1.25.15"
|
||||||
# -- The imagePullPolicy for the container
|
# -- The imagePullPolicy for the container
|
||||||
@@ -63,3 +79,272 @@ engines:
|
|||||||
mayastor:
|
mayastor:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
loki:
|
||||||
|
enabled: false
|
||||||
|
# NOTE: For all possible storage options for loki, check https://github.com/openebs/openebs/blob/HEAD/charts/loki-storage.md
|
||||||
|
# Configuration for loki's localpv hostpath storage class.
|
||||||
|
localpvScConfig:
|
||||||
|
enabled: true
|
||||||
|
loki:
|
||||||
|
# Name of loki's localpv hostpath storage class.
|
||||||
|
name: "openebs-loki-localpv"
|
||||||
|
# -- Host path where local loki data is stored in.
|
||||||
|
basePath: "/var/local/{{ .Release.Name }}/localpv-hostpath/loki"
|
||||||
|
# -- ReclaimPolicy of loki's localpv hostpath storage class.
|
||||||
|
reclaimPolicy: Delete
|
||||||
|
# -- VolumeBindingMode of loki's localpv hostpath storage class.
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
minio:
|
||||||
|
# Name of minio's localpv hostpath storage class.
|
||||||
|
name: "openebs-minio-localpv"
|
||||||
|
# -- Host path where local minio data is stored in.
|
||||||
|
basePath: "/var/local/{{ .Release.Name }}/localpv-hostpath/minio"
|
||||||
|
# -- ReclaimPolicy of minio's localpv hostpath storage class.
|
||||||
|
reclaimPolicy: Delete
|
||||||
|
# -- VolumeBindingMode of minio's localpv hostpath storage class.
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
|
||||||
|
loki:
|
||||||
|
serviceLabels:
|
||||||
|
app: loki
|
||||||
|
podLabels:
|
||||||
|
app: loki
|
||||||
|
schemaConfig:
|
||||||
|
configs:
|
||||||
|
- from: 2024-04-01
|
||||||
|
store: tsdb
|
||||||
|
object_store: s3
|
||||||
|
schema: v13
|
||||||
|
index:
|
||||||
|
prefix: loki_index_
|
||||||
|
period: 24h
|
||||||
|
commonConfig:
|
||||||
|
replication_factor: 3
|
||||||
|
|
||||||
|
ingester:
|
||||||
|
chunk_encoding: snappy
|
||||||
|
# Configure these if a quicker ingestion is needed, i.e. faster push to your bucket.
|
||||||
|
# chunk_idle_period: 3m
|
||||||
|
# chunk_retain_period: 1m
|
||||||
|
# max_chunk_age: 6m
|
||||||
|
tracing:
|
||||||
|
enabled: true
|
||||||
|
querier:
|
||||||
|
max_concurrent: 1
|
||||||
|
limits_config:
|
||||||
|
ingestion_burst_size_mb: 1000
|
||||||
|
ingestion_rate_mb: 10000
|
||||||
|
max_label_names_per_series: 20
|
||||||
|
|
||||||
|
singleBinary:
|
||||||
|
replicas: 3
|
||||||
|
drivesPerNode: 1
|
||||||
|
persistence:
|
||||||
|
# -- Enabled persistence for loki
|
||||||
|
enabled: true
|
||||||
|
# -- Storage class for loki storage
|
||||||
|
storageClass: "openebs-loki-localpv"
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
# -- Size of loki local storage volume
|
||||||
|
size: 2Gi
|
||||||
|
|
||||||
|
minio:
|
||||||
|
replicas: 3
|
||||||
|
drivesPerNode: 1
|
||||||
|
mode: distributed
|
||||||
|
# Disable this if you want to enabled external s3 bucket, and uncomment the storage section above.
|
||||||
|
enabled: true
|
||||||
|
persistence:
|
||||||
|
# -- Enabled persistence for minio
|
||||||
|
enabled: true
|
||||||
|
# -- Storage class for minio storage
|
||||||
|
storageClass: "openebs-minio-localpv"
|
||||||
|
# -- Size of minio local storage volume
|
||||||
|
size: 2Gi
|
||||||
|
|
||||||
|
deploymentMode: SingleBinary
|
||||||
|
|
||||||
|
lokiCanary:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
chunksCache:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
test:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
gateway:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
resultsCache:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
backend:
|
||||||
|
replicas: 0
|
||||||
|
read:
|
||||||
|
replicas: 0
|
||||||
|
write:
|
||||||
|
replicas: 0
|
||||||
|
|
||||||
|
ingester:
|
||||||
|
replicas: 0
|
||||||
|
querier:
|
||||||
|
replicas: 0
|
||||||
|
queryFrontend:
|
||||||
|
replicas: 0
|
||||||
|
queryScheduler:
|
||||||
|
replicas: 0
|
||||||
|
distributor:
|
||||||
|
replicas: 0
|
||||||
|
compactor:
|
||||||
|
replicas: 0
|
||||||
|
indexGateway:
|
||||||
|
replicas: 0
|
||||||
|
bloomCompactor:
|
||||||
|
replicas: 0
|
||||||
|
bloomGateway:
|
||||||
|
replicas: 0
|
||||||
|
|
||||||
|
alloy:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
logging_config:
|
||||||
|
# Enable debugging on alloy components.
|
||||||
|
debugging: false
|
||||||
|
# -- Labels to enable scraping on, at-least one of these labels should be present.
|
||||||
|
labels:
|
||||||
|
openebs.io/logging: true
|
||||||
|
# -- X-Scope-OrgID to pe populated which pushing logs. Make sure the caller also uses the same.
|
||||||
|
tenant_id: openebs
|
||||||
|
|
||||||
|
alloy:
|
||||||
|
mounts:
|
||||||
|
varlog: true
|
||||||
|
configMap:
|
||||||
|
create: true
|
||||||
|
content: |
|
||||||
|
{{- $releaseName := .Release.Name | replace "-" "_" -}}
|
||||||
|
|
||||||
|
livedebugging {
|
||||||
|
enabled = {{ .Values.logging_config.debugging }}
|
||||||
|
}
|
||||||
|
|
||||||
|
discovery.kubernetes "{{ $releaseName }}_pods_name" {
|
||||||
|
role = "pod"
|
||||||
|
}
|
||||||
|
|
||||||
|
discovery.relabel "{{ $releaseName }}_pods_name" {
|
||||||
|
targets = discovery.kubernetes.{{ $releaseName }}_pods_name.targets
|
||||||
|
|
||||||
|
{{- $labels := .Values.logging_config.labels }}
|
||||||
|
{{- if $labels }}
|
||||||
|
{{- $keys := (keys $labels | sortAlpha) }}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = [
|
||||||
|
{{- range $key := $keys }}
|
||||||
|
"__meta_kubernetes_pod_label_{{ $key | replace "." "_" | replace "/" "_" }}",
|
||||||
|
{{- end }}
|
||||||
|
]
|
||||||
|
separator = ";"
|
||||||
|
regex = "^{{ include "regex_or" (dict "labels" $labels "keys" $keys) }}$"
|
||||||
|
action = "keep"
|
||||||
|
}
|
||||||
|
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
regex = "__meta_kubernetes_pod_label_(.+)"
|
||||||
|
action = "labelmap"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
regex = "__meta_kubernetes_pod_label_(.+)"
|
||||||
|
action = "labelmap"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__meta_kubernetes_namespace"]
|
||||||
|
separator = "/"
|
||||||
|
target_label = "job"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__meta_kubernetes_pod_name"]
|
||||||
|
target_label = "pod"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__meta_kubernetes_pod_container_name"]
|
||||||
|
target_label = "container"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__meta_kubernetes_pod_node_name"]
|
||||||
|
target_label = "hostname"
|
||||||
|
}
|
||||||
|
|
||||||
|
rule {
|
||||||
|
source_labels = ["__meta_kubernetes_pod_uid", "__meta_kubernetes_pod_container_name"]
|
||||||
|
separator = "/"
|
||||||
|
target_label = "__path__"
|
||||||
|
replacement = "/var/log/pods/*$1/*.log"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local.file_match "{{ $releaseName }}_pod_files" {
|
||||||
|
path_targets = discovery.relabel.{{ $releaseName }}_pods_name.output
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.source.file "{{ $releaseName }}_pod_logs" {
|
||||||
|
targets = local.file_match.{{ $releaseName }}_pod_files.targets
|
||||||
|
forward_to = [loki.process.{{ $releaseName }}_process_logs.receiver]
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.process "{{ $releaseName }}_process_logs" {
|
||||||
|
forward_to = [loki.write.default.receiver]
|
||||||
|
|
||||||
|
stage.docker { }
|
||||||
|
|
||||||
|
stage.replace {
|
||||||
|
expression = "(\\n)"
|
||||||
|
replace = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
stage.multiline {
|
||||||
|
firstline = "^ \\x1b\\[2m(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).(\\d{6})Z"
|
||||||
|
}
|
||||||
|
|
||||||
|
stage.multiline {
|
||||||
|
firstline = "^ (\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).(\\d{6})Z"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
loki.write "default" {
|
||||||
|
endpoint {
|
||||||
|
url = "http://{{ .Release.Name }}-loki:3100/loki/api/v1/push"
|
||||||
|
tenant_id = "{{ .Values.logging_config.tenant_id }}"
|
||||||
|
}
|
||||||
|
external_labels = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{- define "regex_or" -}}
|
||||||
|
{{- $labels := .labels -}}
|
||||||
|
{{- $keys := .keys -}}
|
||||||
|
{{- $numKeys := len $keys -}}
|
||||||
|
{{- $regexParts := list -}}
|
||||||
|
{{- range $i, $key := $keys -}}
|
||||||
|
{{- $part := list -}}
|
||||||
|
{{- range $j := until $numKeys -}}
|
||||||
|
{{- if eq $j $i -}}
|
||||||
|
{{- $part = append $part (get $labels $key) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $part = append $part ".*" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- $regexParts = append $regexParts (join ";" $part) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- join "|" $regexParts -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user