Skip to content

Commit eb93d51

Browse files
committed
Update Blog “deploying-super-mario-game-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent eb9a1e9 commit eb93d51

File tree

1 file changed

+50
-7
lines changed

1 file changed

+50
-7
lines changed

content/blog/deploying-super-mario-game-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise.md

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ $ kubectl apply -f issuer-selfsigned.yaml -n cfe-games
272272
issuer.cert-manager.io/cfe-selfsigned-issuer created
273273
```
274274

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:
276276

277277
```shell
278278
$ kubectl get issuer -n cfe-games
@@ -392,9 +392,11 @@ Certificate:
392392
```
393393
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.
394394

395-
### Set up Ingress TLS
395+
### Set up Ingress TLS
396+
397+
396398

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*:
398400

399401
```shell
400402
$ cat ingress-host-based-selfsigned-games.yaml
@@ -434,11 +436,20 @@ spec:
434436
number: 80
435437
```
436438

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.
438440

439441

440442

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*:
444+
445+
```shell
446+
$ kubectl apply -f ingress-host-based-selfsigned-games.yaml -n cfe-games
447+
ingress.networking.k8s.io/ingress-host-based-selfsigned created
448+
```
449+
450+
Check the details of the *TLS* and *Rules* settings by typing below command:
451+
452+
```shell
442453
443454
```shell
444455
$ kubectl describe ingress ingress-host-based-selfsigned -n cfe-games
@@ -466,23 +477,55 @@ Events:
466477
Normal CreateCertificate 30s cert-manager-ingress-shim Successfully created Certificate "cfe-tls-key-pair"
467478
```
468479

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+
469490
```shell
470491
$ host super-mario.example.com
471492
super-mario.example.com has address 10.6.115.251
472493

473-
474494
$ host tetris.example.com
475495
tetris.example.com has address 10.6.115.251
476496
```
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'*:
477498

478499
![](/img/mario-private.png)
479500

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+
480507
![](/img/mario-certificate.png)
481508

509+
Click *Proceed to super-mario.example.com (unsafe)*, you then land to the *SUPER MARIO* game page:
510+
482511
![](/img/super-mario.png)
483512

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+
484515
![](/img/tetris-private.png)
485516

517+
Click *Proceed to green.nginx.example.com (unsafe)*, you then go to the Tetris *Start* page:
518+
486519
![](/img/tetris-start.png)
487520

488-
![](/img/tetris.png)
521+
Click *Start* button, you then land to the *Tetris * game page:
522+
523+
![](/img/tetris.png)
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

Comments
 (0)