You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/generating-self-signed-certificates-using-cert-manager-for-kubernetes-in-hpe-greenlake-for-private-cloud-entreprise.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Generating self-signed certificates using cert-manager for Kubernetes in
@@ -22,15 +23,15 @@ This blog post describes the details steps on how to generate a self-signed cert
22
23
23
24
After applications being deployed in the cluster, one common requirement is to expose the applications to be accessed securely over HTTPS. This requires to get a valid SSL/TLS certificate in K8s. Generating and managing SSL/TLS certificates in K8s is not always easy. There is a list of popular tools and utilities, e.g, . [OpenSSL](https://www.openssl.org/), [CloudFlare’s CFSSL](https://github.com/cloudflare/cfssl), [OpenVPN’s Easy-RSA](https://github.com/OpenVPN/easy-rsa), etc, which you can use for generating certificates. However, you have to follow up the process to create the root certificate authorities, generate certificate signing requests (CSRs), and sign the certificates. The process to generate those items is not very intuitive. Most often, it requires *DevOps* engineers to help and different teams to involve in installing and configuring the certificate chain.
24
25
25
-
This blog post describes the process to generate a self-signed certificate using cert-manager for K8s in HPE GreenLake for Private Cloud Enterprise. Cert-manager integrates seamlessly with K8s for automated handling of certificates and it aligns well with the K8s resource model. This makes cert-manager a native and powerful solution for creating and managing certificates within K8s clusters.
26
+
This blog post describes the process to generate a self-signed certificate using cert-manager for K8s in HPE GreenLake for Private Cloud Enterprise. Cert-manager integrates seamlessly with K8s for automated handling of certificates. It aligns well with the K8s resource model. This makes cert-manager a native and powerful solution for creating and managing certificates within K8s clusters.
26
27
27
28
### Prerequisites
28
29
29
30
Before starting, make sure you have the following:
30
31
31
32
* A K8s cluster, being provisioned in HPE GreenLake for Private Cloud Enterprise
32
-
* The kubectl CLI tool, together with the kubeconfig file for accessing the K8s cluster
33
-
* The optional openssl CLI tool, for validating the generated certificate
33
+
* The *kubectl* CLI tool, together with the kubeconfig file for accessing the K8s cluster
34
+
* The optional *openssl* CLI tool, for validating the generated certificate
34
35
35
36
### Cert-manager
36
37
@@ -146,7 +147,7 @@ spec:
146
147
selfSigned: {}
147
148
```
148
149
149
-
Type the following commands to create a namespace in which you want to generate certificates and deploy the issuer. Replace the sample namespace *cfe-apps* with your own namespace.
150
+
Type the following commands to create a namespace in which you want to generate certificates and deploy the issuer. Replace the sample namespace *cfe-apps*in the commands with your own namespace.
150
151
151
152
```shell
152
153
$ kubectl create ns cfe-apps
@@ -217,7 +218,7 @@ certificate.cert-manager.io/cfe-selfsigned-tls created
217
218
Check the generated certificate in the namespace *cfe-apps* by typing the following command:
218
219
219
220
```shell
220
-
$ k get certificate -n cfe-apps
221
+
$ kubectl get certificate -n cfe-apps
221
222
NAME READY SECRET AGE
222
223
cfe-selfsigned-tls True cfe-tls-key-pair 23s
223
224
```
@@ -300,7 +301,7 @@ Certificate:
300
301
36:63:4f:1e
301
302
```
302
303
303
-
The line *X509v3 Subject Alternative Name* contains the *dnsNames* specified in the file *certificate.yaml* during the certificate generation.
304
+
The line *X509v3 Subject Alternative Name* contains the *dnsNames* specified in the YAML file *certificate.yaml* during the certificate generation.
304
305
305
306
### Integrate certificate with applications
306
307
@@ -367,23 +368,25 @@ It assumes the Nginx Ingress controller is deployed in the cluster. It configure
367
368
368
369
One benefit of this approach is that the sample Nginx application can be deployed in the cluster with the default service type *ClusterIP*, which provides internal connectivity and can solely be accessed from within the cluster. The Ingress controller will provide external access and handle SSL by accessing the certificate in the cluster and route the traffic to the deployed Nginx application in the backend.
369
370
371
+
Type the following command to deploy the Ingress resource to the namespace *cfe-apps*:
ingress.networking.k8s.io/nginx-ingress-selfsigned created
373
376
```
374
377
375
-
After deploying the Ingress using the above command, together with Nginx deployment, to the namespace *cfe-apps*, you can validate the Ingress TLS using the browser. Type the URL *nginx.example.com* in the browser, it will be rediected over HTTPS with the warning message *'Your connection is not private'*:
378
+
After deploying the Ingress using the above command, together with Nginx application deployment, to the namespace *cfe-apps*, you can validate the Ingress TLS using the browser.
376
379
377
380
Start the browser and type the URL *nginx.example.com*, it will be rediected over HTTPS with the warning message *'Your connection is not private'*:
378
381
379
382

380
383
381
-
You can click *Not secure* and start the certificate viewer to check the TLS certificate before clicking *Proceed to nginx.example.com (unsafe)* go to the Nginx page:
384
+
You can click *Not secure* and start the Certificate Viewer to check the TLS certificate before clicking *Proceed to nginx.example.com (unsafe)* to go to the Nginx page:
382
385
383
386

384
387
385
388
### Conclusion
386
389
387
-
This blog post described the steps to generate a self-signed certificate using cert-manager for K8s in HPE GreenLake for Private Cloud Enterprise. Self-signed certificates provide an easy way to prove your own identity for the applications deployed in K8s cluster. They are a good option for development and testing environments. However, self-signed certificates should not be used for production applications. For production use cases, you can try out cert-manager with [Lets Encrypt](https://letsencrypt.org/). Please refer to [cert-manager documentation](https://cert-manager.io/docs/)on how to use it with the type of *Let’s Encrypt* challenges, as well as other sources than *Let’s Encrypt*.
390
+
This blog post described the steps to generate a self-signed certificate using cert-manager for K8s in HPE GreenLake for Private Cloud Enterprise. Self-signed certificates provide an easy way to prove your own identity for the applications deployed in K8s cluster. They are a good option for development and testing environments. However, self-signed certificates should not be used for production applications. For production use cases, you can try out cert-manager with [Lets Encrypt](https://letsencrypt.org/). You can refer to [cert-manager documentation](https://cert-manager.io/docs/) on how to use it with the type of *Let’s Encrypt* challenges, as well as other sources than *Let’s Encrypt*.
388
391
389
392
Please keep coming back to the [HPE Developer Community blog](https://developer.hpe.com/blog/) to learn more about HPE GreenLake for Private Cloud Enterprise.
0 commit comments