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
issuer.cert-manager.io/cfe-selfsigned-issuer created
273
273
```
274
274
275
-
Below is the deployed self-signed custom resource definition (CRD) *Issuer* in the namespace *nginx-apps* in which you want to generate certificate:
275
+
Below is the deployed self-signed custom resource definition (CRD) *Issuer* in the namespace *cfe-games* in which you want to generate certificate:
276
276
277
277
```shell
278
278
$ kubectl get issuer -n cfe-games
@@ -392,9 +392,11 @@ Certificate:
392
392
```
393
393
The line X509v3 Subject Alternative Name contains the *dnsNames*, *'super-mario.example.com'*&*'tetris.example.com'*, which host two games, *Super Mario*&*Tetris*, respectively in the cluster.
394
394
395
-
### Set up Ingress TLS
395
+
### Set up Ingress TLS
396
+
397
+
396
398
397
-
The Ingress resource with TLS has to be created. Here is the sample Ingress TLS resource *ingress-host-based-selfsigned.yaml*, available from the GitHub repo [ingress-demo](https://github.com/GuopingJia/ingress-demo):
399
+
The Ingress resource with TLS has to be created. Here is the Ingress TLS resource *ingress-host-based-selfsigned.yaml*:
398
400
399
401
```shell
400
402
$ cat ingress-host-based-selfsigned-games.yaml
@@ -434,11 +436,20 @@ spec:
434
436
number: 80
435
437
```
436
438
437
-
In the above sample YAML manifest file, there is the *'tls'* block that contains the hostname *'nginx.example.com'* and the secret *cfe-tls-key-pair* created in the certification step. There is also the *'rules'* block in which a list of routing rules is defined per host, e.g., host *nginx.example.com* will be routed to the application service *nginx-main*in the backend.
439
+
In the above sample YAML manifest file, there is the *'tls'* block that contains the hostname *'example.com'* and the secret *cfe-tls-key-pair* created in the certification step. There is also the *'rules'* block in which a list of routing rules is defined per host, e.g., host *super-mario.example.com* will be routed to the Super Mario game service *mario-service*in the backend.
438
440
439
441
440
442
441
-
Type the following command to deploy the Ingress resource to the namespace *nginx-apps*:
443
+
Type the following command to deploy the Ingress resource to the namespace *cfe-games*:
Normal CreateCertificate 30s cert-manager-ingress-shim Successfully created Certificate "cfe-tls-key-pair"
467
478
```
468
479
480
+
### Access deployed games
481
+
482
+
483
+
484
+
Before accessing the deployed games, you need set up the subdomain name resolution. For the subdomains, *super-mario.example.com* and *tetris.example.com*, the workstation host file has been used for DNS resolution.
485
+
486
+
487
+
488
+
Type the following commands to check that this is done correctly:
489
+
469
490
```shell
470
491
$ host super-mario.example.com
471
492
super-mario.example.com has address 10.6.115.251
472
493
473
-
474
494
$ host tetris.example.com
475
495
tetris.example.com has address 10.6.115.251
476
496
```
497
+
You can then access the deployed games using the browser. Start the browser and type the URL *super-mario.example.com*, it will be redirected over HTTPS with the warning message *'Your connection is not private'*:
477
498
478
499

479
500
501
+
This is due to the fact that the self-signed certifcate is generated in cert-manager and configured in the K8s Ingress resource.
502
+
503
+
504
+
505
+
Click *Not secure* and start the Certificate Viewer to check the certificate:
506
+
480
507

481
508
509
+
Click *Proceed to super-mario.example.com (unsafe)*, you then land to the *SUPER MARIO* game page:
510
+
482
511

483
512
513
+
If you type the URL *tetris.example.com* to the browser, it will be redirected over HTTPS with the same warning message *'Your connection is not private'*:
514
+
484
515

485
516
517
+
Click *Proceed to green.nginx.example.com (unsafe)*, you then go to the Tetris *Start* page:
518
+
486
519

487
520
488
-

521
+
Click *Start* button, you then land to the *Tetris * game page:
522
+
523
+

524
+
525
+
Enjoy playing your games !
526
+
527
+
### Conclusion
528
+
529
+
This blog post provided a comprehensive guide on how to expose applications and make them accessible securely via HTTPS in a K8 cluster in HPE GreenLake for Private Cloud Enterprise. It detailed the process of configuring TLS termination on an Ingress controller, utilizing a K8s Ingress resource and a self-signed TLS certificate generated with cert-manager. While the blog post emphasized on self-signed certificates, the outlined procedure is equally applicable to any type of certificates. This flexibility allows customers to follow the steps using their own CA certificates or any commercially issued certificates for Ingress TLS termination, ensuring secure exposure of their applications in the K8s cluster over HTTPS.
530
+
531
+
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