diff --git a/helm_charts/mdcore-custom-svc.yml b/helm_charts/mdcore-custom-svc.yml new file mode 100644 index 0000000..37416a7 --- /dev/null +++ b/helm_charts/mdcore-custom-svc.yml @@ -0,0 +1,16 @@ + + +core_components: + md-core: + serviceSpec: # This will overwrite other service options (ports, type, etc) if configured + ports: + - name: "8008" + port: 8008 + targetPort: 8008 + nodePort: 30808 + type: NodePort + sessionAffinity: None + externalTrafficPolicy: Local + internalTrafficPolicy: Local + selector: + app: "md-core" diff --git a/helm_charts/mdcore/Chart.yaml b/helm_charts/mdcore/Chart.yaml index f756689..e40be30 100644 --- a/helm_charts/mdcore/Chart.yaml +++ b/helm_charts/mdcore/Chart.yaml @@ -50,5 +50,5 @@ long_description: | type: application -version: 5.12.0 -appVersion: 5.12.0 +version: 5.12.1 +appVersion: 5.12.1 diff --git a/helm_charts/mdcore/templates/hpa-template.yml b/helm_charts/mdcore/templates/hpa-template.yml new file mode 100644 index 0000000..06c1979 --- /dev/null +++ b/helm_charts/mdcore/templates/hpa-template.yml @@ -0,0 +1,16 @@ +# Create an hpa for the md core deployment +{{- if $.Values.hpa.enabled -}} +--- +apiVersion: autoscaling/v1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ $.Values.hpa.deployment | default "md-core"}} +spec: + minReplicas: {{ $.Values.hpa.minReplicas }} + maxReplicas: {{ $.Values.hpa.maxReplicas }} + targetCPUUtilizationPercentage: {{ $.Values.hpa.cpuTargetUtilization }} + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ $.Values.hpa.deployment | default "md-core" | quote }} +{{ end }} \ No newline at end of file diff --git a/helm_charts/mdcore/templates/services-template.yml b/helm_charts/mdcore/templates/services-template.yml index 76cb0ac..e27da67 100644 --- a/helm_charts/mdcore/templates/services-template.yml +++ b/helm_charts/mdcore/templates/services-template.yml @@ -15,6 +15,9 @@ metadata: {{- toYaml $component.service_annotations | nindent 4 }} {{- end }} spec: +{{- if $component.serviceSpec }} + {{- toYaml $component.serviceSpec | nindent 2 }} +{{- else }} ports: {{- range $component.ports }} - name: {{ .port | quote }} @@ -29,6 +32,7 @@ spec: {{- end }} selector: app: {{ $component.name | quote }} +{{- end }} status: loadBalancer: {} {{ end }} diff --git a/helm_charts/mdcore/values.yaml b/helm_charts/mdcore/values.yaml index 7c84a6e..340ddf1 100644 --- a/helm_charts/mdcore/values.yaml +++ b/helm_charts/mdcore/values.yaml @@ -130,6 +130,13 @@ env: # Set additional MIGRATE_HISTORY: "false" # Only from version 5.10.1 See Pre-steps in docs.opswat.com MDCORE_LICENSE_COMMENT: "" +hpa: + deployment: md-core + enabled: false + minReplicas: 1 + maxReplicas: 3 + cpuTargetUtilization: 85 + core_components: postgres-core: name: postgres-core @@ -154,7 +161,7 @@ core_components: md-core: name: md-core - image: opswat/metadefendercore-debian:5.12.0 # Overrides the default docker image for the MD Core service, this value can be changed if you want to set a different version of MD Core + image: opswat/metadefendercore-debian:5.12.1 # Overrides the default docker image for the MD Core service, this value can be changed if you want to set a different version of MD Core replicas: 1 # Sets the number of replicas if you want to have multiple MD Core instances env: - name: MD_USER @@ -251,7 +258,7 @@ core_components: maxSurge: 0 initContainers: - name: check-db-ready - image: opswat/metadefendercore-debian:5.12.0 + image: opswat/metadefendercore-debian:5.12.1 imagePullPolicy: IfNotPresent envFrom: - configMapRef: @@ -283,7 +290,7 @@ core_components: defaultMode: 0777 initContainers: - name: wait-for-hub-services - image: opswat/metadefendercore-debian:5.12.0 + image: opswat/metadefendercore-debian:5.12.1 imagePullPolicy: IfNotPresent command: [ '/wait-for-hub-services.sh' ] volumeMounts: diff --git a/helm_charts/mdss-README.md b/helm_charts/mdss-README.md index 33e5963..7a76ac3 100644 --- a/helm_charts/mdss-README.md +++ b/helm_charts/mdss-README.md @@ -24,7 +24,7 @@ helm install my_mdss ./mdss ### From the GitHub helm repo The installation can also be done using the helm repo which is updated on each release: - ```console +```console helm repo add mdk8s https://opswat.github.io/metadefender-k8s/ helm repo update mdk8s helm install my_mdss mdk8s/metadefender_storage_security @@ -41,6 +41,23 @@ Currently supported modules: The `debug` module is reserved for deploying debug and maintenance pods. +## Upgrading +The helm upgrade command can be used to upgrade the mdss services using the latest helm chart: +``` +helm upgrade my_mdss +``` +### Database upgrades +**This step is not required when using an external, managed database** + +The helm chart is configured by default to use the latest compatible version of MongoDB. Before upgrading an existing deployment with persistent database, make sure that the database is upgraded to the specific version for the coresponding release: + - MDSS 3.5.1 - MongoDB 6.0 + +The MongoDB upgrade procedure needs to be done sequentially following all intermediate releases. + +The following components are non-persistent and can be updated to the latest compatible version by setting the respective image tag: + - RabbitMQ: rabbitmq:3.11.4-management + - Redis Cache: redis:7.0 + ## Operational Notes The entire deployment can be customized by overwriting the chart's default configuration values. Here are a few point to look out for when changing these values: - By default, a MongoDB database is deployed alongside the MDSS deployment diff --git a/helm_charts/mdss/Chart.yaml b/helm_charts/mdss/Chart.yaml index 1b26e25..a7cc326 100644 --- a/helm_charts/mdss/Chart.yaml +++ b/helm_charts/mdss/Chart.yaml @@ -32,5 +32,5 @@ long_description: | type: application -version: 3.5.0 -appVersion: 3.5.0 +version: 3.5.1 +appVersion: 3.5.1 diff --git a/helm_charts/mdss/templates/services-template.yml b/helm_charts/mdss/templates/services-template.yml index 09baa5b..95c9ec3 100644 --- a/helm_charts/mdss/templates/services-template.yml +++ b/helm_charts/mdss/templates/services-template.yml @@ -15,6 +15,9 @@ metadata: {{- toYaml $component.service_annotations | nindent 4 }} {{- end }} spec: +{{- if $component.serviceSpec }} + {{- toYaml $component.serviceSpec | nindent 2 }} +{{- else }} ports: {{- range $component.ports }} - name: {{ .port | quote }} @@ -29,6 +32,7 @@ spec: {{- end }} selector: app: {{ $component.name | quote }} +{{- end }} status: loadBalancer: {} {{ end }} diff --git a/helm_charts/mdss/values.yaml b/helm_charts/mdss/values.yaml index 00fa636..06e7c84 100644 --- a/helm_charts/mdss/values.yaml +++ b/helm_charts/mdss/values.yaml @@ -39,7 +39,7 @@ mdss-common-environment: RABBITMQ_SCANNING_PREFETCH_COUNT: "10" HTTPS_ACTIVE: "no" - BRANCH: "3.5.0" # Set MDSS version (image tag) + BRANCH: "3.5.1" # Set MDSS version (image tag) # These variables can be changed to reveal debug information in the application LOG_LEVEL: "4" APP_LOG_LEVEL: "INFORMATION" @@ -223,7 +223,7 @@ mdssHostAliases: # Custom hosts entries mdss_components: mongodb: name: mongodb - image: mongo:3.6 + image: mongo:6.0 ports: - port: 27017 persistentDir: /data/db