-
Notifications
You must be signed in to change notification settings - Fork 63
feat: add draft of k8s support #92
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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: commit-boost | ||
| description: A Helm chart for Kubernetes | ||
| type: application | ||
| version: 0.0.1 | ||
| appVersion: "v0.0.1-beta0" | ||
| maintainers: | ||
| - name: mxs | ||
| email: [email protected] |
This file contains hidden or 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,56 @@ | ||
| # commit-boost | ||
|
|
||
|    | ||
|
|
||
| A Helm chart for Kubernetes | ||
|
|
||
| ## Maintainers | ||
|
|
||
| | Name | Email | Url | | ||
| | ---- | ------ | --- | | ||
| | mxs | <[email protected]> | | | ||
|
|
||
| ## Values | ||
|
|
||
| | Key | Type | Default | Description | | ||
| |-----|------|---------|-------------| | ||
| | affinity | object | `{}` | | | ||
| | autoscaling.enabled | bool | `false` | | | ||
| | autoscaling.maxReplicas | int | `100` | | | ||
| | autoscaling.minReplicas | int | `1` | | | ||
| | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | ||
| | commitBoost.pbs.config | string | `"chain = \"Holesky\"\n\n[pbs]\nport = 18550\n\n[[relays]]\nurl = \"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net\"\n\n[metrics]\nprometheus_config = \"/config/prometheus.yaml\""` | | | ||
| | commitBoost.pbs.enable | bool | `true` | | | ||
| | fullnameOverride | string | `""` | | | ||
| | image.pullPolicy | string | `"IfNotPresent"` | | | ||
| | image.repository | string | `"ghcr.io/kilnfi/commit-boost-pbs"` | | | ||
aimxhaisse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | image.tag | string | `"55cdb"` | | | ||
| | imagePullSecrets | list | `[]` | | | ||
| | ingress.annotations | object | `{}` | | | ||
| | ingress.className | string | `""` | | | ||
| | ingress.enabled | bool | `false` | | | ||
| | ingress.hosts[0].host | string | `"chart-example.local"` | | | ||
| | ingress.hosts[0].paths[0].path | string | `"/"` | | | ||
| | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ||
| | ingress.tls | list | `[]` | | | ||
| | nameOverride | string | `""` | | | ||
| | nodeSelector | object | `{}` | | | ||
| | podAnnotations | object | `{}` | | | ||
| | podLabels | object | `{}` | | | ||
| | podSecurityContext | object | `{}` | | | ||
| | replicaCount | int | `1` | | | ||
| | resources | object | `{}` | | | ||
| | securityContext | object | `{}` | | | ||
| | service.metrics_port | int | `10000` | | | ||
| | service.port | int | `18550` | | | ||
aimxhaisse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| | service.type | string | `"ClusterIP"` | | | ||
| | serviceAccount.annotations | object | `{}` | | | ||
| | serviceAccount.automount | bool | `true` | | | ||
| | serviceAccount.create | bool | `true` | | | ||
| | serviceAccount.name | string | `""` | | | ||
| | tolerations | list | `[]` | | | ||
| | volumeMounts | list | `[]` | | | ||
| | volumes | list | `[]` | | | ||
|
|
||
| ---------------------------------------------- | ||
| Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) | ||
This file contains hidden or 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,3 @@ | ||
| * commit-boost config requires prometheus stuff | ||
| * rolling duration for logs needs to be set to never | ||
| * metrics server? |
This file contains hidden or 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,22 @@ | ||
| 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 "commit-boost.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 "commit-boost.fullname" . }}' | ||
| export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "commit-boost.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 "commit-boost.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}") | ||
| echo "Visit http://127.0.0.1:8080 to use your application" | ||
| kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT | ||
| {{- end }} |
This file contains hidden or 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,62 @@ | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "commit-boost.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 "commit-boost.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 "commit-boost.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "commit-boost.labels" -}} | ||
| helm.sh/chart: {{ include "commit-boost.chart" . }} | ||
| {{ include "commit-boost.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "commit-boost.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "commit-boost.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "commit-boost.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "commit-boost.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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,13 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "commit-boost.fullname" . }} | ||
| labels: | ||
| {{- include "commit-boost.labels" . | nindent 4 }} | ||
| data: | ||
| {{- if .Values.commitBoost.pbs.enable }} | ||
| config.pbs.toml: |- | ||
| {{ .Values.commitBoost.pbs.config | nindent 4 }} | ||
| {{- end }} | ||
|
|
||
| prometheus.yaml: "" |
This file contains hidden or 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,99 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "commit-boost.fullname" . }} | ||
| labels: | ||
| {{- include "commit-boost.labels" . | nindent 4 }} | ||
| spec: | ||
| {{- if not .Values.autoscaling.enabled }} | ||
| replicas: {{ .Values.replicaCount }} | ||
| {{- end }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "commit-boost.selectorLabels" . | nindent 6 }} | ||
| template: | ||
| metadata: | ||
| {{- with .Values.podAnnotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "commit-boost.labels" . | nindent 8 }} | ||
| {{- with .Values.podLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| serviceAccountName: {{ include "commit-boost.serviceAccountName" . }} | ||
| securityContext: | ||
| {{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
| containers: | ||
| {{- if .Values.commitBoost.pbs.enable }} | ||
| - name: {{ .Chart.Name }}-pbs | ||
| securityContext: | ||
| {{- toYaml .Values.securityContext | nindent 12 }} | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| ports: | ||
| - name: http-pbs | ||
| containerPort: {{ .Values.service.port }} | ||
| protocol: TCP | ||
| - name: http-metrics | ||
| containerPort: {{ .Values.service.metrics_port }} | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: /status | ||
| port: http-metrics | ||
| readinessProbe: | ||
| httpGet: | ||
| path: /status | ||
| port: http-metrics | ||
| resources: | ||
| {{- toYaml .Values.resources | nindent 12 }} | ||
| env: | ||
| - name: CB_CONFIG | ||
| value: /config/config.pbs.toml | ||
| - name: ROLLING_DURATION | ||
| value: never | ||
| - name: METRICS_SERVER | ||
| value: '{{ .Values.service.metrics_port }}' | ||
| - name: RUST_LOG | ||
| value: info | ||
| volumeMounts: | ||
| - name: commit-boost-configs | ||
| mountPath: /config | ||
| {{- with .Values.volumeMounts }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| {{- end }} | ||
| volumes: | ||
| - name: commit-boost-configs | ||
| configMap: | ||
| defaultMode: 0755 | ||
| name: {{ include "commit-boost.fullname" . }} | ||
| items: | ||
| - key: prometheus.yaml | ||
| path: prometheus.yaml | ||
| {{- if .Values.commitBoost.pbs.enable }} | ||
| - key: config.pbs.toml | ||
| path: config.pbs.toml | ||
| {{- end }} | ||
| {{- with .Values.volumes }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} |
This file contains hidden or 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,32 @@ | ||
| {{- if .Values.autoscaling.enabled }} | ||
| apiVersion: autoscaling/v2 | ||
| kind: HorizontalPodAutoscaler | ||
| metadata: | ||
| name: {{ include "commit-boost.fullname" . }} | ||
| labels: | ||
| {{- include "commit-boost.labels" . | nindent 4 }} | ||
| spec: | ||
| scaleTargetRef: | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| name: {{ include "commit-boost.fullname" . }} | ||
| minReplicas: {{ .Values.autoscaling.minReplicas }} | ||
| maxReplicas: {{ .Values.autoscaling.maxReplicas }} | ||
| metrics: | ||
| {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: cpu | ||
| target: | ||
| type: Utilization | ||
| averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} | ||
| {{- end }} | ||
| {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
| - type: Resource | ||
| resource: | ||
| name: memory | ||
| target: | ||
| type: Utilization | ||
| averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or 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,61 @@ | ||
| {{- if .Values.ingress.enabled -}} | ||
| {{- $fullName := include "commit-boost.fullname" . -}} | ||
| {{- $svcPort := .Values.service.port -}} | ||
| {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} | ||
| {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} | ||
| {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} | ||
| apiVersion: networking.k8s.io/v1 | ||
| {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} | ||
| apiVersion: networking.k8s.io/v1beta1 | ||
| {{- else -}} | ||
| apiVersion: extensions/v1beta1 | ||
| {{- end }} | ||
| kind: Ingress | ||
| metadata: | ||
| name: {{ $fullName }} | ||
| labels: | ||
| {{- include "commit-boost.labels" . | nindent 4 }} | ||
| {{- with .Values.ingress.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} | ||
| ingressClassName: {{ .Values.ingress.className }} | ||
| {{- end }} | ||
| {{- if .Values.ingress.tls }} | ||
| tls: | ||
| {{- range .Values.ingress.tls }} | ||
| - hosts: | ||
| {{- range .hosts }} | ||
| - {{ . | quote }} | ||
| {{- end }} | ||
| secretName: {{ .secretName }} | ||
| {{- end }} | ||
| {{- end }} | ||
| rules: | ||
| {{- range .Values.ingress.hosts }} | ||
| - host: {{ .host | quote }} | ||
| http: | ||
| paths: | ||
| {{- range .paths }} | ||
| - path: {{ .path }} | ||
| {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} | ||
| pathType: {{ .pathType }} | ||
| {{- end }} | ||
| backend: | ||
| {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} | ||
| service: | ||
| name: {{ $fullName }} | ||
| port: | ||
| number: {{ $svcPort }} | ||
| {{- else }} | ||
| serviceName: {{ $fullName }} | ||
| servicePort: {{ $svcPort }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.