Using custom certificates
You can use either a self-signed certificate or a custom certificate when you use License Service API over https.
IMPORTANT: From License Service version v1.16.6, custom external certificates is handled using Ingress.
To set the custom certificate for automatic ingress configuration
-
Change the certificate name to
tls.crt
. -
Change the key name to
tls.key
. -
Run the following command to change the directory to where the certificate and the key are stored:
cd <certificate_directory>
-
Create a secret by using the following command:
licensingNamespace=$(oc get pods --all-namespaces | grep "ibm-licensing-service-" | awk {'print $1'}) oc create secret tls ibm-licensing-certs --key tls.key --cert tls.crt -n ${licensingNamespace}
-
Open the IBMLicensing instance YAML to include the certificate by running the following command:
kubectl edit IBMLicensing instance
-
Edit the YAML and add the following sections under
spec.ingressOptions
.-
Specify host explicitly by setting
spec.ingressOptions.host
to your external endpoint hostname. -
To apply custom certificate, add following section under
spec.ingressOptions
.tls: - hosts: - <your_hostname> secretName: ibm-licensing-certs
Note: Hostname specified in
spec.ingressOptions.host
must exist underspec.ingressOptions.tls[0].hosts
. Also, the custom certificate must be issued to this hostname. For example:apiVersion: operator.ibm.com/v1alpha1 kind: IBMLicensing metadata: name: instance spec: ingressOptions: hosts: example.com tls: - hosts: - example.com secretName: ibm-licensing-certs
-
-
Edit the YAML and add the following parameters to the
IBMLicensing
section, underspec
:-
To enable the https connection, add the following line:
httpsEnable: true
-
To apply the custom certificate that you created as
ibm-licensing-certs
, add the following line:httpsCertsSource: custom
For example:
apiVersion: operator.ibm.com/v1alpha1 kind: IBMLicensing metadata: name: instance spec: httpsEnable: true httpsCertsSource: custom
-
-
Save the changes in YAML.
To set the custom certificate for manual ingress configuration
To set the custom certificate for manual ingress configuration, see TLS.