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/exposing-an-application-using-ingress-and-tls-termination-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise.md
+19-12Lines changed: 19 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: Exposing an application using Ingress and TLS termination on Kubernetes
3
-
in HPE GreenLake for Private Cloud Enterprise
4
-
date: 2024-02-21T09:22:08.283Z
2
+
title: Exposing applications using Ingress and TLS termination on Kubernetes in
This blog post describes the process to expose an application that's deployed and runs on Kubernetes in HPE GreenLake for Private Cloud Enterprise to the external world.
24
-
A Nginx app that serves as a Web server that prints out a customized application name will be used as a sample app to expose. The application itself will be deployed as
25
-
the service type of *ClusterIP*, running on the port 80 over HTTP. Using cert-manager and TLS termination on configured MetalLB load balancer, the application will be exposed over HTTPS.
23
+
This blog post describes the process to expose applications that are deployed and run on Kubernetes (K8s) in HPE GreenLake for Private Cloud Enterprise to the external world.
24
+
Three Nginx apps that serve as Web servers and each prints out a customized message will be used as sample applications to expose. The applications themselves will be deployed as
25
+
the service types of *ClusterIP*, running on the port 80 over HTTP. Using cert-manager and TLS termination on configured MetalLB load balancer, the applications will be exposed over HTTPS.
26
26
27
27
### Overview
28
28
29
29
[HPE GreenLake for Private Cloud Enterprise: Containers](https://www.hpe.com/us/en/greenlake/containers.html), one of the HPE GreenLake cloud services available on the HPE GreenLake for Private Cloud Enterprise, allows customers to create a Kubernetes (K8s) cluster, view details about existing clusters, and deploy containerized applications to the cluster. It provides an enterprise-grade container management service using open source K8s.
30
30
31
-
When application workloads get deployed to the K8s cluster, you can create services to expose the applications. By default, a service is created with the service type of *ClusterIP* that supports internal connectivity between different components of the application. In HPE GreenLake for Private Cloud Enterprise: Containers, you can create services with the type of NodePort for the application workloads deployed in K8s clusters using the label hpecp.hpe.com/hpecp-internal-gateway=true. The services will be automatically exposed to a container platform gateway host with assigned ports. The deployed workloads will become accessible externally using the gateway host name and the assigned ports as access URLs. For both service type, *ClusterIP* and NodePort , applications themselves run on HTTP. There is one common requirement to expose the applications to be accessed securely over HTTPS. This requires to get a valid SSL/TLS certificate in K8s and work with load balancers and Ingress.
31
+
When application workloads get deployed to the K8s cluster, you can create services to expose the applications. By default, a service is created with the service type of *ClusterIP* that supports internal connectivity between different components of the application. In HPE GreenLake for Private Cloud Enterprise: Containers, you can create services with the type of NodePort for the application workloads deployed in K8s clusters using the label hpecp.hpe.com/hpecp-internal-gateway=true. The services will be automatically exposed to a container platform gateway host with assigned ports. The deployed workloads will become accessible externally using the gateway host name and the assigned ports as access URLs. For both service type, *ClusterIP* and NodePort , applications themselves run on HTTP. There is one common requirement to expose the applications to be accessed securely over HTTPS. This requires to get a valid SSL/TLS certificate in K8s and work with load balancers and Ingress.
32
+
33
+

32
34
33
35
This blog post, I
34
36
@@ -37,10 +39,15 @@ This blog post, I
37
39
Before starting, make sure you have the following:
38
40
39
41
* A K8s cluster, being provisioned in HPE GreenLake for Private Cloud Enterprise
40
-
* The kubectl CLI tool, together with the kubeconfig file for accessing the K8s cluster
41
-
* The optional openssl CLI tool, for validating the generated certificates
42
+
* The *kubectl* CLI tool, together with the kubeconfig file for accessing the K8s cluster
43
+
* The Helm CLI tool, version 3.12.0 or later
44
+
* A domain and a list of subdomain to generate the SSL certificate and host your applications in the cluster
45
+
46
+
### Set up load balancer with MetalLB
47
+
48
+
You can install and set up the load balancer by following up the blog post [Setting up the load balancer with MetalLB](https://developer.hpe.com/blog/set-up-load-balancer-with-metallb-in-hpe-greenlake-for-private-cloud-enterprise/).
42
49
43
-
### Set up load balancer
50
+
Here is the deployed MetalLB to the namespace *metallb-system* in the cluster:
44
51
45
52
```shell
46
53
$ kubectl get all -n metallb-system
@@ -66,13 +73,13 @@ NAME DESIRED CURRENT READY AGE
66
73
replicaset.apps/controller-57b4fdc957 1 1 1 22m
67
74
```
68
75
76
+
Here is the range of virtual IP addresses, *"10.6.115.251-10.6.115.254"*, defined in the CRD resource *IPAddressPool*, and the layer 2 service IP address announcement in the CRD resource *L2Advertisement*:
77
+
69
78
```shell
70
79
$ kubectl get ipaddresspools -n metallb-system
71
80
NAME AUTO ASSIGN AVOID BUGGY IPS ADDRESSES
72
81
cfe-pool truefalse ["10.6.115.251-10.6.115.254"]
73
-
```
74
82
75
-
```shell
76
83
$ kubectl get l2advertisements -n metallb-system
77
84
NAME IPADDRESSPOOLS IPADDRESSPOOL SELECTORS INTERFACES
0 commit comments