-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new polkadot-stps chart * automatically set the correct senders flags on stps-sender pods * fix stps port name * set different selector labels for stps-tps and stps-sender * lower scrapeTiemout as it cannot be higher than scrape interval * add tps args for kind to pass validation test * allow disabling tps deployment
- Loading branch information
1 parent
464ae09
commit e442795
Showing
11 changed files
with
394 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v2 | ||
name: polkadot-stps | ||
description: A Helm chart to deploy polkadot-stps | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "1.0.0" | ||
maintainers: | ||
- name: Parity | ||
url: https://github.com/paritytech/helm-charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Polkadot stps helm chart | ||
|
||
The helm chart installs [Polkadot STPS](https://github.com/paritytech/polkadot-stps). | ||
|
||
## Installing the chart | ||
|
||
```console | ||
helm repo add parity https://paritytech.github.io/helm-charts/ | ||
helm install polkadot-stps parity/polkadot-stps | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
serviceMonitor: | ||
enabled: false | ||
|
||
tps: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "polkadot-stps.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 "polkadot-stps.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 "polkadot-stps.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "polkadot-stps.labels" -}} | ||
helm.sh/chart: {{ include "polkadot-stps.chart" . }} | ||
{{ include "polkadot-stps.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- with .Values.extraLabels }} | ||
{{ toYaml . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "polkadot-stps.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "polkadot-stps.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
|
||
{{/* | ||
TPS Selector labels | ||
*/}} | ||
{{- define "polkadot-stps-tps.selectorLabels" -}} | ||
{{ include "polkadot-stps.selectorLabels" . }} | ||
stps/app: tps | ||
{{- end }} | ||
|
||
{{/* | ||
Sender Selector labels | ||
*/}} | ||
{{- define "polkadot-stps-sender.selectorLabels" -}} | ||
{{ include "polkadot-stps.selectorLabels" . }} | ||
stps/app: sender | ||
{{- end }} | ||
|
||
{{/* | ||
Define a regex matcher to check if the role is supported | ||
*/}} | ||
{{- define "stps.rolesSupported" -}} | ||
{{- "^(block-time|parachain-tracer)$" }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{{- if .Values.sender.enabled }} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "polkadot-stps.fullname" . }}-sender | ||
labels: | ||
{{- include "polkadot-stps.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.sender.replicas }} | ||
podManagementPolicy: Parallel | ||
serviceName: {{ include "polkadot-stps.fullname" . }} | ||
selector: | ||
matchLabels: | ||
{{- include "polkadot-stps-sender.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "polkadot-stps-sender.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: stps-sender | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.sender.image.repository }}:{{ .Values.sender.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.sender.image.pullPolicy }} | ||
command: ["/bin/sh"] | ||
args: | ||
- -c | ||
- | | ||
exec /usr/local/bin/sender \ | ||
--total-senders={{ .Values.sender.replicas }} \ | ||
--sender-index=${HOSTNAME##*-} \ | ||
{{- range $key, $val := .Values.sender.args }} | ||
--{{ $key }}={{ $val }} \ | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{{- if .Values.sender.enabled }} | ||
{{- if .Values.serviceMonitor.enabled }} | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: {{ include "polkadot-stps.fullname" . }} | ||
labels: | ||
{{- include "polkadot-stps.labels" . | nindent 4 }} | ||
spec: | ||
endpoints: | ||
- port: {{ .Values.service.portName }} | ||
{{- with .Values.serviceMonitor.interval }} | ||
interval: {{ . }} | ||
{{- end }} | ||
{{- with .Values.serviceMonitor.scrapeTimeout }} | ||
scrapeTimeout: {{ . }} | ||
{{- end }} | ||
honorLabels: true | ||
path: /metrics | ||
scheme: http | ||
{{- with .Values.serviceMonitor.targetLabels }} | ||
targetLabels: | ||
{{ toYaml .| nindent 6 }} | ||
{{- end}} | ||
jobLabel: "{{ .Release.Name }}" | ||
selector: | ||
matchLabels: | ||
{{- include "polkadot-stps-tps.selectorLabels" . | nindent 8 }} | ||
namespaceSelector: | ||
matchNames: | ||
- {{ .Release.Namespace }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{{- if .Values.tps.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "polkadot-stps.fullname" . }}-tps | ||
labels: | ||
{{- include "polkadot-stps.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "polkadot-stps-tps.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "polkadot-stps-tps.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: stps-tps | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.tps.image.repository }}:{{ .Values.tps.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.tps.image.pullPolicy }} | ||
args: | ||
{{- range $key, $val := .Values.tps.args }} | ||
- --{{ $key }}={{ $val }} | ||
{{- end }} | ||
{{- if .Values.tps.scrapeFromGenesis.enabled }} | ||
- --genesis | ||
{{- end }} | ||
{{- if .Values.tps.paraBlockFinality.enabled }} | ||
- --para-finality | ||
{{- end }} | ||
{{- if .Values.tps.prometheus.enabled }} | ||
- --prometheus | ||
- --prometheus-port={{ .Values.tps.prometheus.port }} | ||
ports: | ||
- name: prometheus | ||
containerPort: {{ .Values.tps.prometheus.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: prometheus | ||
readinessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: prometheus | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.sender.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "polkadot-stps.fullname" . }}-tps | ||
labels: | ||
{{- include "polkadot-stps-tps.selectorLabels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- name: {{ .Values.service.portName }} | ||
port: {{ .Values.service.port }} | ||
targetPort: {{ .Values.tps.prometheus.port }} | ||
protocol: TCP | ||
selector: | ||
{{- include "polkadot-stps-tps.selectorLabels" . | nindent 4 }} | ||
{{- end }} |
Oops, something went wrong.