diff --git a/content/en/docs/deployment/hub/advanced.md b/content/en/docs/deployment/hub/advanced.md index 18df16d8..fa816fc1 100644 --- a/content/en/docs/deployment/hub/advanced.md +++ b/content/en/docs/deployment/hub/advanced.md @@ -96,6 +96,99 @@ global: ... ``` +## Configuring Custom Certificate Authority for PLGD Hub Services + +PLGD utilizes four types of service certificates: + +- **External Services:** (e.g., gRPC Gateway, HTTP Gateway, Certificate Authority) exposed to the internet. +- **Internal Services:** (e.g., MongoDB, NATS, Resource Directory, etc.) communicating internally. +- **CoAP Gateway:** Communicating with devices. +- **Certificate Authority Service:** Used for signing certificates. + +In the following steps, it uses one issuer for all service types. For your specific needs, you can separate each type of service by using a different issuer, such as Let's Encrypt for external services. To customize the Issuer for PLGD Hub services, follow these steps: + +### Add Custom CA to Kubernetes Secret + +Firstly, add the custom CA with the key pair to the Kubernetes secret. For a Cluster Issuer, include it in the `cert-manager` namespace. + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: plgd-ca-secret + namespace: cert-manager # or namespace in the case of issuer +type: kubernetes.io/tls +data: + ca.crt: # Root CA + tls.crt: # Root CA or Intermediate CA + tls.key: # Associated private key +``` + +Apply the secret to the Kubernetes cluster: + +```sh +kubectl apply -f plgd-ca-secret.yaml +``` + +### Configure Issuer to Use Custom CA + +Next, configure the issuer to use the custom CA: + +```yaml +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer # or Issuer for namespace issuer +metadata: + name: plgd-ca-issuer +spec: + ca: + secretName: plgd-ca-secret +``` + +Apply the issuer configuration to the Kubernetes cluster: + +```sh +kubectl apply -f plgd-ca-issuer.yaml +``` + +### Configure PLGD Hub Helm Chart + +Finally, configure the PLGD Hub Helm chart to use the custom CA. Adjust the certificate duration according to your needs: + +```yaml +certmanager: + external: + cert: + duration: 8760h # 1 year for external services + issuer: + kind: "ClusterIssuer" # or "Issuer" + name: "plgd-ca-issuer" + group: cert-manager.io + internal: + cert: + duration: 8760h # 1 year for internal services + issuer: + kind: "ClusterIssuer" # or "Issuer" + name: "plgd-ca-issuer" + group: cert-manager.io + coap: + cert: + duration: 8760h # 1 year for CoAP Gateway + issuer: + kind: "ClusterIssuer" # or "Issuer" + name: "plgd-ca-issuer" + group: cert-manager.io + default: + cert: + duration: 876000h # 100 years for intermediate CA + ca: + issuerRef: + kind: "ClusterIssuer" # or "Issuer" + name: "plgd-ca-issuer" + group: cert-manager.io +``` + +Apply the Helm chart configuration to the Kubernetes cluster. + ## Troubleshooting ### Issue: Unable to fetch data from the ./well-known endpoint in browser