-
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.
Merge branch 'main' into node-hashicorp-vault-keys
- Loading branch information
Showing
20 changed files
with
472 additions
and
9 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
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
|
||
add templates for: | ||
- configmaps | ||
- liveness and readiness probes | ||
- serviceMonitor | ||
- prometheusRules |
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
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
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
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,6 @@ | ||
apiVersion: v2 | ||
name: polkadot-introspector | ||
description: A Helm chart to deploy polkadot-introspector | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "0.1.0" |
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,39 @@ | ||
# Polkadot introspector helm chart | ||
|
||
The helm chart installs Polkadot introspector. The repo is located in https://github.com/paritytech/polkadot-introspector. | ||
|
||
## Installing the chart | ||
|
||
```console | ||
helm repo add parity https://paritytech.github.io/helm-charts/ | ||
helm install polkadot-introspector parity/polkadot-introspector | ||
``` | ||
|
||
## Parameters | ||
|
||
### Common parameters | ||
|
||
| Parameter | Description | Default | | ||
|---------------------|----------------------------------------------------------------------------|--------------------------------| | ||
| `nameOverride` | String to partially override node.fullname | `nil` | | ||
| `fullnameOverride` | String to fully override node.fullname | `nil` | | ||
| `imagePullSecrets` | Labels to add to all deployed objects | `[]` | | ||
| `podAnnotations` | Annotations to add to pods | `{}` | | ||
| `nodeSelector` | Node labels for pod assignment | `{}` | | ||
| `tolerations` | Tolerations for pod assignment | `[]` | | ||
| `affinity` | Affinity for pod assignment | `{}` | | ||
| `extraLabels` | Tolerations for pod assignment | `[]` | | ||
| `replicas` | Number of replicas | `1` | | ||
| `extraLabels ` | Extra labels to add in all resources | `{}` | | ||
| `serviceMonitor.enabled` | If true, creates a Prometheus Operator ServiceMonitor | `false` | | ||
| `serviceMonitor.internal` | Prometheus scrape interval | `1m` | | ||
| `serviceMonitor.scrapeTimeout` | Prometheus scrape timeout | `30s` | | ||
| `serviceMonitor.targetLabels` | Transfers labels on Kubernetes onto the metrics | `[]` | | ||
|
||
### Introspector parameters | ||
|
||
| Parameter | Description | Default | | ||
|-------------------------------|----------------------------------------------------------|--------------------------------------------------------------------| | ||
| `introspector.role` | Main subcommand to use by introspector | `block-time-monitor` | | ||
| `introspector.rpcNodes` | List of RPC nodes to connect when in block-time-monitor | `wss://rpc.polkadot.io:443,wss://kusama-rpc.polkadot.io:443` | | ||
| `introspector.prometheusPort` | Prometheus Port to expose the metrics | `9615` | |
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,26 @@ | ||
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 }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "polkadot-introspector.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.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 {{ .Release.Namespace }} svc -w {{ include "polkadot-introspector.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "polkadot-introspector.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 {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "polkadot-introspector.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") | ||
{{- if contains "block-time-monitor" .Values.introspector.role }} | ||
|
||
2. To view the block production time via different RPC nodes | ||
echo "Visit http://127.0.0.1:{{ .Values.introspector.prometheusPort }}/metrics to view the metrics" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.introspector.prometheusPort }}:{{ .Values.introspector.prometheusPort }} | ||
{{- 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,65 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "polkadot-introspector.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-introspector.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-introspector.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "polkadot-introspector.labels" -}} | ||
helm.sh/chart: {{ include "polkadot-introspector.chart" . }} | ||
{{ include "polkadot-introspector.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-introspector.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "polkadot-introspector.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "polkadot-introspector.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "polkadot-introspector.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- 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,69 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "polkadot-introspector.fullname" . }} | ||
labels: | ||
{{- include "polkadot-introspector.labels" . | nindent 4 }} | ||
spec: | ||
replicas: {{ .Values.replicas }} | ||
selector: | ||
matchLabels: | ||
{{- include "polkadot-introspector.selectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "polkadot-introspector.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: {{ include "polkadot-introspector.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: ["/bin/sh"] | ||
args: | ||
- -c | ||
- | | ||
exec polkadot-introspector \ | ||
{{- if eq .Values.introspector.role "block-time-monitor"}} | ||
block-time-monitor \ | ||
--ws {{ join "," .Values.introspector.rpcNodes }} \ | ||
prometheus --port {{ .Values.introspector.prometheusPort }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.introspector.prometheusPort }} | ||
protocol: TCP | ||
livenessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: http | ||
readinessProbe: | ||
httpGet: | ||
path: /metrics | ||
port: http | ||
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 }} |
Oops, something went wrong.