...
With ClusterIssuer setup properly, we can proceed to generate SSL Certificate and import into OCI Certificate Certificates Service.
To generate certificate, create a yaml file named certificate.yaml with the following contents:
Code Block |
---|
apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: lb-cert spec: commonName: <cluster_dns_zone_name listed in the terraform output> dnsNames: - <cluster_dns_zone_name listed in the terraform output> - desktop-online.<cluster_dns_zone_name listed in the terraform output> - platform.<cluster_dns_zone_name listed in the terraform output> - ingress.<cluster_dns_zone_name listed in the terraform output> - grafana.<cluster_dns_zone_name listed in the terraform output> issuerRef: kind: ClusterIssuer name: example-issuer secretName: lb-cert |
...
Execute the yaml file
...
Code Block |
---|
kubectl apply -f certificate.yaml -n uepe |
Wait for a while and confirm certificate has been generated successfully.
Code Block |
---|
kubectl get certificate -n uepe |
The output shows the certificate named
lbcert
’s status is ready
Code Block |
---|
NAME READY SECRET AGE lb-cert True lb-cert 46h |
Extract the server certificate and CA certificate from secret
lbcert
Code Block |
---|
kubectl get secrets lb-cert -n uepe -o yaml | yq '.data' | grep "tls.crt" | awk -F : '{print $2}'| tr -d " "|base64 -d > tls.crt |
...
Separate server certificate and CA certificate into two files
Code Block |
---|
kubectlcsplit get secrets lb-cert -n uepe -o yaml | yq '.data'tls.crt '/^-----BEGIN CERTIFICATE-----$/' |
Rename first generated file as server certificate file
Code Block |
---|
mv xx00 tls.crt |
Rename second generated file as CA certificate file
Code Block |
---|
mv xx01 ca.crt |
Extract the private key from secret
lbcert
Code Block |
---|
kubectl get secrets lb-cert -n uepe -o yaml | yq '.data' | grep "tls.key" | awk -F : '{print $2}'| tr -d " "|base64 -d > tls.key |
By now, server certificate, CA certificate and private key are stored in tls.crt
, ca.crt
and tls.key
respectively. Next step is to import into OCI Certificates Service.
Import into OCI Certificates Service
Go to OCI console management, search for Certificates service. On the Certificates service page, click Create Certificate and follow these steps
Select Certificate Type Imported and give it a unique name
Click Next and come to Certificate Configuration page.
Upload
tls.crt
,ca.crt
andtls.key
to the Certificate Configuration
OCI Certificates Configuration | file to upload |
---|---|
Certificate |
|
Certificate Chain |
|
Private Key |
|
Click Next and proceed to Create Certificate
Wait for the certificate to be created. Copy the certificate’s ocid and set it to
oci.certificates.id
Install Helm Chart
Although the number of helm value combinations to set is virtually endless, some values should more or less always be set.
...