Merge "[OOM-CERT-SERVICE] Add change-log"
[oom/platform/cert-service.git] / certServiceK8sExternalProvider / README.md
1 ## Cert Service K8s external provider
2
3 ### General description
4
5 Cert Service K8s external provider ia a part of certificate distribution infrastructure in ONAP.
6 The main functionality of the provider is to forward Certificate Signing Requests (CSRs) created by cert-mananger (https://cert-manager.io) to CertServiceAPI.
7
8 More information can found on a dedicated page:  https://wiki.onap.org/display/DW/CertService+and+K8s+Cert-Manager+integration.
9
10 ### Build project
11
12 There are two methods for building the project:
13     
14  - mvn clean install (used by CI)
15  - make (used by DEV)
16
17 ### Installation
18
19 #### Providing K8s secret containing TLS certificates
20
21 Create secret with certificates for communication between CMPv2Issuer and Cert Service API:
22 ```
23 kubectl create secret generic -n onap cmpv2-issuer-secret --from-file=<project-base-dir>/certs/cmpv2Issuer-key.pem
24   --from-file=<project-base-dir>/certs/cmpv2Issuer-cert.pem --from-file=<project-base-dir>/certs/cacert.pem
25 ```
26
27 #### Deployment of the application
28
29 Apply K8s files from 'deploy' directory in following order:
30  
31  - crd.yaml
32  - roles.yaml
33  - deployment.yaml
34  - configuration.yaml (certRef, keyRef and cacertRef should match file names if secret was created with command listed 
35  above)
36
37 **Note:** Files and installation are currently examples, which should be used as a guide for OOM Helm Charts implementation  
38
39 #### Log level adjustment
40
41 Log level can be set during deployment as docker container argument --> see deployment.yaml file.
42 Here is an interesting part from the deployment.yaml file:
43
44       - args:
45         - --metrics-addr=127.0.0.1:8080
46         - --log-level=debug
47         command:
48         - /oom-certservice-cmpv2issuer
49         image: onap/oom-certservice-cmpv2issuer:1.0.0
50
51 Supported values of log-level flag (case-sensitive): debug, info, warn, error 
52
53 ### Usage
54
55 To issue a certificate adjust and apply following K8s file:
56  
57  - certificate_example.yaml
58  
59 #### Unsupported Certificate fields
60
61 Some fields present in Cert-Manager Certificate are currently not supported by CertService API and because of that they are
62 filtered out from the Certificate Signing Request.
63
64 **Fields that are filtered out:**
65  - subjectDN fields:
66    - serialNumber
67    - streetAddresses
68    - postalCodes
69  - isCa
70  - duration
71  - usages
72  
73  #### Overridden Certificate fields
74  
75 Some fields present in a Cert-Manager Certificate will be overridden by a CMPv2 server.
76
77 **Overridden fields:**
78  - duration
79  - usages
80  
81