diff --git a/charts/assertoor/Chart.yaml b/charts/assertoor/Chart.yaml index 7e91249d..203ebb39 100644 --- a/charts/assertoor/Chart.yaml +++ b/charts/assertoor/Chart.yaml @@ -6,7 +6,7 @@ home: https://github.com/ethpandaops/assertoor sources: - https://github.com/ethpandaops/assertoor type: application -version: 0.0.2 +version: 0.0.3 appVersion: "1.0.0" maintainers: - name: pk910 diff --git a/charts/assertoor/README.md b/charts/assertoor/README.md index 891ffed5..77e3be7f 100644 --- a/charts/assertoor/README.md +++ b/charts/assertoor/README.md @@ -1,7 +1,7 @@ # assertoor -![Version: 0.0.2](https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.0.3](https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Testing tool that is capable of doing actions and checking conditions on ethereum pos networks. @@ -69,7 +69,8 @@ assertoorTests: | extraVolumes | list | `[]` | Additional volumes | | fullnameOverride | string | `""` | Overrides the chart's computed fullname | | globalVariables | object | `{"walletPrivkey":"feedbeef12340000feedbeef12340000feedbeef12340000feedbeef12340000"}` | global assertoor variables -- global variables are passed to all tests. | -| httpPort | int | `8080` | HTTP port for assertoor interface | +| httpPort | int | `8082` | HTTP port for assertoor interface | +| httpPortAdmin | int | `8080` | HTTP port for assertoor admin interface | | image.pullPolicy | string | `"IfNotPresent"` | assertoor container pull policy | | image.repository | string | `"ethpandaops/assertoor"` | assertoor container image repository | | image.tag | string | `"latest"` | assertoor container image tag | @@ -78,6 +79,11 @@ assertoorTests: | ingress.hosts[0].host | string | `"chart-example.local"` | | | ingress.hosts[0].paths | list | `[]` | | | ingress.tls | list | `[]` | Ingress TLS | +| ingressAdmin.annotations | object | `{}` | Annotations for Ingress | +| ingressAdmin.enabled | bool | `false` | Ingress resource for the HTTP API -- This is the admin interface -- Please ensure you put this behind authorization | +| ingressAdmin.hosts[0].host | string | `"chart-example-admin.local"` | | +| ingressAdmin.hosts[0].paths | list | `[]` | | +| ingressAdmin.tls | list | `[]` | Ingress TLS | | initContainers | list | `[]` | Additional init containers | | nameOverride | string | `""` | Overrides the chart's name | | nodeSelector | object | `{}` | Node selector for pods | @@ -85,7 +91,6 @@ assertoorTests: | podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created | | podLabels | object | `{}` | Pod labels | | priorityClassName | string | `nil` | Pod priority class | -| publicHttpPort | int | `8082` | HTTP port for assertoor public interface | | resources | object | `{}` | Resource requests and limits | | securityContext | object | See `values.yaml` | The security context for pods | | service.type | string | `"ClusterIP"` | Service type | diff --git a/charts/assertoor/templates/_helpers.tpl b/charts/assertoor/templates/_helpers.tpl index 5982a775..a903000d 100644 --- a/charts/assertoor/templates/_helpers.tpl +++ b/charts/assertoor/templates/_helpers.tpl @@ -62,9 +62,9 @@ Create the name of the service account to use {{- end }} {{- define "assertoor.httpPort" -}} -{{- printf "8080" -}} +{{- printf "8082" -}} {{- end -}} -{{- define "assertoor.publicHttpPort" -}} -{{- printf "8082" -}} +{{- define "assertoor.httpPortAdmin" -}} +{{- printf "8080" -}} {{- end -}} diff --git a/charts/assertoor/templates/deployment.yaml b/charts/assertoor/templates/deployment.yaml index 4069329c..fe0c6f7f 100644 --- a/charts/assertoor/templates/deployment.yaml +++ b/charts/assertoor/templates/deployment.yaml @@ -64,8 +64,8 @@ spec: - name: http containerPort: {{ include "assertoor.httpPort" . }} protocol: TCP - - name: public-http - containerPort: {{ include "assertoor.publicHttpPort" . }} + - name: http-admin + containerPort: {{ include "assertoor.httpPortAdmin" . }} protocol: TCP resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/assertoor/templates/ingress.yaml b/charts/assertoor/templates/ingress.yaml index be5aa9c0..255b5667 100644 --- a/charts/assertoor/templates/ingress.yaml +++ b/charts/assertoor/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "assertoor.fullname" . -}} -{{- $svcPort := include "assertoor.httpPort" . -}} +{{- $svcPortPublic := include "assertoor.httpPort" . -}} {{- 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}} @@ -51,10 +51,72 @@ spec: service: name: {{ $fullName }} port: - number: {{ $svcPort }} + number: {{ $svcPortPublic }} {{- else }} serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} + servicePort: {{ $svcPortPublic }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} +--- +{{- if .Values.ingressAdmin.enabled -}} +{{- $fullName := include "assertoor.fullname" . -}} +{{- $svcPortAdmin := include "assertoor.httpPortAdmin" . -}} +{{- if and .Values.ingressAdmin.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingressAdmin.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingressAdmin.annotations "kubernetes.io/ingress.class" .Values.ingressAdmin.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 }}-admin + labels: + {{- include "assertoor.labels" . | nindent 4 }} + {{- with .Values.ingressAdmin.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingressAdmin.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingressAdmin.className }} + {{- end }} + {{- if .Values.ingressAdmin.tls }} + tls: + {{- range .Values.ingressAdmin.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingressAdmin.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: {{ $svcPortAdmin }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPortAdmin }} {{- end }} {{- end }} {{- end }} diff --git a/charts/assertoor/templates/service.yaml b/charts/assertoor/templates/service.yaml index 162bc6d3..4537b25a 100644 --- a/charts/assertoor/templates/service.yaml +++ b/charts/assertoor/templates/service.yaml @@ -11,10 +11,10 @@ spec: targetPort: http protocol: TCP name: http - - port: {{ include "assertoor.publicHttpPort" . }} - targetPort: public-http + - port: {{ include "assertoor.httpPortAdmin" . }} + targetPort: http-admin protocol: TCP - name: public-http + name: http-admin {{- if .Values.extraPorts }} {{ toYaml .Values.extraPorts | nindent 4}} {{- end }} diff --git a/charts/assertoor/templates/tests/test-connection.yaml b/charts/assertoor/templates/tests/test-connection.yaml index cfd651b0..c24424e1 100644 --- a/charts/assertoor/templates/tests/test-connection.yaml +++ b/charts/assertoor/templates/tests/test-connection.yaml @@ -15,5 +15,5 @@ spec: - --location - --request - GET - - '{{ include "assertoor.fullname" . }}:{{ include "assertoor.httpPort" . }}/' + - '{{ include "assertoor.fullname" . }}:{{ include "assertoor.httpPortAdmin" . }}/' restartPolicy: Never diff --git a/charts/assertoor/values.yaml b/charts/assertoor/values.yaml index f05d5e64..44f18ad8 100644 --- a/charts/assertoor/values.yaml +++ b/charts/assertoor/values.yaml @@ -26,7 +26,7 @@ ingress: annotations: {} # kubernetes.io/ingress.class: nginx # kubernetes.io/tls-acme: "true" - # -- Ingress host + # -- Ingress host for public service hosts: - host: chart-example.local paths: [] @@ -36,6 +36,25 @@ ingress: # hosts: # - chart-example.local +ingressAdmin: + # -- Ingress resource for the HTTP API + # -- This is the admin interface + # -- Please ensure you put this behind authorization + enabled: false + # -- Annotations for Ingress + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + # -- Ingress host for admin service + hosts: + - host: chart-example-admin.local + paths: [] + # -- Ingress TLS + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + service: # -- Service type type: ClusterIP @@ -135,10 +154,10 @@ extraEnv: [] # -- HTTP port for assertoor interface -httpPort: 8080 +httpPort: 8082 -# -- HTTP port for assertoor public interface -publicHttpPort: 8082 +# -- HTTP port for assertoor admin interface +httpPortAdmin: 8080 # -- An array of endpoints to use for assertoor # -- executionUrl & consensusUrl are the only required fields @@ -182,10 +201,10 @@ config: | web: server: host: "0.0.0.0" - port: {{ .Values.httpPort }} + port: {{ .Values.httpPortAdmin }} publicServer: host: "0.0.0.0" - port: {{ .Values.publicHttpPort }} + port: {{ .Values.httpPort }} frontend: enabled: {{ .Values.assertoorFrontendEnabled }} api: