1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2020 NOKIA
6 ==============================
9 ------------------------------
11 Cert Service K8s external provider is a part of certificate distribution infrastructure in ONAP.
12 The main functionality of the provider is to forward Certificate Signing Requests (CSRs) created by cert-mananger (https://cert-manager.io) to CertServiceAPI.
14 Additional information can be found on a dedicated page: https://wiki.onap.org/display/DW/CertService+and+K8s+Cert-Manager+integration.
18 ------------------------------
20 In order to be able to request a certificate via K8s external provider a *CMPv2Issuer* CRD (Customer Resource Definition) instance has to be created.
22 It is important to note that the attribute *kind* has to be set to **CMPv2Issuer**, all other attributes can be set as needed.
24 NOTE: a default instance of CMPv2Issuer is created when installing ONAP via OOM deployment (values can also be adjusted as needed)
26 Here is an example of a *CMPv2Issuer*:
30 apiVersion: certmanager.onap.org/v1
36 url: https://oom-cert-service:8443
37 healthEndpoint: actuator/health
38 certEndpoint: v1/certificate
41 name: cmpv2-issuer-secret
42 certRef: cmpv2Issuer-cert.pem
43 keyRef: cmpv2Issuer-key.pem
48 ------------------------------
50 In order to request a certificate a K8s *Certificate* CRD (Custom Resource Definition) has to be created.
52 It is important that in the section issuerRef following attributes have correct values:
53 - group: **certmanager.onap.org**
54 - kind: **CMPv2Issuer**
56 After *Certificate* CRD has been placed cert manager will send a *CSR* (Certificate Sign Request) to CA (Certificate Authority) via K8s external provider.
57 Signed certificate as well as trust anchor (CA root certificate) will be stored in the K8s *secret* specified in *Certificate* CRD (see secretName attribute).
59 By default certificates will be stored in PEM format. It is possible to get certificates also in JKS and P12 format - see example below - more information can be found on official cert manager page.
61 Here is an example of a *Certificate*:
65 apiVersion: cert-manager.io/v1
68 name: certificate_name
71 # The secret name to store the signed certificate
72 secretName: secret_name
74 commonName: certissuer.onap.org
90 # The reference to the CMPv2 issuer
92 group: certmanager.onap.org
95 # Section keystores is optional and defines in which format certificates will be stored
96 # If this section is omitted than only PEM format will be present in the secret
100 passwordSecretRef: # Password used to encrypt the keystore
101 name: certservice-key
105 passwordSecretRef: # Password used to encrypt the keystore
106 name: certservice-key
110 Here is an example of generated *secret* containing certificates:
117 Annotations: cert-manager.io/alt-names: localhost,certissuer.onap.org
118 cert-manager.io/certificate-name: certificate_name
119 cert-manager.io/common-name: certissuer.onap.org
120 cert-manager.io/ip-sans:
121 cert-manager.io/issuer-group: certmanager.onap.org
122 cert-manager.io/issuer-kind: CMPv2Issuer
123 cert-manager.io/issuer-name: cmpv2-issuer-onap
124 cert-manager.io/uri-sans:
126 Type: kubernetes.io/tls
130 tls.crt: 1675 bytes <-- Certificate (PEM)
131 tls.key: 1679 bytes <-- Private Key (PEM)
132 truststore.jks: 1265 bytes <-- Trusted anchors (JKS)
133 ca.crt: 1692 bytes <-- Trusted anchors (PEM)
134 keystore.jks: 3786 bytes <-- Certificate and Private Key (JKS)
135 keystore.p12: 4047 bytes <-- Certificate and Private Key (P12)