Skip to content

Commit

Permalink
add stalle
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick committed Apr 10, 2024
1 parent 01d33fe commit c960cf0
Show file tree
Hide file tree
Showing 15 changed files with 800 additions and 209 deletions.
4 changes: 2 additions & 2 deletions charts/deepflow-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: An automated observability platform for cloud-native developers.
name: deepflow-agent
engine: gotpl
type: application
version: 6.4.013
appVersion: "6.4.9"
version: 6.5.006
appVersion: "6.5.4"
kubeVersion: ">=1.16.0-0"
sources:
- https://github.com/deepflowio/deepflow
Expand Down
2 changes: 1 addition & 1 deletion charts/deepflow-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ image:
repository: registry.cn-hongkong.aliyuncs.com/deepflow-ce/deepflow-agent
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: v6.4
tag: v6.5.4

imagePullSecrets: []
nameOverride: ""
Expand Down
10 changes: 7 additions & 3 deletions charts/deepflow/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: An automated observability platform for cloud-native developers.
name: deepflow
engine: gotpl
type: application
version: 6.4.013
appVersion: "6.4.9"
version: 6.5.006
appVersion: "6.5.4"
kubeVersion: ">=1.16.0-0"
sources:
- https://github.com/deepflowio/deepflow
Expand All @@ -31,4 +31,8 @@ dependencies:
- name: grafana
version: "7.*.*"
repository: https://grafana.github.io/helm-charts
condition: grafana.enabled
condition: grafana.enabled
- name: stella-agent-ce
repository: ""
version: '*.*.*'
condition: stella-agent-ce.enabled
16 changes: 15 additions & 1 deletion charts/deepflow/charts/stella-agent-ce/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
apiVersion: v2
description: An automated observability platform for cloud-native developers.
name: stella-agent-ce
version: 0.1.0
engine: gotpl
type: application
version: 6.5.001
appVersion: "6.5.0"
kubeVersion: ">=1.16.0-0"
sources:
- https://github.com/deepflowio/deepflow
home: https://github.com/deepflowio/deepflow
keywords:
- deepflow
icon: https://raw.githubusercontent.com/deepflowio/deepflow-charts/main/deepflow.svg
maintainers:
- name: deepflow
url: https://github.com/deepflowio/deepflow
214 changes: 214 additions & 0 deletions charts/deepflow/charts/stella-agent-ce/templates/_affinity.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{/* affinity - https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ */}}

{{- define "nodeaffinity" }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -38,4 +40,216 @@
{{- end }}
{{- end }}
{{- end }}
{{- end }}

{{- define "nodeAffinityPreferredDuringScheduling" }}
{{- range $weightIndex, $weightItem := .Values.nodeAffinityTermLabelSelector }}
- weight: {{ $weightItem.weight }}
preference:
matchExpressions:
{{- range $Index, $item := $weightItem.matchExpressions }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- range $weightIndex, $weightItem := .Values.global.nodeAffinityTermLabelSelector }}
- weight: {{ $weightItem.weight }}
preference:
matchExpressions:
{{- range $Index, $item := $weightItem.matchExpressions }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}


{{- define "podAffinity" }}
{{- if or .Values.podAffinityLabelSelector .Values.podAffinityTermLabelSelector}}
podAffinity:
{{- if .Values.podAffinityLabelSelector }}
requiredDuringSchedulingIgnoredDuringExecution:
{{- include "podAffinityRequiredDuringScheduling" . }}
{{- end }}
{{- if or .Values.podAffinityTermLabelSelector}}
preferredDuringSchedulingIgnoredDuringExecution:
{{- include "podAffinityPreferredDuringScheduling" . }}
{{- end }}
{{- end }}
{{- end }}

{{- define "podAffinityRequiredDuringScheduling" }}
{{- range $labelSelector, $labelSelectorItem := .Values.podAffinityLabelSelector }}
- labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
{{- end }}
{{- range $labelSelector, $labelSelectorItem := .Values.global.podAffinityLabelSelector }}
- labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
{{- end }}
{{- end }}

{{- define "podAffinityPreferredDuringScheduling" }}
{{- range $labelSelector, $labelSelectorItem := .Values.podAffinityTermLabelSelector }}
- podAffinityTerm:
labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
weight: {{ $labelSelectorItem.weight }}
{{- end }}
{{- range $labelSelector, $labelSelectorItem := .Values.global.podAffinityTermLabelSelector }}
- podAffinityTerm:
labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
weight: {{ $labelSelectorItem.weight }}
{{- end }}
{{- end }}

{{- define "podAntiAffinity" }}
{{- if or .Values.podAntiAffinityLabelSelector .Values.podAntiAffinityTermLabelSelector}}
podAntiAffinity:
{{- if .Values.podAntiAffinityLabelSelector }}
requiredDuringSchedulingIgnoredDuringExecution:
{{- include "podAntiAffinityRequiredDuringScheduling" . }}
{{- end }}
{{- if or .Values.podAntiAffinityTermLabelSelector}}
preferredDuringSchedulingIgnoredDuringExecution:
{{- include "podAntiAffinityPreferredDuringScheduling" . }}
{{- end }}
{{- end }}
{{- end }}

{{- define "podAntiAffinityRequiredDuringScheduling" }}
{{- range $labelSelectorIndex, $labelSelectorItem := .Values.podAntiAffinityLabelSelector }}
- labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
{{- end }}
{{- range $labelSelectorIndex, $labelSelectorItem := .Values.global.podAntiAffinityLabelSelector }}
- labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
{{- end }}
{{- end }}

{{- define "podAntiAffinityPreferredDuringScheduling" }}
{{- range $labelSelectorIndex, $labelSelectorItem := .Values.podAntiAffinityTermLabelSelector }}
- podAffinityTerm:
labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
weight: {{ $labelSelectorItem.weight }}
{{- end }}
{{- range $labelSelectorIndex, $labelSelectorItem := .Values.global.podAntiAffinityTermLabelSelector }}
- podAffinityTerm:
labelSelector:
matchExpressions:
{{- range $index, $item := $labelSelectorItem.labelSelector }}
- key: {{ $item.key }}
operator: {{ $item.operator }}
{{- if $item.values }}
values:
{{- $vals := split "," $item.values }}
{{- range $i, $v := $vals }}
- {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
topologyKey: {{ $labelSelectorItem.topologyKey }}
weight: {{ $labelSelectorItem.weight }}
{{- end }}
{{- end }}
64 changes: 64 additions & 0 deletions charts/deepflow/charts/stella-agent-ce/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "stella-agent-ce.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "stella-agent-ce.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "stella-agent-ce.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "stella-agent-ce.labels" -}}
helm.sh/chart: {{ include "stella-agent-ce.chart" . }}
{{ include "stella-agent-ce.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "stella-agent-ce.selectorLabels" -}}
app: deepflow
component: stella-agent-ce
app.kubernetes.io/name: {{ include "stella-agent-ce.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "stella-agent-ce.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "stella-agent-ce.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

This file was deleted.

Loading

0 comments on commit c960cf0

Please sign in to comment.