Skip to content

Commit 16bea69

Browse files
committed
Update Blog “exposing-an-application-using-ingress-and-tls-termination-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent 16f8f5f commit 16bea69

File tree

1 file changed

+27
-39
lines changed

1 file changed

+27
-39
lines changed

content/blog/exposing-an-application-using-ingress-and-tls-termination-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise.md

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -360,77 +360,65 @@ Events:
360360
Normal Sync 20s nginx-ingress-controller Scheduled for sync
361361
Normal CreateCertificate 20s cert-manager-ingress-shim Successfully created Certificate "cfe-tls-key-pair"
362362
```
363+
### Access deployed Nginx apps
364+
365+
With all Nginx apps, together with the K8s Ingress resource, being deployed to the cluster, all I have to do is to make sure the domain and the subdomain names, i.e., *example.com* & **.nginx.example.com*, point to the the external IP address assigned to the *Nginx Ingress controller* *’10.12.15.251’*.
366+
367+
Type the following commands to check this is done correctly:
363368

364369
```shell
365370
$ host nginx.example.com
366371
nginx.example.com has address 10.6.115.251
367372

368-
369373
$ host green.nginx.example.com
370374
green.nginx.example.com has address 10.6.115.251
371375

372-
373376
$ host blue.nginx.example.com
374377
blue.nginx.example.com has address 10.6.115.251
375378
```
376379

377-
\#### Configure Ingress
378380

379-
```shell
380-
$ cat ingress-simple-selfsigned.yaml
381-
apiVersion: networking.k8s.io/v1
382-
kind: Ingress
383-
metadata:
384-
name: nginx-ingress-selfsigned
385-
annotations:
386-
ingress.kubernetes.io/ssl-redirect: "true"
387-
#kubernetes.io/ingress.class: "nginx"
388-
cert-manager.io/issuer: "cfe-selfsinged-issuer"
389-
spec:
390-
ingressClassName: nginx
391-
tls:
392-
- hosts:
393-
- nginx.example.com
394-
secretName: cfe-tls-key-pair
395-
rules:
396-
- host: nginx.example.com
397-
http:
398-
paths:
399-
- path: /
400-
pathType: Prefix
401-
backend:
402-
service:
403-
name: nginx-main
404-
port:
405-
number: 80
406-
```
407381

408-
```shell
409-
$ k apply -f ingress-simple-selfsigned.yaml -n cfe-apps
410-
ingress.networking.k8s.io/nginx-ingress-selfsigned created
411-
```
412382

413383
```shell
414384
$ k apply -f ingress-simple-selfsigned.yaml -n cfe-apps
415385
ingress.networking.k8s.io/nginx-ingress-selfsigned created
416386
```
417387

418-
```shell
419-
$ host nginx.example.com
420-
nginx.example.com has address 10.6.115.251
421-
```
388+
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'*:
422389

423390
![](/img/nginx-main-warning.png)
424391

392+
This is due to the fact the self-signed certifcate is generated in cert-manager and configured in the K8s Ingress resource.
393+
394+
Click *Not secure* and start Certificate Viewer to check the certificate:
395+
425396
![](/img/nginx-main-cert.png)
426397

398+
Click *Proceed to nginx.example.com (unsafe)*, you then go to the Nginx *MAIN* page:
399+
427400
![](/img/nginx-main.png)
428401

402+
Type the URL *green.nginx.example.com* to the browser, it will be rediected over HTTPS with the same warning message *'Your connection is not private'*:
403+
429404
![](/img/nginx-green-warning.png)
430405

406+
Click *Proceed to green.nginx.example.com (unsafe)*, you then go to the Nginx *GREEN* page:
407+
431408
![](/img/nginx-green.png)
432409

410+
The same thing occurs when type the URL *blue.nginx.example.com* to the browser. The access will be rediected over HTTPS with the same warning message *'Your connection is not private'*:
411+
433412
![](/img/nginx-blue-warning.png)
434413

414+
Click *Proceed to blue.nginx.example.com (unsafe)*, you then go to the Nginx *BLEU* page:
415+
435416
![](/img/nginx-blue.png)
436417

418+
### Conclusion
419+
420+
421+
422+
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*.
423+
424+
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)