Skip to content

Commit

Permalink
Fix: helm chart routing does not find openvasd
Browse files Browse the repository at this point in the history
To fix the issue that the routing definition cannot find the service
openvasd it has to be defined on post-install, post-upgrade instead of
on-deployment.
  • Loading branch information
nichtsfrei committed Feb 20, 2025
1 parent 8ee69d9 commit f9cd1ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 5 additions & 6 deletions charts/openvasd/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
This deployment takes a while.

To verify if the rollout is complete, you can use:
$ kubectl rollout status --watch --timeout 600s deployment/openvasd
$ kubectl rollout status --watch --timeout 600s deployment/openvasd -n {{ .Release.Namespace }}

After the deployment is finished it should be available via:
{{- if .Values.routing.enabled -}}
{{- $svcPort := .Values.service.port -}}
{{- $apiKey := .Values.openvasd.apikey }}
{{- if eq .Values.openvasd.tls.certificates.deploy_server true }}
{{- if eq .Values.openvasd.tls.certificates.deploy_client true }}
$ curl -vk -x HEAD https://localhost/ --key yourclientkey.rsa --cert yourclientkey.pem
$ curl -vk -X HEAD https://localhost/ --key yourclientkey.rsa --cert yourclientkey.pem
{{- else }}
$ curl -vk -x HEAD https://localhost/ -H "X-API-KEY: {{ .apiKey }}"
$ curl -vk -X HEAD https://localhost/ -H "X-API-KEY: {{ .apiKey }}"
{{- end }}
{{- else }}
$ curl -vk -x HEAD https://localhost/ -H "X-API-KEY: {{ .apiKey }}"
$ curl -vk -X HEAD https://localhost/ -H "X-API-KEY: {{ .apiKey }}"
{{- end }}
{{- else }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "openvasd.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
echo "Visit http://127.0.0.1:8080 to use your application"
{{- end }}
3 changes: 3 additions & 0 deletions charts/openvasd/templates/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ kind: IngressRouteTCP
metadata:
name: openvasd-route
namespace: {{ .Release.Namespace }}
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
{{- if eq .Values.openvasd.tls.certificates.deploy_server true }}
spec:
entryPoints:
Expand Down
3 changes: 2 additions & 1 deletion charts/openvasd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ openvasd:
# Sets the log level and changes the verbosity of openvasd.
# Can be set to TRACE, DEBUG, INFO, WARNING, ERROR
# openvasd is provided by the openvas image
loglevel: TRACE
loglevel: DEBUG
# When set it will be the used API-KEY. It is not required when deploy_client is true.
# apikey: changeme
# can be either service: fill openvasd capabilities, service_notus: only notus
Expand Down Expand Up @@ -94,6 +94,7 @@ securityContext:

service:
type: ClusterIP
# type: LoadBalancer
port: 443

# enables routing.yaml
Expand Down

0 comments on commit f9cd1ee

Please sign in to comment.