Setup Self-Signed Certificate for PrimeHub
In certain scenarios we may want to use self-signed certificate HTTPS. For example, in private network or corporation network.
This document explains how to setup self-signed certificate for PrimeHub.
Prerequisite
To enable this feature, you need to make sure:
Keycloak version ≥ 8.0
PrimeHub version ≥ 3.1
Your Keycloak is installed in the same Kubernetes cluster with PrimeHub so they can talk with each other using in-cluster connections.
Self-Signed Certificate
Generation
Create a config file for openssl named selfsigned.cnf
. Please make sure to replace the YOUR_DOMAIN_NAME
field with the domain name you want to use.
Generate a self-signed certificate using the following command:
Modify the file permission for latter use.
Create A Secret For Nginx-Ingress-Controller
Create a TLS from our certificate and key files.
You may need to manually create the hub
namespace before PrimeHub installation.
Trust Self-Signed Certificate on Node
Execute following steps to trust your self-signed certificate on your node for latter use.
Configure
Nginx-Ingress TLS Setting
Add the following ingress setting to your helm overrides. Including these components.
You can also refer to the nginx-ingress documentation.
PrimeHub
Including these ingresses:
primehub-admin-notebook
primehub-console
primehub-graphql
primehub-jupyterhub
keycloak (installed via PrimeHub chart)
Keycloak
Keycloak Service URL Setting (Optional)
Please notice that if you install a standalone Keycloak by using Keycloak chart instead of the one installed during PrimeHub installation, then you need to have a proper TLS.
Set KC_SVC_URL
in your .env
file to activate internal connection.
Please note which namespace your Keycloak locates. e.g. http://keycloak-http.<namespace>/auth
.
helm_override/keycloak.yaml
If you installed Keycloak by using Keycloak chart, then you need to configure Keycloak ingress to use self-signed certificate. If you install Keycloak via PrimeHub chart then there's no extra configuration needed.
Grafana
With these settings, you can proceed PrimeHub installation and it should be working. Don't forget to trust your self-signed certificate in your browser.
Last updated