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/deploying-super-mario-game-on-kubernetes-in-hpe-greenlake-for-private-cloud-enterprise.md
+33-8Lines changed: 33 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@ Before starting, make sure you have the following:
32
32
* A domain and a list of subdomains to generate the SSL certificate and host the applications in the cluster
33
33
* The optional *openssl* CLI tool, for validating the generated certificates
34
34
35
-
### Deploy Super Mario game
35
+
### Deploy Super Mario
36
36
37
-
*Super Mario*, together with *Tetris*, can be deployed to the cluster using the YAML manifest files from the GitHub repo [k8s-games](https://github.com/GuopingJia/k8s-games):
37
+
The game *Super Mario*, together with *Tetris*, can be deployed to the cluster using the YAML manifest files from the GitHub repo [k8s-games](https://github.com/GuopingJia/k8s-games):
38
38
39
39
```shell
40
40
$ tree k8s-games/
@@ -50,7 +50,6 @@ k8s-games/
50
50
51
51
Type the following commands to deploy the game *Super Mario* and *Tetris* to the namespace *cfe-games*:
52
52
53
-
54
53
```shell
55
54
$ kubectl create ns cfe-games
56
55
namespace/cfe-games created
@@ -64,7 +63,7 @@ deployment.apps/tetris-deployment created
64
63
service/tetris-service created
65
64
```
66
65
67
-
Type the command shown below to check the details of game deployment:
66
+
Type the command shown below to check the details of the game deployment:
Two games, *mario* and *tetris*, are deployed as the *ClusterIP* type, each running with 2 Pod replicas. They provide internal connectivity and can solely be accessed from within the cluster.
89
+
Two games, *mario* and *tetris*, are deployed as the *ClusterIP* type, each running with 2 Pod replicas as default. They provide internal connectivity and can solely be accessed from within the cluster.
90
+
91
+
You can configure the Horizontal Pod Autoscaling (HPA) in the cluster by using the K8s *HorizontalPodAutoscaler* resource. It will automatically scale the workload by deploying more Pods in the cluster according to application memory or CPU usage.
91
92
92
93
Type the following commend to check that all the game service endpoints have been populated:
93
94
@@ -127,11 +128,31 @@ NAME DESIRED CURRENT READY AGE
127
128
replicaset.apps/controller-57b4fdc957 1 1 1 18d
128
129
```
129
130
131
+
By running the following commands, you can see a 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*:
132
+
133
+
134
+
```shell
135
+
$ kubectl get ipaddresspools -n metallb-system
136
+
NAME AUTO ASSIGN AVOID BUGGY IPS ADDRESSES
137
+
cfe-pool truefalse ["10.6.115.251-10.6.115.254"]
138
+
139
+
140
+
141
+
$ kubectl get l2advertisements -n metallb-system
142
+
NAME IPADDRESSPOOLS IPADDRESSPOOL SELECTORS INTERFACES
143
+
cfe-l2advert ["cfe-pool"]
144
+
```
145
+
130
146
### Deploy Nginx Ingress controller
131
147
132
-
In order for an Ingress to work in the cluster, there must be an Ingress controller being deployed and running. It's the Ingress controller that accesses the certificate and the routing rules defined on the Ingress resource and makes them part of its configuration.
148
+
149
+
In order for an Ingress to work in the cluster, there must be an Ingress controller being deployed and running. It's the Ingress controller that accesses the certificate and the routing rules defined on the Ingress resource and makes them part of its configuration.
150
+
151
+
152
+
153
+
A variety of Ingress controllers are available for deployment in the cluster, including [Traefik](https://doc.traefik.io/traefik/providers/kubernetes-ingress/), [HAProxy](https://github.com/haproxytech/kubernetes-ingress#readme) and [Nginx Ingress controller](https://www.nginx.com/products/nginx-ingress-controller/). Execute the command below to install the Nginx Ingress controller to the cluster using helm:
154
+
133
155
134
-
A variety of Ingress controllers are available for deployment in the cluster, including [Traefik](https://doc.traefik.io/traefik/providers/kubernetes-ingress/), [HAProxy](https://github.com/haproxytech/kubernetes-ingress#readme) and [Nginx Ingress controller](https://www.nginx.com/products/nginx-ingress-controller/). Execute the command below to install the Nginx Ingress controller to the cluster using helm:
The service *ingress-nginx-controller* gets deployed as the service type of *LoadBalancer* with the *EXTERNAL-IP* assigned as *10.6.115.251*. This IP address will be used for setting up domain and subdomain name resolution.
230
+
208
231
### Generate a self-signed certificate using cert-manager
209
232
210
233
211
-
You can deploy cert-manager to the K8s cluster and generate a self-signed certificate by following up the blog post [Generating self-signed certificates using cert-manager](https://developer.hpe.com/blog/generating-self-signed-certificates-using-cert-manager-for-kubernetes-in-hpe-greenlake-for-private-cloud-entreprise/).
234
+
You can deploy cert-manager to the K8s cluster and generate a self-signed certificate by following up the blog post [Generating self-signed certificates using cert-manager](https://developer.hpe.com/blog/generating-self-signed-certificates-using-cert-manager-for-kubernetes-in-hpe-greenlake-for-private-cloud-entreprise/).
235
+
236
+
212
237
213
238
Here is the deployed cert-manager to the namespace *cert-manager* in the cluster:
0 commit comments