Skip to content

Commit 1d4c3c5

Browse files
committed
helm chart
sentinel-dashboard
1 parent beb5365 commit 1d4c3c5

File tree

10 files changed

+342
-0
lines changed

10 files changed

+342
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v1
2+
name: sentinel-dashboard
3+
description: alibabab sentinel-dashboard chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
version: 0.1.0
18+
19+
# This is the version number of the application being deployed. This version number should be
20+
# incremented each time you make changes to the application.
21+
appVersion: v1.6.3
22+
maintainers:
23+
24+
name: Hao Kailin
25+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# sentinel-dashboard
2+
3+
## 功能介绍:
4+
5+
功能: alibabab开源的sentinel,限流工具
6+
7+
[https://github.com/alibaba/Sentinel](https://github.com/alibaba/Sentinel)
8+
9+
## 安装方式:
10+
ip-address请换成kubernetes集群master或node的ip
11+
```shell
12+
helm install sentinel-dashboard sentinel-dashboard --set DASHBOARD_SERVER="ip-address:30080"
13+
```
14+
15+
运行后将看到如下信息
16+
```shell
17+
NAME: sentinel-dashboard
18+
LAST DEPLOYED: 2019-08-29 16:50:14.456808972 +0800 CST m=+0.116678773
19+
NAMESPACE: default
20+
STATUS: deployed
21+
22+
NOTES:
23+
alibaba sentinel-dashboard
24+
1. Get the application URL by running these commands:
25+
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services sentinel-dashboard)
26+
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
27+
echo http://$NODE_IP:$NODE_PORT
28+
```
29+
30+
查看kubernetes对象
31+
```shell
32+
➜ kubectl get pods
33+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
34+
sentinel-dashboard-5548f9fbd8-5ltpl 1/1 Running 0 4m35s 10.244.1.26 cbov10-sso55-114 <none> <none>
35+
36+
➜ kubectl get deployments
37+
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
38+
sentinel-dashboard 1/1 1 1 5m6s sentinel-dashboard haoprogrammer/sentinel-dashboard:v1.6.3 app.kubernetes.io/instance=sentinel-dashboard,app.kubernetes.io/name=sentinel-dashboard
39+
➜ kubectl get service
40+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
41+
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 132d
42+
sentinel-dashboard NodePort 10.109.150.179 <none> 8080:30080/TCP 5m35s
43+
```
44+
45+
46+
## Example
47+
本例通过NodePort访问服务,如下图所示
48+
- 访问地址(监控页面): `<nodeip:nodeport>`
49+
- 默认用户名密码均为sentinel
50+
![img](./images/sentinel-login.png)
51+
52+
53+
54+
### 3. 其他备注
55+
56+
#### 环境变量说明
57+
DASHBOARD_SERVER 指定Sentinel-dashboard访问ip:port
58+
JAVA_OPTS 指定其他 JVM 参数,如日志路径:-Dcsp.sentinel.log.dir=/usr/local/Sentinel/logs/csp/
59+
60+
#### 其他 JVM 可用参数
61+
参看官方文档
62+
[Sentinel 控制台](https://github.com/alibaba/Sentinel/wiki/%E6%8E%A7%E5%88%B6%E5%8F%B0)
63+
[参数列表](https://github.com/alibaba/Sentinel/wiki/%E5%90%AF%E5%8A%A8%E9%85%8D%E7%BD%AE%E9%A1%B9#%E5%8F%82%E6%95%B0%E5%88%97%E8%A1%A8)
64+
65+
66+
#### docker镜像
67+
68+
[https://cloud.docker.com/u/haoprogrammer/repository/docker/haoprogrammer/sentinel-dashboard](https://cloud.docker.com/u/haoprogrammer/repository/docker/haoprogrammer/sentinel-dashboard)
1.81 MB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
alibaba sentinel-dashboard
2+
1. Get the application URL by running these commands:
3+
{{- if .Values.ingress.enabled }}
4+
{{- range $host := .Values.ingress.hosts }}
5+
{{- range .paths }}
6+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
7+
{{- end }}
8+
{{- end }}
9+
{{- else if contains "NodePort" .Values.service.type }}
10+
export NODE_PORT=$(kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "sentinel-dashboard.fullname" . }})
11+
export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
12+
echo http://$NODE_IP:$NODE_PORT
13+
{{- else if contains "LoadBalancer" .Values.service.type }}
14+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
15+
You can watch the status of by running 'kubectl get svc -w {{ template "sentinel-dashboard.fullname" . }}'
16+
export SERVICE_IP=$(kubectl get svc {{ template "sentinel-dashboard.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
17+
echo http://$SERVICE_IP:{{ .Values.service.port }}
18+
{{- else if contains "ClusterIP" .Values.service.type }}
19+
export POD_NAME=$(kubectl get pods -l "app={{ template "sentinel-dashboard.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl port-forward $POD_NAME 8080:80
22+
{{- end }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "sentinel-dashboard.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "sentinel-dashboard.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "sentinel-dashboard.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "sentinel-dashboard.labels" -}}
38+
app.kubernetes.io/name: {{ include "sentinel-dashboard.name" . }}
39+
helm.sh/chart: {{ include "sentinel-dashboard.chart" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end -}}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apiVersion: apps/v1beta2
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "sentinel-dashboard.fullname" . }}
5+
labels:
6+
{{ include "sentinel-dashboard.labels" . | indent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app.kubernetes.io/name: {{ include "sentinel-dashboard.name" . }}
12+
app.kubernetes.io/instance: {{ .Release.Name }}
13+
template:
14+
metadata:
15+
labels:
16+
app.kubernetes.io/name: {{ include "sentinel-dashboard.name" . }}
17+
app.kubernetes.io/instance: {{ .Release.Name }}
18+
spec:
19+
containers:
20+
- name: {{ .Chart.Name }}
21+
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
22+
imagePullPolicy: {{ .Values.image.pullPolicy }}
23+
env:
24+
- name: DASHBOARD_SERVER
25+
value: "{{ .Values.DASHBOARD_SERVER }}"
26+
- name: JAVA_OPTS
27+
value: "{{ .Values.JAVA_OPTS }}"
28+
29+
ports:
30+
- name: http
31+
containerPort: 8080
32+
protocol: TCP
33+
livenessProbe:
34+
httpGet:
35+
path: /
36+
port: http
37+
readinessProbe:
38+
httpGet:
39+
path: /
40+
port: http
41+
resources:
42+
{{ toYaml .Values.resources | indent 12 }}
43+
{{- with .Values.nodeSelector }}
44+
nodeSelector:
45+
{{ toYaml . | indent 8 }}
46+
{{- end }}
47+
{{- with .Values.affinity }}
48+
affinity:
49+
{{ toYaml . | indent 8 }}
50+
{{- end }}
51+
{{- with .Values.tolerations }}
52+
tolerations:
53+
{{ toYaml . | indent 8 }}
54+
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "sentinel-dashboard.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
apiVersion: networking.k8s.io/v1beta1
5+
kind: Ingress
6+
metadata:
7+
name: {{ $fullName }}
8+
labels:
9+
{{ include "sentinel-dashboard.labels" . | indent 4 }}
10+
{{- with .Values.ingress.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- if .Values.ingress.tls }}
16+
tls:
17+
{{- range .Values.ingress.tls }}
18+
- hosts:
19+
{{- range .hosts }}
20+
- {{ . | quote }}
21+
{{- end }}
22+
secretName: {{ .secretName }}
23+
{{- end }}
24+
{{- end }}
25+
rules:
26+
{{- range .Values.ingress.hosts }}
27+
- host: {{ .host | quote }}
28+
http:
29+
paths:
30+
{{- range .paths }}
31+
- path: {{ . }}
32+
backend:
33+
serviceName: {{ $fullName }}
34+
servicePort: {{ $svcPort }}
35+
{{- end }}
36+
{{- end }}
37+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ template "sentinel-dashboard.fullname" . }}
5+
labels:
6+
{{ include "sentinel-dashboard.labels" . | indent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
nodePort: {{ .Values.service.nodePort }}
15+
selector:
16+
app.kubernetes.io/name: {{ include "sentinel-dashboard.name" . }}
17+
app.kubernetes.io/instance: {{ .Release.Name }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Default values for sentinel-dashboard.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
replicaCount: 1
6+
7+
image:
8+
repository: haoprogrammer/sentinel-dashboard
9+
#pullPolicy: IfNotPresent
10+
pullPolicy: Always
11+
12+
nameOverride: ""
13+
fullnameOverride: ""
14+
DASHBOARD_SERVER: "127.0.0.1:30080"
15+
#Add configuration item if necessary
16+
JAVA_OPTS: "-Dcsp.sentinel.log.dir=/usr/local/Sentinel/logs/csp/"
17+
18+
service:
19+
type: NodePort
20+
port: 8080
21+
nodePort: 30080
22+
23+
ingress:
24+
enabled: false
25+
annotations: {}
26+
# kubernetes.io/ingress.class: nginx
27+
# kubernetes.io/tls-acme: "true"
28+
hosts:
29+
- host: chart-example.local
30+
paths: []
31+
32+
tls: []
33+
# - secretName: chart-example-tls
34+
# hosts:
35+
# - chart-example.local
36+
37+
resources: {}
38+
# We usually recommend not to specify default resources and to leave this as a conscious
39+
# choice for the user. This also increases chances charts run on environments with little
40+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
41+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
42+
# limits:
43+
# cpu: 100m
44+
# memory: 128Mi
45+
# requests:
46+
# cpu: 100m
47+
# memory: 128Mi
48+
49+
nodeSelector: {}
50+
51+
tolerations: []
52+
53+
affinity: {}

0 commit comments

Comments
 (0)