Move charts to chart directory
This commit is contained in:
62
charts/user-monitoring-demo/templates/_helpers.tpl
Normal file
62
charts/user-monitoring-demo/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "user-monitoring-demo.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 "user-monitoring-demo.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 "user-monitoring-demo.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "user-monitoring-demo.labels" -}}
|
||||
helm.sh/chart: {{ include "user-monitoring-demo.chart" . }}
|
||||
{{ include "user-monitoring-demo.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "user-monitoring-demo.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "user-monitoring-demo.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "user-monitoring-demo.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "user-monitoring-demo.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
21
charts/user-monitoring-demo/templates/demo-deploy.yaml
Normal file
21
charts/user-monitoring-demo/templates/demo-deploy.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
labels:
|
||||
app: example-web-python
|
||||
name: example-web-python
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example-web-python
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example-web-python
|
||||
spec:
|
||||
containers:
|
||||
- image: quay.io/acend/example-web-python
|
||||
imagePullPolicy: Always
|
||||
name: example-web-python
|
||||
restartPolicy: Always
|
||||
21
charts/user-monitoring-demo/templates/demo-role.yaml
Normal file
21
charts/user-monitoring-demo/templates/demo-role.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
# Source: user-monitoring/templates/user-prom-role.yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: prometheus-{{ .Values.user }}
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- services
|
||||
- endpoints
|
||||
- pods
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
- configmaps
|
||||
verbs: ["get"]
|
||||
- apiGroups:
|
||||
- networking.k8s.io
|
||||
resources:
|
||||
- ingresses
|
||||
verbs: ["get", "list", "watch"]
|
||||
12
charts/user-monitoring-demo/templates/demo-rolebinding.yaml
Normal file
12
charts/user-monitoring-demo/templates/demo-rolebinding.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: prometheus
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: prometheus-{{ .Values.user }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: prometheus-{{ .Values.user }}
|
||||
namespace: {{ .Values.user }}-monitoring
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: example-web-python
|
||||
user: {{ .Values.user }}
|
||||
name: example-web-python-monitor
|
||||
spec:
|
||||
endpoints:
|
||||
- interval: 30s
|
||||
port: http
|
||||
scheme: http
|
||||
path: /metrics
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example-web-python
|
||||
15
charts/user-monitoring-demo/templates/demo-svc.yaml
Normal file
15
charts/user-monitoring-demo/templates/demo-svc.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: example-web-python
|
||||
labels:
|
||||
app: example-web-python
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 5000
|
||||
protocol: TCP
|
||||
targetPort: 5000
|
||||
selector:
|
||||
app: example-web-python
|
||||
type: ClusterIP
|
||||
Reference in New Issue
Block a user