This article describes how to deploy the Smart ID Messaging component a Hermod image on Kubernetes.
Prerequisites for
...
Hermod deployment
A Kubernetes service subscription where you need to must create and deploy Hermod
A public DNS name which devices can reach
Matching certificates for the public address
An installed/deployed instance of an SQL server, for example, PostgreSQL, Microsoft SQL Server, Maria DB, or Oracle
Step-by-step instruction
Download the Hermod docker image and file structure
Sign in to Nexus Support portal.
Go to Nexus Smart ID Clients (Personal and Hermod) > Smart ID Messaging and select a Hermod version to download the *.zip file.
Unpack the *.zip file.
Open the extracted folder, for example, 3.x.y.RELEASE.
The folder contains the Hermod installation file and a simple-setup file to set up a default configuration.
Unpack simple-setup.zip.
Store Place the docker image somewhere so for on a location where the Kubernetes cluster needs to pull can access and pull the image from.
Create
...
the storage yml file
Edit the file hermod-deploymentconfig with the correct values for your environment. It will be used to store Hermod configuration file.
Important! The actual values must match the specific deployment scenarios. The hermod-depoyment code below is only intended as an example.
...
config.yml apiVersion: v1
items:
- apps/
Deployment
PersistentVolumeClaim
metadata:
| annotations:
finalizers:
- | deployment.revision: "2" generation:3 labelsapp: hermod name hermodnamespace test
spec:replicas1 revisionHistoryLimit2 selector matchLabels:
app: hermod
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
volumeName: hermod-config |
|
Create the Hermod deployment yml file
Edit the file hermod-deployment with the correct values for your environment.
Info |
---|
Important! The actual values must match the specific deployment scenarios. The hermod-depoyment code below is only intended as an example. |
Expand |
---|
|
Example: hermod-deployment.yml Code Block |
---|
apiVersion: v1
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "2"
generation: 3
labels:
| configmap-version"1"annotations:1
revisionHistoryLimit: 2
| prometheus.io/scrape"true"prometheus.io/scheme: "http"
prometheus.io/path:"prometheus"prometheus.io/port"20400"namehermodspectype: RollingUpdate
template:
| containers- args image: nexusgocontainerregistry.azurecr.io/nexus-personal/hermod:3.7.0.RELEASEimagePullPolicyAlways args- --spring.profiles.active=native
prometheus.io/scrape: "true"
| ---spring.datasource.url=${DB_URI}prometheus.io/scheme: "http"
| - --spring.datasource.username=${DB_USERNAME}
prometheus.io/path: "prometheus"
| ---spring.datasource.password=${DB_PASSWORD}
prometheus.io/port: "20400"
| ports:containerPort20400 protocol: TCPimage: nexusgocontainerregistry.azurecr.io/nexus-personal/hermod:3.7.0.RELEASE
| resources{}envname: JAVA_OPTS--spring.profiles.active=native
| value: Xms256m -Xmx512m -XX:MaxMetaspaceSize=512m -XX:CompressedClassSpaceSize=64m
-spring.datasource.url=${DB_URI}
- | Xss256kXmn8m -XX:InitialCodeCacheSize=4m -XX:ReservedCodeCacheSize=64m-spring.datasource.username=${DB_USERNAME}
- | -XX:MaxDirectMemorySize=64m
--spring.datasource.password=${DB_PASSWORD}
| -DB_URI valueFromports:
- containerPort: 20400
| secretKeyRef:key:DB_URInamehermod-secret-test-postgres DBUSERNAMEvalueFromvalue: -Xms256m -Xmx512m -XX:MaxMetaspaceSize=512m -XX:CompressedClassSpaceSize=64m
| secretKeyRef: -Xss256k -Xmn8m -XX:InitialCodeCacheSize=4m -XX:ReservedCodeCacheSize=64m
| key:DB_USERNAME -XX:MaxDirectMemorySize=64m
| hermod-secret-test-postgres-name:DB_PASSWORD
valueFrom:
secretKeyRef:
key: DB_ | PASSWORDURI
name: hermod-secret-test-postgres
- | readinessProbehttpGetpath/msport20400initialDelaySeconds:20 name: hermod-secret-test-postgres
| timeoutSeconds:5periodSeconds: 30securityContextprivileged false DB_PASSWORD
name: hermod-secret-test-postgres
| runAsNonRoottruerunAsUser:1000terminationMessagePathdev/termination-logvolumeMounts: - name: pvc-hermod
mountPath: /home/docker/config
volumes:
- name: pvc-hermod
configMap:
name: hermod
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""
|
Create Hermod configuration YML file
Edit the config
Code Block |
---|
kind: ConfigMap
apiVersion: v1
metadata:
name: hermod
namespace: test
data:
application.yml: |-
logging:
level:
20400
initialDelaySeconds: 20
timeoutSeconds: 5
periodSeconds: 30
securityContext:
privileged: false
runAsNonRoot: true
runAsUser: 1000
terminationMessagePath: /dev/termination-log
volumeMounts:
- name: hermod-config
mountPath: /home/docker/config
volumes:
- name: hermod-config
configMap:
name: hermod
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
terminationGracePeriodSeconds: 30
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""
|
|
Create the Hermod configuration yml file
Edit the file hermod-configuration with the correct values for your environment.
Info |
---|
Important! The actual values must match the specific deployment scenarios such as configure clientId, public URL, TLS/SSL and url, username, password for the specified database. The code below is only intended as an example. |
Expand |
---|
|
Example: hermod-configuration.yml Code Block |
---|
kind: ConfigMap
apiVersion: v1
metadata:
name: hermod
namespace: test
data:
application.yml: |-
logging:
level:
org.springframework.context.annotation.AnnotationConfigApplicationContext: ERROR
org.springframework.boot.SpringApplication: ERROR
org.springframework.cloud.config.client: ERROR
org.springframework.web.reactive.function.client.WebClient: TRACE
com.netflix: INFO
reactor.netty.http.client: TRACE
com.nexusgroup: TRACE
| org.springframework.context.annotation.AnnotationConfigApplicationContextERRORspringframeworkboot.SpringApplicationERRORorg.springframework.cloud.config.clientcom.nexusgroup.plugout.message.server.filters.VersionHttpFilter: ERROR
| orgspringframeworkwebreactivefunctionclient.WebClientTRACEcomnetflixINFOreactornetty.client com.nexusgroupTRACE com.relayrides: INFO
org.mongodb.driver: TRACEconsole: "%d{yyyy-MM-dd}T%d{HH:mm:ss.SSS}Z ${LOG_LEVEL_PATTERN:- %5p} [%t] %-40.40logger{39} [%mdc] : %m%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx}"
| com.nexusgroup.plugout.message..filters.VersionHttpFilter ERROR com.nexusgroup.cod.hermod.service.MessagePlugoutServiceERROR org.hibernate.stat: DEBUG
#org.apache.httpTRACEpatternconsole: "%d{yyyy-MM-dd}T%d{HH:mm:ss.SSS}Z ${LOG_LEVEL_PATTERN:- %5p} [%t] %-40.40logger{39} [%mdc] : %m%n${LOG_EXCEPTION_CONVERSION_WORD:%wEx}"
include-binding-errors: never
include-stacktrace: never
| serverservlet context-pathoverride-with-generic-response: | /errorinclude-messagealways include-binding-errors: neverinclude-stacktraceneverinclude-exception:falsespringdocoverride-with-generic-response: falseapi-docs:enabled:falseswaggeruienabled:falsespring:jpagenerate-statistics: false
| propertieshibernateddl-auto: validate
cloud:
| dialect:org.hibernate.dialect.PostgreSQLDialectshow-sqlfalse format-sqlenabled: true
management:
| generate-statisticsfalse hibernateddl-autovalidatecloud
kubernetes:reload:enabled:true include: health, info, refresh, | management:infoenvprometheus:
enabled: true
| endpoints web exposureclient:
keep-a-live-timeout: -1
| include:health,info,refresh,prometheus endpointprometheusenabledtrueapplication:rest:clientkeep-a-live-timeout-1 connection-timeout8hermod:scheduler:Hide sensitive/long data in | exec:threads:100rest:uribasehideexceptionsKey: aGVybW9kLXRlc3QtY2xpZW50Ojc5YjY1NzUwODc3NzQwOGJhNDA2ZjM1NDNjYTg3ZmFkYjc0MmNmNmM3NjEzNDc0MTg5ZGJlZjI5NWEyNTIzMmM=
| false# Hide sensitive/long data in event logs?- client-id: hermod-test-client
| events 56UGzk8qZm67YDhkzwuEfpYkLMubram8P9KryXGG9PEa76Xnku5Z6B7c8MKAf66X
| hide-sensitive: true # Optional username:password to | #EnableCORSon /rest/ms endpoint ?basic authentication in callbacks
| cors: # callback-basic-auth: username:password
| enabled:false # The callback URL base for this | allowed-origins: 'https://doc.nexusgroup.com'pathpatterns'rest/command/**,/rest/command/poll/**'allowed-headers:'*' # Message server library settings
| #URLandAPI-keytoHermodCfgserver which also can host client configurationhermod-cfg-server: enabled: true
url: http://hermodcfg:20490
api-key: CUkrhHzqZRCPvuKbHMZs4PSq73pdnU2Jre5NdYDML7JPJqc2s42JZqqxPhW8wa6c
# All clients have moved to HermodCfg server. Use the scripts in ../hermodcfg/ to add/modify/list
allowed-clients:
# X-Api-Key: aGVybW9kLXRlc3Q6NzliNjU3NTA4Nzc3NDA4YmE0MDZmMzU0M2NhODdmYWRiNzQyY2Y2Yzc2MTM0NzQxODlkYmVmMjk1YTI1MjMyYw==
public-url: https://<my-hermod-server>:20400/ms
|
|
Create the Hermod service yml file
Edit the file hermod-service with the correct values for your environment.
Expand |
---|
|
Example: hermod-service.yml Code Block |
---|
apiVersion: v1
items:
- apiVersion: v1
kind: Service
metadata:
labels:
app: hermod
name: hermod
namespace: test
spec:
ports:
- nodePort: 30400
port: 20400
| -client-idhermod-testkey56UGzk8qZm67YDhkzwuEfpYkLMubram8P9KryXGG9PEa76Xnku5Z6B7c8MKAf66X callback-urlhttp://hermod:20400None
type: NodePort
kind: List
metadata: {}
resourceVersion: | content-provider-url: http://hermod-testapp:20488/hermod-testapp/rest/content
# Message server library settings
message-server-library:
# Make sure you also change the certificates above
public-url: https://hermod-test.go.nexusgroup.com/ms
|
Optional: Create the Hermod database secret YML file
Edit the file hermod-secret with the correct values for your environment.
Expand |
---|
|
Example: hermod-secret.yml Code Block |
---|
apiVersion: v1
data:
DB_URI: amRiYzpzcWxzZXJ2ZXI6Ly9uZ2F6LWRldnNxbDAxZC5kYXRhYmFzZS53aW5kb3dzLm5ldDoxNDMzO2RhdGFiYXNlPWhlcm1vZC1kZXY7dXNlcj1oZXJtb2R1c2VyO3Bhc3N3b3JkPWNvZGEhUUFaeHN3MjtlbmNyeXB0PXRydWU7dHJ1c3RTZXJ2ZXJDZXJ0aWZpY2F0ZT1mYWxzZTtob3N0TmFtZUluQ2VydGlmaWNhdGU9Ki5kYXRhYmFzZS53aW5kb3dzLm5ldDtsb2dpblRpbWVvdXQ9MzA7Cg==
kind: Secret
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","data":{"DB_URI":"amRiYzpzcWxzZXJ2ZXI6Ly9uZ2F6LWRldnNxbDAxZC5kYXRhYmFzZS53aW5kb3dzLm5ldDoxNDMzO2RhdGFiYXNlPWhlcm1vZC1kZXY7dXNlcj1oZXJtb2R1c2VyO3Bhc3N3b3JkPWNvZGEhUUFaeHN3MjtlbmNyeXB0PXRydWU7dHJ1c3RTZXJ2ZXJDZXJ0aWZpY2F0ZT1mYWxzZTtob3N0TmFtZUluQ2VydGlmaWNhdGU9Ki5kYXRhYmFzZS53aW5kb3dzLm5ldDtsb2dpblRpbWVvdXQ9MzA7Cg=="},"kind":"Secret","metadata":{"annotations":{},"name":"hermod-secret","namespace":"default"}}
name: hermod-secret
namespace: test
type: Opaque
|
|
Deploy yml files
You can deploy the yml files on Kubernetes by using the following command:
kubectl --kubeconfig <kubernetes-config> apply -f <file_name>.yml