Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronized prometheus-pingmesh-exporter charts template 1.0.1 #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions submitted/prometheus-pingmesh-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v2
appVersion: 1.0.1
description: Prometheus Pingmesh Exporter
home: https://github.com/kubeservice-stack/pingmesh-agent
keywords:
- prometheus
- pimgmesh
- monitoring
maintainers:
- email: dongjiang1989@126.com
name: dongjiang
name: prometheus-pingmesh-exporter
sources:
- https://github.com/kubeservice-stack/pingmesh-agent
type: application
version: 1.0.1
96 changes: 96 additions & 0 deletions submitted/prometheus-pingmesh-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Prometheus Pingmesh Exporter

[pingmesh architecture](https://kubeservice.cn/2022/10/21/devops-k8s-pingmesh/)

An Prometheus exporter that exposes information from ping message.

This chart creates a [Pingmesh Exporter](https://github.com/kubeservice-stack/pingmesh-agent) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.

## Prerequisites

- Kubernetes 1.8+ with Beta APIs enabled

## Add Helm repository

```console
helm repo add kubeservice-stack https://kubeservice-stack.github.io/kubservice-charts
helm repo update
```

_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Chart

```console
helm install [RELEASE_NAME] prometheus-pingmesh-exporter
```

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```console
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

## From 0.22.0 to 1.0.1

```console
helm upgrade [RELEASE_NAME] prometheus-pingmesh-exporter --version 1.0.1
```

## Configuration

See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:

```console
# Helm 2
$ helm inspect values prometheus-pingmesh-exporter

# Helm 3
$ helm show values prometheus-pingmesh-exporter
```

See [kubeservice-stack/pingmesh-agent/README.md](https://github.com/kubeservice-stack/pingmesh-agent) for further information.

## pingmesh pinglist configuration

```console
setting:
# the maximum amount of concurrent to ping, uint
concurrent_limit: 20
# interval to exec ping in seconds, float
interval: 60.0
# The maximum delay time to ping in milliseconds, float
delay: 200
# ping timeout in seconds, float
timeout: 2.0
# send ip addr
source_ip_addr: 0.0.0.0
# send ip protocal
ip_protocol: ip6

mesh:
add-ping-public:
name: ping-public-demo
type: OtherIP
ips :
- 127.0.0.1
- 8.8.8.8
- www.baidu.com
- kubernetes.default.svc.cluster.local
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kind: DaemonSet
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extraEnv:
HTTP_PROXY: "http://superproxy.com:3128"
NO_PROXY: "localhost,127.0.0.1"
9 changes: 9 additions & 0 deletions submitted/prometheus-pingmesh-exporter/ci/hostAliases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hostAliases:
- ip: 192.168.1.1
hostNames:
- test.example.com
- another.example.net
- ip: 192.168.1.2
hostNames:
- test2.example.com
- another2.example.net
2 changes: 2 additions & 0 deletions submitted/prometheus-pingmesh-exporter/ci/ingress-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ingress:
enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
networkPolicy:
enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secretConfig: true
30 changes: 30 additions & 0 deletions submitted/prometheus-pingmesh-exporter/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
See https://github.com/kubeservice-stack/pingmesh-agent for how to configure Prometheus and the pingmesh Exporter.

1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}

{{ if and .Values.ingress.className (semverCompare "<=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
You've set ".Values.ingressClassName" but it's not supported by your Kubernetes version!
Therefore the option was not added and the old ingress annotation was set.
{{ end }}

{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prometheus-pingmesh-exporter.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} svc -w {{ include "prometheus-pingmesh-exporter.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} {{ include "prometheus-pingmesh-exporter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} -l "app.kubernetes.io/name={{ include "prometheus-pingmesh-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ template "prometheus-pingmesh-exporter.namespace" . }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
83 changes: 83 additions & 0 deletions submitted/prometheus-pingmesh-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "prometheus-pingmesh-exporter.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 "prometheus-pingmesh-exporter.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 "prometheus-pingmesh-exporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "prometheus-pingmesh-exporter.labels" -}}
helm.sh/chart: {{ include "prometheus-pingmesh-exporter.chart" . }}
release: metrics
{{ include "prometheus-pingmesh-exporter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "prometheus-pingmesh-exporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "prometheus-pingmesh-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

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

{{/*
Return the appropriate apiVersion for rbac.
*/}}
{{- define "rbac.apiVersion" -}}
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1" }}
{{- print "rbac.authorization.k8s.io/v1" -}}
{{- else -}}
{{- print "rbac.authorization.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}


{{- define "prometheus-pingmesh-exporter.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
14 changes: 14 additions & 0 deletions submitted/prometheus-pingmesh-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if and .Values.config (eq .Values.configExistingSecretName "") }}
apiVersion: v1
kind: {{ if .Values.secretConfig -}} Secret {{- else -}} ConfigMap {{- end }}
metadata:
name: {{ template "prometheus-pingmesh-exporter.fullname" . }}
namespace: {{ template "prometheus-pingmesh-exporter.namespace" . }}
labels:
{{- include "prometheus-pingmesh-exporter.labels" . | nindent 4 }}
{{ if .Values.secretConfig -}} stringData: {{- else -}} data: {{- end }}
pingmesh.yaml: |
{{ toYaml .Values.config | indent 4 }}
pinglist.yaml: |
{{ toYaml .Values.pinglistConfig | indent 4 }}
{{- end }}
Loading