Installation with Kubernetes
MSC is installed with the Helm chart msc. It creates a Deployment with a Service for every service, together
with PodDisruptionBudgets, NetworkPolicies, an Ingress for the interface, the sign-in and the public part of the PKI,
and a LoadBalancer for the radio protocols of the Gateway.
Prerequisites
- Kubernetes 1.30 or later and Helm 3.
- PostgreSQL with TimescaleDB and Redis, provided and backed up by the operator.
- An ingress controller (default: ingress-nginx) and a TLS certificate for the three host names.
- For the NetworkPolicies, a CNI that enforces them, for example Calico or Cilium.
- For the alerts, optionally the Prometheus Operator.
Creating the secrets
The chart contains no secrets. It refers to secrets with fixed names (msc-database, msc-pki, msc-identity and
others). Which secrets with which keys are needed is shown in examples/secrets.yaml in the chart. Create these
secrets in the namespace before installing, with kubectl, an External Secrets operator or Sealed Secrets. The keys
the services and the interface authenticate with at the identity (private_key_jwt) are made by the chart itself, in
the secret msc-client-keys; they are kept on every upgrade.
The PKI secret (msc-pki, key pki-secret) encrypts every private key in the database. Choose a random value of at
least 16 characters, for example openssl rand -base64 32, and back it up separately from the database.
In examples/secrets.yaml the secret msc-identity carries the placeholder REPLACE-ME for admin-password, the password of the first
administrator. Replace it with a random password of your own that meets the password rules of the identity: at least 8 characters, an
upper-case letter, a lower-case letter, a digit, a special character. The first
sign-in asks for a new password. If the placeholder is left or the value breaks the rules, the identity pod does not start
(CrashLoopBackOff; kubectl -n msc logs deploy/msc-identity gives the code identity.admin-user.password-invalid, the setting and the rules
broken, never the password); the chart does not let the placeholder through silently.
Installing
kubectl create namespace msc
kubectl -n msc apply -f secrets.yaml
helm install msc ./msc -n msc \
--set global.hosts.app=msc.example.com \
--set global.hosts.identity=identity.example.com \
--set global.hosts.pki=pki.example.com \
--set global.domain=example.com \
--set global.image.tag=<version>
Further values are documented in values.yaml, such as the image registry, the number of replicas, the resources
and the annotations of the LoadBalancer.
The service does not start
A service that cannot start because of its configuration ends with exit code 78 and writes as the last line of its log what to do: a code, the setting and what is wrong with it. A password or key is never in it. Any other failure at the start ends with exit code 1, and its stack trace stands before it.
kubectl get pods: the pod showsCrashLoopBackOfforError.kubectl describe pod <pod>: under Last State it saysTerminatedwith Exit Code 78 and the message as Message. The chart setsterminationMessagePolicy: FallbackToLogsOnErrorfor it: Kubernetes takes the end of the log (at most 2048 bytes or 80 lines), and the message is the last line.kubectl logs <pod> --previous --tail 5shows the same message in the log.- Correct the setting it names (in the values or in the secrets) and run
helm upgrade.
Kubernetes keeps restarting the pod, with growing pauses, until the setting is right.
Checking
kubectl -n msc get deploy -l app.kubernetes.io/part-of=msc
Every service answers on /alive (the process responds) and /ready (its dependencies are there). Kubernetes takes
a pod out of traffic while /ready fails and restarts it when /alive fails. The page System → Overview of
the interface shows every instance with its version and state.
Your own CA in front of the interface
The interface calls the identity (the sign-in) from its server on the identity's public address: discovery document, token, user info and sign-out go over https:// and the name of the identity (AUTH_IDENTITY_URL). It is the process of the interface that does this, not the browser. It is the only public address the interface calls itself; its connections to the Service Center, PKI and Messaging run internally over http (see "Network and encryption"). Two things have to hold:
- The name of the identity resolves and is reachable from the interface. The server of the interface must reach the public address of its own reverse proxy (hairpin).
- The interface trusts the certificate of the proxy. If it comes from a private or company CA, Node does not know that CA and refuses the call.
When nothing needs to be done: the certificate comes from a publicly trusted CA (such as Let's Encrypt; Node ships their roots) and the name resolves. Then this section does not apply.
How to recognise it: sign-in fails, and the log of the interface says [auth/callback] sign-in failed. The cause shows in a call from the environment of the interface (command below): with a CA Node does not trust it reports UNABLE_TO_VERIFY_LEAF_SIGNATURE; if the name does not resolve, ENOTFOUND or EAI_AGAIN; if it is not reachable, ECONNREFUSED or ETIMEDOUT. 200 means all is well.
Steps:
- Create the certificate of the CA (PEM, the CA's certificate only, never a key) as a Secret in the namespace, key
ca.crt:kubectl -n msc create secret generic msc-ca --from-file=ca.crt=ca.pem. A ConfigMap works as well (trustedCa.source=configMap); the name is<product>-cawhentrustedCa.nameis empty. - Switch the option on, it is off by default:
helm upgrade msc ./msc -n msc --reuse-values --set trustedCa.enabled=true, or with-f examples/trusted-ca.yaml. The chart mounts the certificate at/etc/noritec/cain the pods of the interface and setsNODE_EXTRA_CA_CERTS; no other service gets it. If the Secret is missing, the pod does not start (eventFailedMount). - If the name of the identity does not resolve in the cluster, solve that in the cluster (DNS zone or CoreDNS); the chart sets nothing for it.
helm upgrade rolls out the pods of the interface by itself, because their pod template changes. Afterwards run the same call; it must answer 200:
kubectl -n msc exec deploy/msc-ui -- node -e "fetch('https://<MSC_IDENTITY_HOST>/.well-known/openid-configuration').then(r => console.log(r.status), e => console.log(e.cause?.code ?? e.message))"
Listen address of the gateway
BSSCI (8883), SCACI (8884) and enrollment (8885) of the gateway listen on all interfaces by default, as do dispatch and scheduling between the services. Each interface has a setting ListenAddress for this: an IP address of this machine, 0.0.0.0 (all IPv4 interfaces) or * (all interfaces, IPv4 and IPv6). An address that is not a network connection of this machine stops the interface from starting, with a message naming the setting and the value.
Inside the pod the default stays. Which address is reachable from outside is decided by the LoadBalancer service of the gateway (its annotations and the address your cluster assigns), not by the setting.
Network and encryption
The services of MSC speak plain http to each other, without TLS: the interface to the services, the services to the identity and the PKI, the gateway to the Service Center. This is intended: the protection of these connections lies in the operating mode, not in each service. The identity therefore accepts the direct http calls of the services at their endpoints (InternalHttp__Enabled, set in the settings), at the endpoints the services need (discovery document, key set, token); every other endpoint and the pages still ask for https.
Encrypted are the connections that leave the network: the browser to the reverse proxy or ingress (TLS ends there), base stations and devices at the gateway (BSSCI and enrolment, TLS with a client certificate) and an Application Center of another installation at the gateway (SCACI and its enrolment). Which connection is TLS is in the code of the services and in the settings of this operating mode; whatever is not named here is http.
Requirement on the reverse proxy or ingress: it offers only https to the outside (redirect http to https or close the port). The identity accepts http at the endpoints named, wherever it comes from; the entry of the installation is what keeps it from the outside.
Kubernetes does not encrypt the traffic between pods by itself. With more than one node the traffic between the services leaves the node in plain text. Therefore:
- Prerequisite (more than one node): the network of the pods is encrypted, either through the CNI plugin (for example the WireGuard encryption of Cilium or Calico) or through a service mesh with mTLS (for example Istio or Linkerd). Without one of the two an installation with several nodes is not supported. This is a matter of the platform you install on and not part of the product.
- One node: not needed, the traffic does not leave the node.
- Two points of precision. Encryption through the CNI protects the traffic between nodes; what runs between two pods on the same node stays unencrypted (as the documentation of Cilium and Calico describes it), and a node without the encryption stays unprotected. A service mesh protects only what runs in strict mode: in Istio the mode
PERMISSIVE, the default when nothing else is set, also lets plain text through; in Linkerd a pod without the proxy still accepts plain text unless a policy forbids it. Set the mesh so that plain text to the pods of this product is refused. - The network policies of the chart (
networkPolicies.enabled, on by default) limit which service reaches which; they encrypt nothing and work only with a CNI that enforces them.
Check the statements about your CNI or mesh in its documentation before you rely on them; options and names change with the versions. PostgreSQL and Redis speak as the secrets of the installation, which you create, say; set encryption there in the connection strings (Npgsql: SSL Mode, StackExchange.Redis: ssl=true).
Upgrading
helm upgrade msc ./msc -n msc --reuse-values --set global.image.tag=<new version>
The services migrate their database themselves when they start. The PKI runs with exactly one replica and is replaced rather than updated side by side; all other services roll without interruption.
Uninstalling
helm uninstall msc -n msc removes the services. The database and Redis are left untouched.