diff --git a/00_db-statefulset.yaml b/00_db-statefulset.yaml new file mode 100644 index 0000000..a864eec --- /dev/null +++ b/00_db-statefulset.yaml @@ -0,0 +1,89 @@ +apiVersion: v1 +kind: Service +metadata: + name: glvd-database + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: database +spec: + selector: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: database + ports: + - protocol: TCP + port: 5432 + name: postgres + targetPort: postgres + type: ClusterIP + clusterIP: None +--- +# apiVersion: v1 +# kind: Secret +# metadata: +# name: postgres-credentials +# labels: +# app.kubernetes.io/name: glvd +# gardenlinux.io/glvd-component: database +# stringData: +# username: glvd +# password: change-me-i-am-not-secure123 +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: glvd-database + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: database +spec: + replicas: 1 + serviceName: "glvd-database" + selector: + matchLabels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: database + template: + metadata: + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: database + spec: + containers: + - image: ghcr.io/gardenlinux/glvd-postgres:latest + name: glvd-postgres + ports: + - containerPort: 5432 + protocol: TCP + name: postgres + env: + - name: POSTGRES_DATABASE + value: glvd + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres-credentials + key: username + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-credentials + key: password + - name: POSTGRES_HOST + value: glvd-postgres + - name: POSTGRES_PORT + value: "5432" + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumeMounts: + - mountPath: "/var/lib/postgresql/data" + name: postgres-storage + volumeClaimTemplates: + - metadata: + name: postgres-storage + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: 'default' diff --git a/01_glvd-deployment.yaml b/01_glvd-deployment.yaml new file mode 100644 index 0000000..4142bbb --- /dev/null +++ b/01_glvd-deployment.yaml @@ -0,0 +1,118 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: glvd-config + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker +data: + connectionString: jdbc:postgresql://glvd-database-0.glvd-database:5432/glvd + databaseName: glvd +--- +apiVersion: v1 +kind: Service +metadata: + name: glvd + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker +spec: + ports: + - port: 8080 + protocol: TCP + targetPort: glvd + selector: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: glvd + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker + template: + metadata: + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-tracker + spec: + containers: + - image: ghcr.io/gardenlinux/glvd-api:latest + name: glvd-api + # resources: + # requests: + # cpu: "1" + # memory: "2Gi" + # limits: + # cpu: "2" + # memory: "4Gi" + ports: + - containerPort: 8080 + protocol: TCP + name: glvd + env: + # cf https://github.com/spring-projects/spring-lifecycle-smoke-tests/tree/main/data/data-jpa#prevent-early-database-interaction + - name: SPRING_DATASOURCE_URL + valueFrom: + configMapKeyRef: + name: glvd-config + key: connectionString + - name: SPRING_DATASOURCE_USERNAME + valueFrom: + secretKeyRef: + name: postgres-credentials + key: username + - name: SPRING_DATASOURCE_PASSWORD + valueFrom: + secretKeyRef: + name: postgres-credentials + key: password + - name: SPRING_JPA_DATABASEPLATFORM + value: "org.hibernate.dialect.PostgreSQLDialect" + - name: SPRING_JPA_PROPERTIES_HIBERNATE_BOOT_ALLOW_JDBC_METADATA_ACCESS + value: "false" + - name: SPRING_JPA_HIBERNATE_DDLAUTO + value: "none" + - name: SPRING_SQL_INIT_MODE + value: "never" + livenessProbe: + httpGet: + path: "/actuator/health/liveness" + port: 8080 + readinessProbe: + httpGet: + path: "/actuator/health/readiness" + port: 8080 + +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: glvd-api-ingress + annotations: + cert.gardener.cloud/purpose: managed +spec: + rules: + - host: glvd.ingress.glvd.gardnlinux.shoot.canary.k8s-hana.ondemand.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: glvd + port: + number: 8080 + tls: + - hosts: + - glvd.ingress.glvd.gardnlinux.shoot.canary.k8s-hana.ondemand.com + secretName: glvd-ingress-tls diff --git a/02_ingestion-job.yaml b/02_ingestion-job.yaml new file mode 100644 index 0000000..9ec0653 --- /dev/null +++ b/02_ingestion-job.yaml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: glvd-ingestion + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-ingestion +data: + databaseName: glvd + databaseHost: glvd-database-0.glvd-database + databasePort: "5432" +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: glvd-ingestion + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-ingestion +spec: + template: + metadata: + labels: + app.kubernetes.io/name: glvd + gardenlinux.io/glvd-component: glvd-ingestion + spec: + restartPolicy: OnFailure + containers: + - name: data-ingestion + image: ghcr.io/gardenlinux/glvd:edge + resources: + requests: + cpu: "1" + memory: "2Gi" + limits: + cpu: "2" + memory: "4Gi" + command: + - /bin/bash + - -c + - sleep 5 && echo start && /usr/local/src/ingest-postgres.sh && echo done && sleep infinity + env: + - name: PGDATABASE + valueFrom: + configMapKeyRef: + name: glvd-ingestion + key: databaseName + - name: PGUSER + valueFrom: + secretKeyRef: + name: postgres-credentials + key: username + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: postgres-credentials + key: password + - name: PGHOST + valueFrom: + configMapKeyRef: + name: glvd-ingestion + key: databaseHost + - name: PGPORT + valueFrom: + configMapKeyRef: + name: glvd-ingestion + key: databasePort diff --git a/charts/glvd/.helmignore b/charts/glvd/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/glvd/.helmignore @@ -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/ diff --git a/charts/glvd/Chart.yaml b/charts/glvd/Chart.yaml new file mode 100644 index 0000000..6b90e43 --- /dev/null +++ b/charts/glvd/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: glvd +description: A Helm chart for glvd +type: application +version: 0.1.0 +appVersion: "0.0.1" diff --git a/charts/glvd/templates/NOTES.txt b/charts/glvd/templates/NOTES.txt new file mode 100644 index 0000000..550b5f5 --- /dev/null +++ b/charts/glvd/templates/NOTES.txt @@ -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 "glvd.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 its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "glvd.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "glvd.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 "glvd.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 }} diff --git a/charts/glvd/templates/_helpers.tpl b/charts/glvd/templates/_helpers.tpl new file mode 100644 index 0000000..e9301d6 --- /dev/null +++ b/charts/glvd/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "glvd.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 "glvd.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 "glvd.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "glvd.labels" -}} +helm.sh/chart: {{ include "glvd.chart" . }} +{{ include "glvd.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "glvd.selectorLabels" -}} +app.kubernetes.io/name: {{ include "glvd.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "glvd.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "glvd.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/glvd/templates/deployment.yaml b/charts/glvd/templates/deployment.yaml new file mode 100644 index 0000000..b6821d7 --- /dev/null +++ b/charts/glvd/templates/deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "glvd.fullname" . }} + labels: + {{- include "glvd.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "glvd.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "glvd.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "glvd.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 }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + 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 }} diff --git a/charts/glvd/templates/hpa.yaml b/charts/glvd/templates/hpa.yaml new file mode 100644 index 0000000..43a9a28 --- /dev/null +++ b/charts/glvd/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "glvd.fullname" . }} + labels: + {{- include "glvd.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "glvd.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 }} diff --git a/charts/glvd/templates/ingress.yaml b/charts/glvd/templates/ingress.yaml new file mode 100644 index 0000000..e6aeae1 --- /dev/null +++ b/charts/glvd/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "glvd.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 "glvd.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 }} diff --git a/charts/glvd/templates/service.yaml b/charts/glvd/templates/service.yaml new file mode 100644 index 0000000..31fbf99 --- /dev/null +++ b/charts/glvd/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "glvd.fullname" . }} + labels: + {{- include "glvd.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "glvd.selectorLabels" . | nindent 4 }} diff --git a/charts/glvd/templates/serviceaccount.yaml b/charts/glvd/templates/serviceaccount.yaml new file mode 100644 index 0000000..b43958b --- /dev/null +++ b/charts/glvd/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "glvd.serviceAccountName" . }} + labels: + {{- include "glvd.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/glvd/templates/tests/test-connection.yaml b/charts/glvd/templates/tests/test-connection.yaml new file mode 100644 index 0000000..7b01880 --- /dev/null +++ b/charts/glvd/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "glvd.fullname" . }}-test-connection" + labels: + {{- include "glvd.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "glvd.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/glvd/values.yaml b/charts/glvd/values.yaml new file mode 100644 index 0000000..3d339b5 --- /dev/null +++ b/charts/glvd/values.yaml @@ -0,0 +1,107 @@ +# Default values for glvd. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +livenessProbe: + httpGet: + path: / + port: http +readinessProbe: + httpGet: + path: / + port: http + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/docs/kubernetes-deployment.md b/docs/kubernetes-deployment.md new file mode 100644 index 0000000..3068f0e --- /dev/null +++ b/docs/kubernetes-deployment.md @@ -0,0 +1,34 @@ +# GLVD Kubernetes deployment + +This deployment guide is work in progress. +It is intended for development purposes so stakeholders can get a running version of the current development version of GLVD. + +Assuming you have a Kubernetes cluster with enough resources (8 cpu, 16 GiB memory), that ideally should be located in the US, the following should give you a running cluster: + +```bash +# create a random password for the database +kubectl create secret generic postgres-password --type=string --from-literal=password=$(pwgen 42 1) + +# create persistent volume claim for postgres storage +kubectl apply -f 00-glvd-pvc.yaml + +# create deployment (needs the password secret) +# this will be starting the data ingestion process which takes a while for the first time +kubectl apply -f 01-glvd-deployment.yaml + +# create service to expose the api http interface +kubectl apply -f 02-glvd-service.yaml + +# check the progress, the last line should say 'done' +kubectl logs -c data-ingestion glvd-SOME-ID + +# get hostname of external service (this assumes only one hostname exists) +HOSTNAME=$(kubectl get svc glvd -o template --template '{{range .status.loadBalancer.ingress}}{{.hostname}}{{end}}') + +# check for readiness +curl http://$HOSTNAME:8080/readiness + +# use the API as described here https://gardenlinux.github.io/glvd-api/ +# but use the HOSTNAME variable instead of glvd.gardenlinux.io for now +curl http://$HOSTNAME:8080/v1/cves/debian_linux/bookworm +```