WEBVTT

00:00:00.240 --> 00:00:08.120
All right, for Lesson 5, we're going to learn about networking, config maps, and secrets.

00:00:08.740 --> 00:00:14.440
So, one of the things I will say after training developers over the years on Kubernetes,

00:00:14.880 --> 00:00:17.960
that Kubernetes networking is very challenging to understand.

00:00:18.960 --> 00:00:21.260
There are four distinct areas.

00:00:22.360 --> 00:00:29.960
Container-to-container communications, pod-to-pod communications, pod-to-service communications,

00:00:29.960 --> 00:00:35.320
communications, external to service communications. Kubernetes networking is typically managed by the

00:00:35.320 --> 00:00:42.020
CNI. Now in this case, this is our KineNet in the MiniCube cluster, and in your RKD2 cluster,

00:00:42.160 --> 00:00:47.260
that will be silly. Services provide a method for exposing network connection applications.

00:00:47.600 --> 00:00:53.600
Constantly changing pod IP addresses present a challenge. Services enable pods to be discovered

00:00:53.600 --> 00:01:01.280
without attaching to a pod IP address. Services use the service API. It uses

00:01:01.280 --> 00:01:07.500
endpoints and a service policy. Service objects are created with the Kubernetes

00:01:07.500 --> 00:01:14.620
API and use a selector for scanning pods using a unique label. Pod labels usually

00:01:14.620 --> 00:01:21.200
follow a naming convention such as app.kubernetes.io name and then the label

00:01:21.200 --> 00:01:26.160
name, certain fork definitions, name, protocol, port, target port. Services use

00:01:26.160 --> 00:01:32.480
normal convention for names like HTTP or HTTPS. And there are three primary

00:01:32.480 --> 00:01:39.800
service types. We have a cluster IP, a node port, and a load balancer. Cluster IP

00:01:39.800 --> 00:01:45.780
is our default service type and is a foundation for other service types. And node type

00:01:45.780 --> 00:01:51.480
definition is required if using the default configuration. Although I do find

00:01:51.480 --> 00:01:56.100
that if I go ahead and put cluster IP in there it can help with troubleshooting

00:01:56.100 --> 00:02:00.780
just to kind of remind you if you forget that that is the default. If the cluster

00:02:00.780 --> 00:02:07.860
spec.clusterip is set to none then no IP address will be assigned. This is

00:02:07.860 --> 00:02:15.060
known as a headless service and that is because it uses DNS instead of the IP

00:02:15.060 --> 00:02:24.960
address in order to find the pod. In that case it would be a stapleset. The control

00:02:24.960 --> 00:02:30.180
plane allocates support number for node ports and there's a default mode port

00:02:30.180 --> 00:02:37.180
range which runs from 30,000 to 32,767. You can set that in cluster.

00:02:37.180 --> 00:02:43.380
Multinodes. You can set a node port for a service. You can request a

00:02:43.380 --> 00:02:49.680
specific node port, and as long as it is not used by another service, then that

00:02:49.680 --> 00:02:57.120
node port would be fixed. So this can be useful, for example, if you're running on

00:02:57.120 --> 00:03:02.640
your network and you need to connect into the cluster to connect to a

00:03:02.640 --> 00:03:09.000
database, you can connect through a node port if you don't have a service setup

00:03:09.000 --> 00:03:15.480
up for them specifically. NodePort enables setting up an external load balancer outside of Kubernetes.

00:03:16.200 --> 00:03:22.600
You can load balance between the nodes using a NodePort. They enable the ability to expose a

00:03:22.600 --> 00:03:31.400
particular node's IP address directly with that NodePort and can optionally specify the NodePort.

00:03:31.960 --> 00:03:36.920
However, it does require a NodePort reservation, so you can request it through the service,

00:03:37.800 --> 00:03:47.080
but then you'll need to generally reserve it. The reason for that is it will try to assign the same

00:03:47.080 --> 00:03:52.360
node port to something else potentially, so we need to reserve that. We generally don't use node

00:03:52.360 --> 00:03:59.080
ports too much in modern Kubernetes. Our services have advanced to the point with our Ingress

00:03:59.080 --> 00:04:03.960
and Gateway API that we don't need to rely on it too much these days.

00:04:03.960 --> 00:04:09.960
but there was a period of time when node ports were the primary way to access data.

00:04:09.960 --> 00:04:15.960
All right, so services of type load balancer. Load balancers determine which pod to send traffic to

00:04:17.080 --> 00:04:23.400
and there are two types used in Kubernetes. We have bare metal load balancers and then we have

00:04:23.400 --> 00:04:32.870
cloud provider. Okay, so bare metal provider enables a service of type load balancer. In

00:04:32.870 --> 00:04:39.670
that case it's a one word. Psyllium, Qubit, and Metal-LB are widely used in bare metal.

00:04:40.790 --> 00:04:48.870
The Metal-LB has been kind of pushed out. Psyllium is the load balancing moves to the CNI

00:04:50.390 --> 00:04:55.590
and there isn't much room to use Metal-LB for anything in the clusters so they've kind of

00:04:55.590 --> 00:05:03.350
pushed Metal-LB out. Kubevip can do both. It can load balance for your services. It can also

00:05:04.310 --> 00:05:08.630
provide the vip for your control plane. So Kubevip is still used in Bare Metal

00:05:09.190 --> 00:05:14.310
for the control plane, but Cilium and other CNIs have taken over

00:05:16.870 --> 00:05:23.510
recently the load balancing function for the services, so service type load balance. Bare

00:05:23.510 --> 00:05:30.470
BareMetal requires a full IP address range using an IPAM, and BareMetal providers watch

00:05:30.470 --> 00:05:35.390
for the service type of LoadBalancer, one word.

00:05:35.390 --> 00:05:42.010
IPAM provides the assigned IP address to the LoadBalancer service, and the LoadBalancer

00:05:42.010 --> 00:05:47.730
service then populates the external hyphen IP field.

00:05:47.730 --> 00:05:53.290
So cloud providers, however, assign an IP address externally.

00:05:53.290 --> 00:05:58.630
use an API to provision an external load balancer. Cloud providers provide the

00:05:58.630 --> 00:06:04.730
assigned IP address to the load balancer and the load balancer service then

00:06:04.730 --> 00:06:09.010
populates the external hyphen IP. And we have our headless service which we

00:06:09.010 --> 00:06:13.150
mentioned earlier and this is used to interact with other service discoveries

00:06:13.150 --> 00:06:19.270
such as DNS. So there is no cluster IP allocated. The proxy does not interact

00:06:19.270 --> 00:06:25.350
with this service. For headless service we set the spec.clusterip value to none. The endpoint

00:06:25.350 --> 00:06:31.270
address from the individual pods is based on DNS and it's useful for statefulset database

00:06:31.270 --> 00:06:37.750
pod access. Typically your library needs to be set up however you are querying your database.

00:06:37.750 --> 00:06:44.470
It needs to be set up to query all db pods and then access the primary pod for write.

00:06:44.470 --> 00:06:49.750
so it needs to be able to determine which is the primary with dns services may be discovered using

00:06:49.750 --> 00:06:56.710
dns kubernetes creates dns records for services and pods kubelet on each node configures dns for

00:06:56.710 --> 00:07:04.310
the bonds and dns enables running containers to look up services by name spaces are important

00:07:04.310 --> 00:07:11.190
when using dns queries imagine two similar stateful set databases with a headless service

00:07:11.190 --> 00:07:15.990
The DNS service stream would be similar, except for the namespace.

00:07:15.990 --> 00:07:19.430
The query streams contain the service name.

00:07:19.430 --> 00:07:28.830
They also contain the namespace that's in the following format, servicename.namespace.service.cluster.local.

00:07:28.830 --> 00:07:31.490
Ingress.

00:07:31.490 --> 00:07:38.570
So our ingress into our cluster maps the traffic to the backends based on rules that we define.

00:07:38.570 --> 00:07:47.530
managed to the Kubernetes API. It uses an ingress controller and the ingress API is being replaced

00:07:47.530 --> 00:07:55.370
by the gateway API. We've had the ingress API around since almost day one and it is now in

00:07:55.370 --> 00:08:03.450
the process of being replaced by the gateway API. And ingress nginx and gateway API both handle

00:08:03.450 --> 00:08:12.650
cluster ingress so gateway api is an ingress it's just its own api so it's not um it's

00:08:13.370 --> 00:08:19.610
doesn't use the ingress api so this is how the ingress looks inside of a cluster we have our

00:08:19.610 --> 00:08:25.850
client and then we have a load balancer for the services the ingress manages the load balancer

00:08:26.890 --> 00:08:32.650
with an ingress we have a routing rule from the ingress to a service so the ingress will show

00:08:32.650 --> 00:08:39.370
endpoints to the service typically one and then the service will show endpoints based on the

00:08:39.370 --> 00:08:45.610
number of pods that it is referencing through a label so if there are two pods it will show

00:08:45.610 --> 00:08:51.130
two endpoints one pod would show one endpoint if i had three pods it would show three endpoints

00:08:51.130 --> 00:08:56.810
in the service so with the gateway api it is the successor to the ingress api

00:08:56.810 --> 00:09:03.570
it does not include the ingress kind. So if you have an ingress manifest that is

00:09:03.570 --> 00:09:10.610
not included in the Gateway API, you must convert all ingress kind to the Gateway

00:09:10.610 --> 00:09:16.130
API when migrating. It requires CRDs, or custom resource definitions, to be

00:09:16.130 --> 00:09:26.330
installed first. It relies on a Gateway and HTTP route for HTTP, HTTPS traffic.

00:09:26.330 --> 00:09:32.770
The gateway can share many HTTP routes, and a gateway provides greater flexibility, standardization,

00:09:32.770 --> 00:09:33.770
and scalability.

00:09:33.770 --> 00:09:39.050
The anticipated upstream release date for all features is the fall of 2025.

00:09:39.050 --> 00:09:47.170
I think Solium just has one more left to implement, and they'll have everything implemented.

00:09:47.170 --> 00:09:51.810
So they were supposed to have it done by November, and I think they're going to have it done

00:09:51.810 --> 00:09:52.810
sometime.

00:09:52.810 --> 00:09:59.690
looks very similar to the ingress. This does not have a load balancer in front, but there is

00:09:59.690 --> 00:10:06.090
typically a client and HTTP request. You have a load balancer here and you have your gateway and

00:10:06.090 --> 00:10:14.410
we have our HTTP route, routing rules to the service, and then the service has the endpoints

00:10:14.410 --> 00:10:20.810
to the respective pods. When we compare the two, both have a load balancer

00:10:22.330 --> 00:10:27.450
that we can see instead of an ingress and a routing rule, we have a gateway and an HTTP

00:10:27.450 --> 00:10:34.250
route and then our routing rule to our server. Yes, so Gateway API has been out for about

00:10:34.250 --> 00:10:40.410
three years now. So I beta tested it well basically three years ago

00:10:40.410 --> 00:10:48.150
And it's pretty stable now. The only thing that is not finished yet with

00:10:48.150 --> 00:10:53.350
Cilium is the TCP routes. But as far as the upstream Kubernetes team, the SIG

00:10:53.350 --> 00:10:57.850
team, they've had it stable for quite a while now. Okay, let's talk about the CNI.

00:10:57.850 --> 00:11:03.170
CNI is a container network interface. CNI plugins are used for cluster

00:11:03.170 --> 00:11:10.930
networking, manage network and security capabilities in cluster, and it can be

00:11:10.930 --> 00:11:17.470
used to deploy the Gateway API. Cilium is a networking, observability, and security

00:11:17.470 --> 00:11:23.270
solution. It provides Layer 3 network ability to span multiple clusters, can

00:11:23.270 --> 00:11:28.850
enforce network policies on Layer 3 to Layer 7, and it can replace KubeProxy to

00:11:28.850 --> 00:11:35.570
improve reliability includes advanced ip address management or ipam support encrypt node to node

00:11:35.570 --> 00:11:41.490
and pod to pod traffic it includes both the ingress api and gateway api and it works well

00:11:41.490 --> 00:11:50.050
on bare metal with kubit in this case kubit would be providing a vip for the control planes

00:11:51.250 --> 00:11:56.770
and that failover for high availability and then psyllium provides the networking over

00:11:56.770 --> 00:12:04.850
All right. ConfigMaps or CMs are API objects. They are used to store non-confidential data

00:12:04.850 --> 00:12:11.730
in key value pairs. The pods consume ConfigMaps as environment variables and load balancers such

00:12:11.730 --> 00:12:18.050
as MetalLB use ConfigMaps for their configuring. ConfigMaps do not provide secrecy or encryption.

00:12:19.170 --> 00:12:22.530
If you want to store confidential data, you need to use a secret.

00:12:22.530 --> 00:12:31.910
So the maximum size is one megabit, and config maps have both data and binary data fields.

00:12:31.910 --> 00:12:38.930
Data fields contain UTF-8 streams, and the binary data fields contain binary data, it's

00:12:38.930 --> 00:12:42.550
base 64 encoded stream.

00:12:42.550 --> 00:12:49.270
Secrets are very similar, they're objects that contain sensitive data, however.

00:12:49.270 --> 00:12:55.670
keep confidential data out of the application code. They are similar to config maps. Maximum

00:12:55.670 --> 00:13:02.230
file size is one megabit. Secrets can be used to provide environment variables so you don't

00:13:02.230 --> 00:13:06.550
have to use a config map. You can put everything into a secret if you want. Secrets by default

00:13:06.550 --> 00:13:14.630
store binary data under the data key and secrets can also store stream data under the stream data

00:13:18.340 --> 00:13:22.100
Secrets are stored unencrypted by default and they are stored in etcd.

00:13:23.780 --> 00:13:26.580
Encryption at rest should be enabled in production,

00:13:27.700 --> 00:13:33.140
that should be turned on. Kubernetes distributions such as RKE2 enable encrypted secrets

00:13:34.900 --> 00:13:40.580
and secrets can also enable the kubelet to bulk container images from private registries

00:13:40.580 --> 00:13:47.220
as an example. There are different types of secrets. We have the Kubernetes I.O. Docker config

00:13:47.220 --> 00:13:52.420
which is our legacy secret we have our docker config json which is the new format for pulling

00:13:52.980 --> 00:14:02.820
images we have basic ssh off tls and there are additional types available as well all right

00:14:02.820 --> 00:14:07.620
now we're going to move on to the labs we're going to create a cluster ip service a node

00:14:07.620 --> 00:14:16.970
port service a load balancer service we're going to do a dns query we're going to create an ingress

00:14:16.970 --> 00:14:26.570
Create an HA cluster with CNI, create a config map, and create a regular secret in a docker

00:14:26.570 --> 00:14:27.570
config secret.

00:14:27.570 --> 00:14:32.370
Ensure you have a fresh Minicoop profile, and we're going to create a three-node Minicoop

00:14:32.370 --> 00:14:33.370
cluster.

00:14:33.370 --> 00:14:44.510
Once it is up, hit control, get nodes, and you should see a URL in your chat for teams.

00:14:44.510 --> 00:14:55.930
If you open a browser inside your environment and use that URL, you should be able to access

00:14:55.930 --> 00:14:59.010
the GitLab repo for Lesson 5.

00:14:59.010 --> 00:15:05.110
On Lesson 5, you should be able to access different YAML files.

00:15:05.110 --> 00:15:08.270
That'll save you some time typing those in.

00:15:08.270 --> 00:15:13.170
Assuming I typed those in correctly last night, there might be a typo or two in there, but

00:15:13.170 --> 00:15:14.170
we'll find out.

00:15:14.170 --> 00:15:17.970
trying to get all those into your Manifest folder, Stan.

00:15:17.970 --> 00:15:21.090
Did you try the link that I pasted into the chat?

00:15:21.090 --> 00:15:22.650
Yeah, so on lesson five,

00:15:22.650 --> 00:15:25.850
it'll have all of the YAML files that we'll be using,

00:15:25.850 --> 00:15:28.830
so we don't have to type those out for this lesson.

00:15:30.230 --> 00:15:31.610
Yeah, it'll save us some time.

00:15:31.610 --> 00:15:33.070
I figure y'all have enough practice now,

00:15:33.070 --> 00:15:34.170
so I type those up.

00:15:35.770 --> 00:15:38.930
Hopefully I didn't make any mistakes, but.

00:15:38.930 --> 00:15:41.310
All right, so make sure you have three nodes up,

00:15:41.310 --> 00:15:48.050
And we'll apply our prior nginx-deployment.yaml file, and we have one minicube start, we need

00:15:48.050 --> 00:15:49.050
three nodes.

00:15:49.050 --> 00:15:50.050
Ah, correct.

00:15:50.050 --> 00:15:57.030
So that would be the one we used just a little while ago, the first one, the nginx-deployment.yaml.

00:15:57.030 --> 00:16:00.870
Let's make sure you have your three nodes up and running.

00:16:00.870 --> 00:16:04.550
So your minicube start, and then double hyphen nodes equals three.

00:16:04.550 --> 00:16:08.930
Yeah, so I'll get, I'm just waiting for, let's see, Stanley, do you have your, oh, I guess

00:16:08.930 --> 00:16:14.950
you already have.

00:16:14.950 --> 00:16:21.770
So the one that we used earlier today, nginx-deployment, make sure pods are running.

00:16:22.770 --> 00:16:23.010
Yeah.

00:16:24.590 --> 00:16:25.290
Uh, correct.

00:16:25.290 --> 00:16:26.990
Cause we're in the default namespace.

00:16:28.370 --> 00:16:33.290
So we'll just do git pods and I should just pull up your nginx deployment

00:16:33.290 --> 00:16:35.250
and leave off all the other pods.

00:16:35.250 --> 00:16:35.550
Okay.

00:16:35.550 --> 00:16:39.050
Now we're going to, well, I created this for you, but we're going to

00:16:39.510 --> 00:16:43.250
apply the cluster service.yaml.

00:16:43.250 --> 00:16:49.250
So, um, Stanley get pulled it into his repo and he's in the lesson five folder.

00:16:49.850 --> 00:16:51.770
So it kind of depends on how you want to do that.

00:16:51.770 --> 00:16:52.430
Yes.

00:16:52.430 --> 00:16:54.290
So you should be able to just apply that.

00:16:54.590 --> 00:16:58.070
Um, do you want to show, explain to everybody how you did that?

00:16:58.970 --> 00:17:01.850
So they don't have to figure something out, right?

00:17:01.850 --> 00:17:02.090
Okay.

00:17:02.090 --> 00:17:02.630
Okay.

00:17:02.630 --> 00:17:04.370
So get cloned with that link.

00:17:04.370 --> 00:17:07.490
If you guys want to use the same method, I'll save you from

00:17:07.490 --> 00:17:10.430
having to use them and copy and paste.

00:17:10.430 --> 00:17:26.350
So to reiterate, he went to the GitLab repo, back to the readme page, and he clicked on code and grabbed the link to the HTTPS link from the repo.

00:17:26.910 --> 00:17:37.730
And then he just typed in git clone, and then a space, so git space clone space, and then that HTTPS link, and then it pulled everything.

00:17:37.730 --> 00:17:42.990
So git space clone space HTTPS think that or a GIT

00:17:44.150 --> 00:17:46.150
GIT space clone

00:17:48.170 --> 00:17:50.950
Let's see you should be able to just pull it in and I'll create a folder

00:17:51.850 --> 00:17:53.850
What was the name of the folder Stanley?

00:17:57.410 --> 00:17:58.390
It's for day

00:17:58.390 --> 00:17:58.570
Yeah

00:17:58.570 --> 00:18:05.190
it'll create a folder called K8 sport a new just CD into that folder and then CD into less than five folder and

00:18:05.190 --> 00:18:11.290
And then you can apply it from there and then once we're through with the class. I'll provide all of the lessons and the yamls

00:18:12.510 --> 00:18:15.050
So right now we have lesson 5 and we have that

00:18:15.790 --> 00:18:19.670
Lesson 4 it just has the nginx deployment.yaml file

00:18:21.130 --> 00:18:24.070
It has to make it a little faster than trying to

00:18:26.180 --> 00:18:28.620
Pseudo vim and then copy it and paste it

00:18:29.380 --> 00:18:35.980
CD into the k8s4d, CD into lesson 5 and it should work when you apply it. So next we're gonna

00:18:36.500 --> 00:18:38.360
Once we apply it, has everyone applied it?

00:18:39.080 --> 00:18:39.620
I think so.

00:18:39.940 --> 00:18:40.460
Looks like everyone.

00:18:41.400 --> 00:18:42.360
Maybe you applied it, Ryan.

00:18:42.500 --> 00:18:48.080
Okay, let's check and see if the service is available on default in the default namespace.

00:18:48.080 --> 00:18:53.300
And you can, you know, close down the browser now if you've already pulled them into the repo.

00:18:53.460 --> 00:18:57.300
Give you a little bit more real estate for your terminal.

00:18:57.500 --> 00:19:00.960
And you should see an NGINX service running on port 8080.

00:19:02.260 --> 00:19:04.140
And what is the type that's noted?

00:19:04.140 --> 00:19:10.620
and what is the port for the service we're gonna have that at 8080 and then

00:19:10.620 --> 00:19:15.120
the external IP what is the external now let's go ahead and describe the service

00:19:15.120 --> 00:19:23.500
okay so we can abbreviate resource to SVC instead of typing service and what is

00:19:23.500 --> 00:19:30.300
the IP address assigned you guys all have different IP addresses so now let's

00:19:30.300 --> 00:19:35.300
open a browser and navigate to the IP address using HTTP with the port.

00:19:35.300 --> 00:19:36.300
All right, what happened?

00:19:36.300 --> 00:19:37.300
All right.

00:19:37.300 --> 00:19:38.300
Uh-huh.

00:19:38.300 --> 00:19:43.460
So you're going to type in the IP address and then the port, and it has a colon in between.

00:19:43.460 --> 00:19:50.260
So what happened is we actually need an external IP address to access a service from the browser.

00:19:50.260 --> 00:19:57.460
So the IP address that is assigned with a cluster IP is an internal address only, and

00:19:57.460 --> 00:20:01.640
not directly accessible from outside of the cluster, even though we have a port.

00:20:01.640 --> 00:20:05.580
Yeah, so in order to have an external, we would have to have

00:20:05.580 --> 00:20:11.080
something else set. So it wouldn't be a cluster IP, it would be a different type

00:20:11.080 --> 00:20:16.660
of service to obtain an external. So if you see cluster IP, that's only going to

00:20:16.660 --> 00:20:22.420
be accessible from internally, unless you hack it and try to do something funky.

00:20:22.420 --> 00:20:26.380
Okay, so now we're going to delete that cluster IP service, and we're going to

00:20:26.380 --> 00:20:32.740
create a node port service and we'll just apply that node port file so it's

00:20:32.740 --> 00:20:40.240
going to be applied after you delete the cluster IP service first then apply the

00:20:40.240 --> 00:20:46.780
node port service and to delete remember kubectl delete hyphen f cluster

00:20:46.780 --> 00:20:54.380
IP service to delete yeah kubectl delete hyphen f cluster IP service

00:20:54.380 --> 00:20:56.760
And then we'll apply the node port service.

00:20:57.980 --> 00:20:58.520
Uh, yeah.

00:20:58.520 --> 00:21:04.880
So for your previous cluster IP service, kubectl delete hyphen F and then the name

00:21:04.880 --> 00:21:11.960
of that file, which I believe was, uh, was it cluster IP hyphen service.yaml.

00:21:11.960 --> 00:21:17.960
And then once you delete that, then you will apply the node port service.yaml.

00:21:17.960 --> 00:21:21.600
So you'll have to be in that directory, which is lesson five, I believe.

00:21:21.600 --> 00:21:27.280
after you apply it let's go ahead and check the service so um so after you delete the cluster ip

00:21:27.280 --> 00:21:33.040
service then you're going to apply the node port service we delete we kubectl delete hyphen f

00:21:33.040 --> 00:21:40.080
the cluster ip dash service and then we kubectl apply hyphen f the node port dash service otherwise

00:21:40.080 --> 00:21:46.320
they will conflict with each other because they're on the same okay everyone applied it and let's

00:21:46.320 --> 00:21:52.800
Check the service, kubectl get service, nginx service, and we'll describe it.

00:21:52.800 --> 00:21:53.800
Describe the service.

00:21:53.800 --> 00:21:58.680
And then what type of, what type do we have on the type?

00:21:58.680 --> 00:22:01.560
And so now we're going to get the URL for the node port service.

00:22:01.560 --> 00:22:08.080
We're going to type minikub service, and then nginx dash service URL.

00:22:08.080 --> 00:22:09.080
Yeah.

00:22:09.080 --> 00:22:14.320
So, but it gave you your, it gave you your IP address.

00:22:21.110 --> 00:22:29.350
Go ahead and test it in your browser. Okay, so it is telling us, assuming I typed everything

00:22:29.350 --> 00:22:35.510
correct, that there is no running pod or pods for the service nginx service. So what we're going to

00:22:35.510 --> 00:22:40.950
do is we're going to check the node port service. kubectl describe service nginx-service. And once

00:22:40.950 --> 00:22:48.310
you pull that up, kubectl, you know, describe that nginx service, and then you're going to

00:22:48.310 --> 00:22:51.850
check the NGINX deployment and see if you can notice anything that does not

00:22:51.850 --> 00:22:56.230
match. And go ahead and describe your service as well. So you have both of them

00:22:56.230 --> 00:23:01.810
available to look at. And when you look at your service, go down and look at your

00:23:01.810 --> 00:23:10.330
endpoints. Any endpoints? Nope. Nope. No endpoints, right? So why is that?

00:23:10.330 --> 00:23:16.990
Let's take a look. What is a service selector between them? Go to our

00:23:16.990 --> 00:23:25.310
deployment take a look at your deployment and look at your service selector and okay app engine x and

00:23:25.310 --> 00:23:32.910
then go take a look at your service and so take a look at what your service is looking for uh-huh

00:23:32.910 --> 00:23:39.070
yeah so it's looking for a longer label it still has the app equals engine x at the end but it's

00:23:39.070 --> 00:23:44.590
looking for a much longer key so the value is the same but the key is much longer so it's not going

00:23:44.590 --> 00:23:50.590
defined your deployment so what we're going to do is change the deployment label so let's fix the

00:23:50.590 --> 00:23:57.710
nginx deployment we're going to copy nginx-deployment.yaml to nginx-app.yaml

00:23:58.750 --> 00:24:06.270
we're going to change all three labels to reflect the correct label so we're going to copy it and

00:24:06.270 --> 00:24:18.520
you can use sudo ccum so you're going to sudo cp nginx-deployment.yaml to nginx-app.yaml

00:24:18.520 --> 00:24:25.560
and then you'll correct all of the labels and before you and so you want to get it off the

00:24:25.560 --> 00:24:31.480
copy you don't want to change the actual nginx-deployment.yml because we're going to have to

00:24:33.800 --> 00:24:43.340
apply the new one so yeah so you want to make sure you copy it so you copy nginx-deployment.yml

00:24:43.340 --> 00:24:50.220
to nginx-app.yml and that way you're not that way we're not changing the existing one because

00:24:50.220 --> 00:24:56.060
because we will need to delete, to kubectl delete hyphen f nginx-deployment.yaml.

00:24:56.240 --> 00:25:00.640
Yeah, so if you sudo vim into nginx-app.yaml,

00:25:01.080 --> 00:25:05.860
then you can modify that one to match what's on the screen here,

00:25:06.520 --> 00:25:09.600
because you'll have to match what I have up there for the new deployment.

00:25:10.940 --> 00:25:14.540
And then you'll go in and you'll delete the old deployment.

00:25:14.540 --> 00:25:20.260
And so once you have that modified, you can do that.

00:25:20.320 --> 00:25:22.860
You'll apply the new file and delete the older file.

00:25:23.960 --> 00:25:26.820
And I'll be right back.

00:25:26.940 --> 00:25:34.440
Yeah, you can do sudo cp and then nginx-deployment.yaml and then nginx-app.yaml.

00:25:34.460 --> 00:25:36.480
Delete the old yaml.

00:25:36.640 --> 00:25:39.340
So delete the nginx-deployment.yaml.

00:25:39.340 --> 00:25:45.040
So kubectl delete hyphen f nginx-deployment.yaml.

00:25:45.040 --> 00:25:51.840
And once that shows deleted, then kubectl apply hyphen f nginx-app.

00:25:51.840 --> 00:25:53.840
And now we have an app that we're running.

00:25:53.840 --> 00:25:58.140
And the old file from lesson four was just a deployment test file.

00:25:58.140 --> 00:25:59.840
Let's see here, Ralph.

00:25:59.840 --> 00:26:06.040
Let's see if we have here sudo vim nginx-deployment sudo vim.

00:26:06.040 --> 00:26:16.160
next actually in both. Okay. Um, one, let's see error one, uh, one of source or desk must be

00:26:16.160 --> 00:26:25.520
remote file. Oh, pseudo CP instead of kubectl CP. There you go. And then, uh, if you, uh, kubectl

00:26:25.520 --> 00:26:34.560
delete hyphen F, uh, nginx-deployment.yaml. And then if you, that's deleted now. Um, and then

00:26:34.560 --> 00:26:41.160
And you're going to, once you delete the nginx-deployment, then you'll sudo vim into the nginx-app.yaml.

00:26:41.160 --> 00:26:42.220
Okay, so that one's been deleted.

00:26:42.360 --> 00:26:51.620
So now you sudo vim into nginx-app.yaml and modify it to match what's up on the screen.

00:26:51.760 --> 00:26:54.160
It basically means changing of three labels.

00:26:54.700 --> 00:27:01.960
So you can see here app.kubernetes.io forward slash name colon space nginx is what we need.

00:27:01.960 --> 00:27:07.700
Oh, um, that's because it depends on where you applied it from.

00:27:09.160 --> 00:27:12.620
I think part of the problem is you guys might be in the wrong folder to copy.

00:27:12.660 --> 00:27:15.540
If you're going to copy, keep in mind there's nothing in the lesson five

00:27:15.540 --> 00:27:19.260
folder, so that won't work and you're just creating blank files.

00:27:19.640 --> 00:27:19.920
Yeah.

00:27:19.920 --> 00:27:24.500
So wherever your nginx-deployment.yaml is, that's the folder

00:27:24.500 --> 00:27:25.880
you need to be in to copy from.

00:27:26.060 --> 00:27:31.640
Um, so that folder, so that file is wherever you created it, probably in root.

00:27:31.640 --> 00:27:36.520
Stanley created it in the manifest folder, but the rest of you, I believe, created that,

00:27:36.520 --> 00:27:41.640
that file in your root directory. If you do an ls, you should have, yeah, there's your Nginx

00:27:41.640 --> 00:27:48.280
deployment, Ralph. So if you, uh, sudo vim into that, um, you'll see that it's populated and you

00:27:48.280 --> 00:27:55.560
can just go ahead and sudo cp that to nginx-app.yaml. Or you can just create sudo vim nginx-app.yaml

00:27:55.560 --> 00:28:01.660
type the whole thing if you can't find your old nginx dash deployment yeah okay so yeah so go

00:28:01.660 --> 00:28:08.660
find the folder where you have the old one running and kubectl apply hyphen f the name of that file

00:28:08.660 --> 00:28:16.440
from that directory yeah we need to find what directory or you can just kubectl get deployments

00:28:16.440 --> 00:28:20.820
let's do this kubectl get deployments make it simple for you guys

00:28:20.820 --> 00:28:24.060
That's a later lesson, but we'll just do it now.

00:28:24.060 --> 00:28:28.000
kubectl delete deployment nginx-deployment.

00:28:28.000 --> 00:28:28.840
Did you delete it?

00:28:28.840 --> 00:28:31.500
kubectl delete deployment.

00:28:31.500 --> 00:28:32.700
Let's see if it'll let us do it.

00:28:32.700 --> 00:28:34.440
Is anyone able to run that successfully?

00:28:34.440 --> 00:28:37.440
And then the name nginx-deployment,

00:28:37.440 --> 00:28:39.260
unless you have a different name for it.

00:28:39.260 --> 00:28:40.820
Yeah, kubectl delete.

00:28:40.820 --> 00:28:43.160
Yeah, kubectl delete nginx-deployment.

00:28:43.160 --> 00:28:44.000
No hyphen.

00:28:44.000 --> 00:28:45.460
I think you already deleted it.

00:28:46.480 --> 00:28:47.320
You already deleted it.

00:28:47.320 --> 00:28:48.740
Stanley was able to delete it though, right?

00:28:48.740 --> 00:28:55.980
And did you run kubectl delete deployment, nginx deployment, or do you use the hyphen

00:28:55.980 --> 00:28:56.980
F for the file name.yaml?

00:28:56.980 --> 00:28:57.980
Oh, okay.

00:28:57.980 --> 00:28:58.980
Yeah.

00:28:58.980 --> 00:28:59.980
Kubectl delete deployment.

00:28:59.980 --> 00:29:00.980
Yeah.

00:29:00.980 --> 00:29:01.980
Delete.

00:29:01.980 --> 00:29:02.980
Oh, that's what you're missing, Ralph.

00:29:02.980 --> 00:29:03.980
Delete deployment.

00:29:03.980 --> 00:29:04.980
And then nginx.

00:29:04.980 --> 00:29:05.980
Yeah.

00:29:05.980 --> 00:29:11.160
And your text, even though I have a massive monitor, your text pixels are just a little

00:29:11.160 --> 00:29:13.980
bit too small for me to see every character.

00:29:13.980 --> 00:29:14.980
Okay.

00:29:14.980 --> 00:29:15.980
So yeah.

00:29:15.980 --> 00:29:17.980
So yours worked, Ralph, right?

00:29:17.980 --> 00:29:29.480
Okay, so now, sudo vim into your nginx-app.yaml, wherever you have that at, and make sure that

00:29:29.480 --> 00:29:31.820
your labels match what I have on the screen.

00:29:31.820 --> 00:29:36.800
Okay, does everyone's nginx-app.yaml match what I have on the screen?

00:29:36.800 --> 00:29:37.800
Where is your nginx-deployment.yaml?

00:29:37.800 --> 00:29:39.800
I think it's in your root folder.

00:29:39.800 --> 00:29:43.220
Oh, and there's your nginx-app.yaml, too.

00:29:43.220 --> 00:29:44.220
Oh, that's...

00:29:44.220 --> 00:29:47.820
So, uh, well, yeah, you don't have to type it in by hand.

00:29:47.820 --> 00:29:52.120
Just go in and cut and paste from your, um, copy and paste from your, uh,

00:29:52.280 --> 00:29:56.040
Nginx dashboard, you know, save you from having to copy it in or from having

00:29:56.040 --> 00:29:58.560
to type it in to be exited out of that.

00:29:58.920 --> 00:30:03.900
It might, it might, it might throw off the indentions just a little bit.

00:30:04.380 --> 00:30:06.020
Uh, Ralph, you want to eat?

00:30:06.060 --> 00:30:06.720
Oh, there you go.

00:30:07.100 --> 00:30:07.800
It worked.

00:30:08.220 --> 00:30:08.640
Okay.

00:30:08.640 --> 00:30:10.200
And then just change your labels.

00:30:10.200 --> 00:30:11.460
There are three labels in there.

00:30:11.460 --> 00:30:13.960
So change them to match what I have on the screen.

00:30:13.960 --> 00:30:16.600
It would have been faster probably just to type this whole thing out.

00:30:16.600 --> 00:30:19.840
I'll make a note to include this in the lesson five.

00:30:19.840 --> 00:30:23.320
All right, and everyone let me know once you have that applied.

00:30:23.320 --> 00:30:25.340
And you can test it in your browser.

00:30:25.340 --> 00:30:26.740
Everyone's applied it now, right?

00:30:30.340 --> 00:30:31.520
But you haven't applied it yet?

00:30:33.020 --> 00:30:38.020
Apply a hyphen f and then nginx-app.yaml.

00:30:38.020 --> 00:30:38.400
All right.

00:30:38.400 --> 00:30:43.460
So now you're going to try that in your browser, that IP address and port.

00:30:43.480 --> 00:30:44.860
Remember how we got that before?

00:30:44.860 --> 00:30:51.180
try to get your ip address import again yeah so kubectl apply hyphen f and then

00:30:51.180 --> 00:30:57.820
nginx dash app.yml and then go through those three commands there and then type that url into

00:30:59.420 --> 00:31:03.980
your browser and if we were to describe the service you'd see that there are endpoints

00:31:03.980 --> 00:31:09.020
and when you type it into your browser you should see welcome to engine now yes yep so you should

00:31:09.020 --> 00:31:19.420
see let's see what we do we did two and then we do two um yeah yeah so we should have two pods

00:31:19.420 --> 00:31:26.540
in there i believe um you should be able to access it from the url type in a minikube service engine

00:31:26.540 --> 00:31:34.220
access service yep so that one should work right so because we're only able to access into the

00:31:34.220 --> 00:31:41.980
cluster through the node port so we type the node port after the url and so we can't actually access

00:31:41.980 --> 00:31:47.020
the pods themselves but we can access the node port uh yeah but the node port would be after

00:31:47.020 --> 00:31:52.300
the code so it's going to be five digits i believe so everyone should have five digits for their node

00:31:52.300 --> 00:32:01.420
port yep it'll probably be different between all of you okay yeah all right so now we're going to

00:32:01.420 --> 00:32:07.480
and delete the node port service to kubectl delete hyphen F and then the

00:32:07.480 --> 00:32:10.540
name of the file or kubectl delete.

00:32:10.820 --> 00:32:13.900
Let's see now we'll just delete the load balancer service with the file.

00:32:14.020 --> 00:32:14.800
Let's keep it simple.

00:32:14.800 --> 00:32:16.540
What was the name of your node port service?

00:32:17.380 --> 00:32:17.980
The file name?

00:32:17.980 --> 00:32:22.420
Oh, no, no, we're deleting the service, not the deployment.

00:32:22.420 --> 00:32:25.700
Everyone let me know if you have an issue deleting your service.

00:32:25.700 --> 00:32:26.080
Nope.

00:32:26.360 --> 00:32:26.620
Nope.

00:32:26.620 --> 00:32:32.580
We were on node port dash service.yaml.

00:32:32.580 --> 00:32:38.100
I believe yes because it's in the default namespace yes service.yaml yeah oh because you're

00:32:38.100 --> 00:32:43.360
not in your you're not in the folder where it's at so you'll need to go back into your lesson five

00:32:43.360 --> 00:32:48.640
folder go back into your k8s4day and then your lesson five folder and then you'll find it in

00:32:48.640 --> 00:32:56.440
there I think let's see we started at 11 it's 1 15 so we'll take it once everyone has deleted that

00:32:56.440 --> 00:33:02.420
and we'll have our 30 minute break all right we'll see everyone back here at 1 45 ish all right

00:33:02.420 --> 00:33:06.520
For our next practice, we're going to create a load balancer service.

00:33:07.780 --> 00:33:12.240
And I know you're with the Talos cluster reviews, MetalLB on that.

00:33:12.740 --> 00:33:17.000
We'll be using a tunnel to create this for Minikube.

00:33:17.320 --> 00:33:18.580
Let's see, who are we still waiting on?

00:33:18.620 --> 00:33:18.800
John.

00:33:19.080 --> 00:33:19.440
Okay.

00:33:19.840 --> 00:33:20.960
Let's see for the rest of you.

00:33:21.880 --> 00:33:24.420
I'm going to go ahead and apply.

00:33:24.620 --> 00:33:29.280
It should be under load balancer-service.yaml in lesson five.

00:33:29.280 --> 00:33:37.840
assuming that everyone successfully deleted their node port service otherwise we might have issues

00:33:37.840 --> 00:33:44.000
yeah we might have some conflicts in the same namespace same name in the same namespace

00:33:44.000 --> 00:33:53.180
yes if you apply the load balancer service.yaml then we should have service created

00:33:53.180 --> 00:33:59.260
does everyone type that in okay now we're gonna check what what

00:34:01.100 --> 00:34:06.380
yeah so just control fly hyphen f but you'll have to be in the directory for lesson five

00:34:07.900 --> 00:34:13.260
oh there you go okay let's see here all right so now we're going to check the service google

00:34:13.260 --> 00:34:17.740
control get service nginx service i try to keep the names the same just so you can use it up arrow

00:34:17.740 --> 00:34:23.340
make it really easy for you. No, I did all of that for you. I typed it all out. So do you notice

00:34:23.340 --> 00:34:33.820
anything different when you get the service NGINX service? Yep. Yep. So we hit type load balancer

00:34:33.820 --> 00:34:39.660
and our external IP is pending. And then we'll describe the service NGINX service.

00:34:40.960 --> 00:34:44.680
And we'll make sure you have some endpoints. Always something good to check when you have

00:34:44.680 --> 00:34:50.440
service make sure you have endpoints otherwise you connect to the service and um there are no

00:34:50.440 --> 00:34:55.080
endpoints for the service to connect to so it's still not going to work i think two right

00:34:57.080 --> 00:35:05.880
yeah i think we have two oh because you have the old um you have the older uh deployment.yml

00:35:05.880 --> 00:35:14.520
and then we had changed it down to two with more recently okay so now what's

00:35:14.520 --> 00:35:19.800
that yeah it's fine it doesn't make any difference for this room and you'll have

00:35:19.800 --> 00:35:25.860
to delete and then reapply well actually you know what you can John you can let's

00:35:25.860 --> 00:35:30.960
see it's strike group control apply hyphen F is an ex-deployment is that

00:35:30.960 --> 00:35:38.720
you just modified? Yeah, the nginx-deployment.yml. That's the file you just modified, right?

00:35:38.720 --> 00:35:46.320
Or no, nginx-app.yml. Was that what you were just doing? All right. I think you all should too.

00:35:47.600 --> 00:35:56.320
There you go. All right. So now we described the service. You can see two endpoints. So now we're

00:35:56.320 --> 00:36:02.400
going to create a tunnel and we're going to open a set second tab in the terminal we're going to

00:36:02.400 --> 00:36:12.160
type in that second tab minicoop tunnel this simulates a load balancer okay so now i'm going

00:36:12.160 --> 00:36:16.480
to switch back to the first tab and we're going to get the load balancer service and notice anything

00:36:16.480 --> 00:36:22.480
different we do and the minicoop tunnel created a network route the load balancer service was issued

00:36:22.480 --> 00:36:30.800
an IP address. The external IP is populated now and in the browser we can navigate to

00:36:32.240 --> 00:36:40.240
http whatever your external IP is colon 88. You should see welcome to Nginx. Type

00:36:40.240 --> 00:36:45.600
kubectl git service nginx service again Ralph. Let's see what's going on there. Oh yep you have

00:36:45.600 --> 00:36:52.240
it. Okay so you want to use that IP address and external IP and then port 8080 and go.

00:36:52.240 --> 00:36:58.400
All right, and we can clean up the MiniCoop tunnel in the second tab by typing Ctrl C.

00:36:58.400 --> 00:37:05.520
Change back to the first tab and check our service again. So Coop Control gets service

00:37:05.520 --> 00:37:12.080
in GenX service. Yep, no longer have a load balancer. It's that fast. Okay, we're going to

00:37:12.080 --> 00:37:19.600
skip MetalLB. I think two individuals in here at least have worked with MetalLB and the new cluster

00:37:19.600 --> 00:37:27.600
will not be using metal lb so we'll go ahead and skip that we're going to go to dns query

00:37:27.600 --> 00:37:47.350
so let's see i believe i typed this out for you already so in lesson five you should have a dns

00:37:47.350 --> 00:38:01.880
utils dot yaml file go ahead and apply that and you should see that it's running when you check

00:38:01.880 --> 00:38:26.230
the status, kubectl get pods, and then we can describe the pod. Is it running? Okay,

00:38:28.500 --> 00:38:36.180
now we're going to check the cluster DNS for the internal DNS. We're going to exec into the pod

00:38:36.180 --> 00:38:42.260
with kubectl exec, and then interactive terminal, so it's hyphen it for interactive terminal,

00:38:42.820 --> 00:38:49.140
and then the name of our pod is dnsutils, and then a double hyphen, and then a space,

00:38:49.140 --> 00:38:55.060
and we're not going to use an sh or anything we're just going to use the ns lookup tool and we're

00:38:55.060 --> 00:39:01.300
going to type ns lookup space kubernetes.com and you should see a result something like this

00:39:04.340 --> 00:39:09.620
and now we're going to query for external dns we're going to go out of the cluster

00:39:11.140 --> 00:39:16.740
so we're going to do a control exact and this time we're going to ns look up google.com and

00:39:16.740 --> 00:39:23.940
We should see something like this. All right, so that is a nice convenient way to test DNS from

00:39:23.940 --> 00:39:29.220
within your cluster. If you're wondering, hey, am I communicating with the outside through egress,

00:39:29.780 --> 00:39:34.980
you can run a DNS Utils pod and check it very quickly. It's a great way to test that out,

00:39:35.540 --> 00:39:41.140
as well as to test out your internal DNS. If you're connecting through a headless service,

00:39:41.140 --> 00:39:48.020
for example, to a database, then you'll need to be able to test out that internal DNS as well.

00:39:48.020 --> 00:39:53.220
Now we're going to delete it. We'll delete, hyphenate dnsutils.yml. Now we're going to have

00:39:53.220 --> 00:40:00.580
some fun. We're going to work with ingress. Make sure you have a fresh minikube profile.

00:40:01.540 --> 00:40:04.900
Then we're going to create a single node minikube cluster. Once it is up,

00:40:04.900 --> 00:40:12.100
we'll go ahead and get the nodes and once we have nodes up to enable the minikube ingress

00:40:13.620 --> 00:40:17.380
and this uses nginx ingress by default which is deprecated now

00:40:17.380 --> 00:40:25.760
but hopefully they didn't just remove this yesterday so minikube add-ons enable ingress

00:40:27.680 --> 00:40:36.260
i imagine at some point they're going to change this a couple of versions so if they deprecated it

00:40:36.260 --> 00:40:41.120
at NGINX Ingress, it'll be in maintenance mode only.

00:40:41.120 --> 00:40:43.320
You'll still be able to download, load it and use it,

00:40:43.320 --> 00:40:45.420
but it won't be updated.

00:40:45.420 --> 00:40:48.660
They probably won't fix CVEs anymore.

00:40:48.660 --> 00:40:53.160
So CVEs, so it won't be secure,

00:40:53.160 --> 00:40:55.980
but you'll still be able to use it with Kubernetes.

00:40:55.980 --> 00:40:57.500
It just won't be updated.

00:40:58.800 --> 00:41:02.100
Yeah, NGINX Ingress was great for several years.

00:41:02.100 --> 00:41:04.740
I mean, it provided a lot of cloud type features

00:41:04.740 --> 00:41:12.290
for ingress, but Kubernetes developed their own ingress.

00:41:12.290 --> 00:41:15.990
And then we have Gateway API now.

00:41:15.990 --> 00:41:20.990
And so the original Nginx ingress was self-contained.

00:41:23.070 --> 00:41:25.330
So it's now deprecated and gone.

00:41:25.330 --> 00:41:27.870
And Kubernetes ingress will probably be around

00:41:27.870 --> 00:41:29.170
for another year or so.

00:41:30.370 --> 00:41:33.150
Cause I think that like Cilium's example,

00:41:33.150 --> 00:41:36.370
they're still developing the TLS route

00:41:36.370 --> 00:41:44.130
TCP route they had promised that in November. That's for Gateway API and my

00:41:44.130 --> 00:41:50.410
last check they pushed a commit up on Christmas Eve I think and the project

00:41:50.410 --> 00:41:54.750
manager for that ceiling project stated that up it ended up being more

00:41:54.750 --> 00:41:59.590
complicated than what they thought so they needed a little bit more time to

00:41:59.590 --> 00:42:07.890
finish the final gateway API route which is TCP route. So I expect sometime this

00:42:07.890 --> 00:42:12.370
month I'll have that finished and then pretty much once the upstream teams have

00:42:12.370 --> 00:42:18.310
all of their gateway APIs finished and out of experimental then you'll see the

00:42:18.310 --> 00:42:25.730
depredation notice for Kubernetes ingress API. Won't happen in the next few

00:42:25.730 --> 00:42:29.350
months but it wouldn't surprise me to see it this coming. Okay we've enabled

00:42:29.350 --> 00:42:37.830
to ingress let's get the pods let's see what that just threw into our cluster correct so it has a

00:42:37.830 --> 00:42:44.630
new uh namespace and you can do kubectl get pods hyphen capital a to see what the namespace is

00:42:45.350 --> 00:42:51.670
and then you can do kubectl get pods hyphen in the name of that namespace and that will limit

00:42:51.670 --> 00:42:59.670
the amount of data that's returned. And we only have one pod that is running, right? Is that correct?

00:42:59.670 --> 00:43:03.430
Yes. So it has to do several things, so it uses multiple pods for that.

00:43:06.150 --> 00:43:11.110
So we can get all now with that namespace. So kubectl get all hyphen in and then that

00:43:11.110 --> 00:43:18.470
namespace which is ingress dash engine. And what do we have there? Who wants to describe

00:43:18.470 --> 00:43:26.950
all of that out yep no external ips and we have um controller we have a deployment right and then

00:43:26.950 --> 00:43:37.190
that deployment the replica set and we only have one in that um we have two batches which are jobs

00:43:38.230 --> 00:43:44.950
right so job batch and those created the two that are completed in a pod so if you look at

00:43:44.950 --> 00:43:50.070
the three pods two of them are completed those were run by those job batches and now we're going

00:43:50.070 --> 00:44:02.870
to check that the ingress is enabled so we have um nginx ingress or ingress nginx installed

00:44:03.750 --> 00:44:12.230
but we have not created an ingress file yet we need an ingress kind to be created let's

00:44:12.230 --> 00:44:19.430
deploy an application use the nginx-app.yaml file assuming that you can find yours and it works

00:44:19.430 --> 00:44:28.870
let's go ahead and apply that first let's deploy the nginx app uh hyphen f yeah once you are in

00:44:28.870 --> 00:44:33.350
the correct directory for it and it will check out pods and make sure that's uh normally i have you

00:44:33.350 --> 00:44:39.190
type all of these out and then it's all in the same folder so it's real easy to find it so now

00:44:39.190 --> 00:44:44.850
Now I know I need to include those into Lesson 5.

00:44:45.010 --> 00:44:48.690
All right, so we should have two NGINX deployments, right?

00:44:49.230 --> 00:45:16.990
Well, I think your NGINX app.yaml in that folder is empty.

00:45:17.470 --> 00:45:18.030
Try to verify.

00:45:18.470 --> 00:45:20.510
Well, I think that was the one that was empty.

00:45:37.450 --> 00:45:39.430
Okay, then you have to go back to Lesson 5.

00:45:40.890 --> 00:45:44.460
All right, let's deploy a NodePort service

00:45:44.460 --> 00:45:47.540
using the prior NodePort-service.yaml file.

00:45:47.780 --> 00:45:50.680
Deploy the NodePort service for the NGINX app.

00:45:50.680 --> 00:46:13.860
And once you deploy it we'll check the service and then we'll get all pods and

00:46:13.860 --> 00:46:20.110
services in the default namespace. Now we're going to test the node port

00:46:20.110 --> 00:46:26.470
service with the Nginx app. So minicube service and then remember your service

00:46:26.470 --> 00:46:30.830
name and then the double hyphen URL and we'll test it in the browser. So we have

00:46:30.830 --> 00:46:35.230
verified that the Nginx app can be accessed correctly through the service.

00:46:35.230 --> 00:46:43.030
all right so now we need to create an ingress so we're going to apply the

00:46:43.030 --> 00:46:49.550
service ingress.yaml chapter 5 I might have a typo in there anyone else get that

00:46:49.550 --> 00:46:54.330
error yeah look here let's see here let's see if that matches what I have up

00:46:54.330 --> 00:46:59.630
on the up on the screen let's see what the error was let's see bad request

00:46:59.630 --> 00:47:09.870
Let's see, ingress, be handled as an ingress, JSON cannot un-martial, I can't quite read

00:47:09.870 --> 00:47:10.870
that.

00:47:10.870 --> 00:47:19.550
Someone read to me what that says, cannot un-martial a type of path-missing, yeah.

00:47:19.550 --> 00:47:24.110
See even I make mistakes, so first person try that, see if that works.

00:47:24.110 --> 00:47:25.110
Work for you, Stanley.

00:47:25.110 --> 00:47:26.110
Okay, work for you, Ralph.

00:47:26.110 --> 00:47:27.110
Okay.

00:47:27.110 --> 00:47:35.190
so let's see here all right so we've now deployed it now let's check for an ingress

00:47:36.390 --> 00:47:43.750
to control get ingress hyphen capital a and what do you see john traders there you go now you have a

00:47:43.750 --> 00:47:50.950
address okay so now test the ftd into the browser would be your nginx dot example so

00:47:50.950 --> 00:47:59.830
http nginx.example. A fully qualified domain name. It should be nginx.example. So you type http,

00:48:00.630 --> 00:48:03.590
because sometimes the browser will automatically change it to s,

00:48:03.590 --> 00:48:12.630
https. You want to make sure it's http colon forward slash forward slash nginx.example.

00:48:12.630 --> 00:48:18.790
Okay, so we have we're having trouble finding that site. And John, do the FQDN,

00:48:18.790 --> 00:48:26.730
which is nginx.example no cheating allowed all right there we go well stanley's on a different

00:48:26.730 --> 00:48:33.450
page but oh yeah do you do a new one just do http and then colon forward slash forward slash

00:48:33.450 --> 00:48:40.870
oh that's bizarre it's frozen uh close out the whole thing i guess because you kind of need the

00:48:40.870 --> 00:48:45.570
browser i guess yeah the browser well so there's a reason for that it's still not working stanley

00:48:45.570 --> 00:48:50.530
Okay, um, you might have, let's see, let me see where this ends.

00:48:52.690 --> 00:48:57.330
Okay, yeah, so we ensure a fresh Minicoop environment after this, so what we'll do is

00:48:57.330 --> 00:49:02.770
I'll have you log out and log back in and that'll fix everything that should. Somehow your browser,

00:49:04.610 --> 00:49:10.210
yeah, somehow your browser is logged up, so after this practice seven is over, I'll have you log out

00:49:10.210 --> 00:49:14.370
and log back in for practice eight because that's when we'll ensure a fresh Minicoop.

00:49:14.370 --> 00:49:21.250
Okay, so let's see here. What happened? Well, we need to create a DNS record, right? We don't have

00:49:21.250 --> 00:49:29.490
a DNS record for nginx.example. So we need to point nginx.example to the Minikube IP.

00:49:29.490 --> 00:49:37.730
So let's get the Minikube IP first. And let's use a local Ubuntu DNS resolver for the browser.

00:49:37.730 --> 00:49:46.170
so just echo this into the terminal so echo that minicube ip that showed up engine x.example

00:49:46.170 --> 00:49:52.850
and then we pipe it and sudo t because we're going to add it to we're going to hyphen a so

00:49:52.850 --> 00:49:58.190
we're going to add it to the etc host spot so we'll need this done on yours stanley because

00:49:58.190 --> 00:50:05.030
we'll need this for the next examples yeah so it should just reply one and once you have done that

00:50:05.030 --> 00:50:09.850
successfully you've echoed that is everyone echoed that you get all kinds of problems don't you

00:50:09.850 --> 00:50:14.470
yeah it's weird um try getting rid of some of your tabs

00:50:14.470 --> 00:50:20.150
you're using a different browser than everyone else's

00:50:20.150 --> 00:50:29.250
okay try to open a new terminal just a brand new one just go over to the menu type in terminal

00:50:29.250 --> 00:50:34.130
and open it. Yeah, there you go. Just open a new one. See if a new terminal will work for you and

00:50:34.130 --> 00:50:40.530
let's see if we can echo that in. Yeah, I think your instance is frozen. All right, yeah, go ahead

00:50:40.530 --> 00:50:47.730
and log out and log back in. Shut down your... I think you click on it, just stop and then click

00:50:47.730 --> 00:50:56.450
on it connect again and it should give you a fresh instance because we'll need this step for the

00:50:56.450 --> 00:51:08.900
future examples. And for the rest of you, you can type the NS record. NS lookup, nginx.example.

00:51:09.620 --> 00:51:12.340
Oh, did you get yours back up again? Yeah, let's see here.

00:51:14.020 --> 00:51:21.060
echo that minicube ip nginx.example nginx.example. Yeah, and then you're going to sudo t it.

00:51:21.060 --> 00:51:27.060
So if you can see my, I have a pipe and then sudo t. You see the slide and we're going to add it.

00:51:27.060 --> 00:51:34.020
so hyphen a to the etc host there we go and this may take a little while to populate and cache

00:51:34.020 --> 00:51:38.180
so we're going to test the dns record you just have to keep testing it until it populates

00:51:38.180 --> 00:51:46.580
and let's look up nginx.example keep testing it until it can find it so usually after less than

00:51:46.580 --> 00:51:53.780
a minute it will cache it and work so let's see here that might work but let's check it someone

00:51:53.780 --> 00:52:04.540
cat the um uh the file so cat um etc hosts so forward slash etc forward slash host let's see

00:52:04.540 --> 00:52:11.160
what's in there all right so we have it in there let's see if um let's speed this up if we can

00:52:11.160 --> 00:52:19.240
reload this maybe yeah and then hosts and forward slash hosts and it should show yeah hosts it

00:52:19.240 --> 00:52:26.520
should show nginx.example for that IP address. And when we nslookup, we should be able to find

00:52:26.520 --> 00:52:35.140
it under nginx.example. I'm just testing something out on my end here. Yeah, keep testing yours. It

00:52:35.140 --> 00:52:41.780
worked on weird. Keep testing yours. I don't know what's going on with your instances, but

00:52:41.780 --> 00:52:50.680
it is in there, but nslookup is not working. All right, so let's just try something. Test the

00:52:50.680 --> 00:52:57.720
ingress in the browser test the non-encrypted ingress that could be an ns lookup error um

00:52:57.720 --> 00:53:05.160
test http okay so ns lookup is having an issue so it's an ns lookup issue is what it is

00:53:05.160 --> 00:53:09.600
so it's working it should be instant i've never had it take more than a minute

00:53:09.600 --> 00:53:18.940
um that's bizarre okay no i think um the ns lookup is has an issue on the vms i think it's an ns

00:53:18.940 --> 00:53:23.660
lookup issue i think it's there and it's working fine but we'll find out here in just a second

00:53:23.660 --> 00:53:30.420
so we have a server error right does everyone have a server error when they type in http engine

00:53:30.420 --> 00:53:36.500
x.example everyone should say it should say 503 service temporarily unavailable if you open your

00:53:36.500 --> 00:53:40.940
browser and type that in what do you stand did you get that okay and then ralph did you get a 503

00:53:40.940 --> 00:53:47.240
yeah let's see if you get a 503 as well all right so ns lookup has just failed on 4vm that's wild

00:53:47.240 --> 00:53:54.120
Okay, moving on. We figured that out. Let's check the ingress. So we have a 503 and

00:53:54.120 --> 00:54:01.280
why is that? Let's check the ingress. Coup control, get ingress. The ingress name in the

00:54:01.280 --> 00:54:07.100
namespace and let's look for any events. Let's get the ingress first and then

00:54:07.100 --> 00:54:13.460
let's describe the ingress. What do you see and why? Ah yes, I believe so. I'm on a

00:54:13.460 --> 00:54:22.260
a different slide let me see if i can scroll up outside of this it is named service ingress you

00:54:22.260 --> 00:54:29.220
can always get ingress hyphen a in order to try to look up the name and the name space so you can do

00:54:29.220 --> 00:54:35.460
coop control get ingress hyphen capital a and then from that you can find the ingress name and the

00:54:35.460 --> 00:54:40.820
namespace service ingress and it's in coop system and from that we're going to describe in a coop

00:54:40.820 --> 00:54:47.780
control describe that ingress and once you describe that ingress tell me what

00:54:47.780 --> 00:54:53.140
you see and why that might be yeah mm-hmm except that if we check our

00:54:53.140 --> 00:55:01.520
services we have an Internet surface right yeah endpoints are kind of messed

00:55:01.520 --> 00:55:07.080
up aren't they let's see here so the next step is we're gonna fix the

00:55:07.080 --> 00:55:15.400
ingress, we need to change the namespace. If you notice, this is in the kubesystem namespace

00:55:15.400 --> 00:55:22.760
for service ingress. And where is our nginx deployment at? Where's our nginx service?

00:55:22.760 --> 00:55:26.760
Let's open up our nginx service and check the namespace for nginx service. Yeah,

00:55:26.760 --> 00:55:31.400
it's in the default namespace. Yeah, so we have an ingress in the kubesystem namespace,

00:55:31.400 --> 00:55:37.400
but our service that it's trying to connect to again is in the default namespace so it's trying

00:55:37.400 --> 00:55:43.400
to find something in the kube system namespace so we need to tell the ingress we're going to

00:55:43.400 --> 00:55:50.440
delete this service internet in the service ingress.yaml so let me go to the next slide

00:55:51.800 --> 00:55:57.000
you change the namespace we're going to delete i can have service dash ingress.yaml

00:55:57.000 --> 00:56:03.500
So remove that ingress, and we're going to vim into it, and we're going to change the

00:56:03.500 --> 00:56:04.500
namespace.

00:56:04.500 --> 00:56:15.240
So it currently says, open that up here, coop system, yeah, namespace is coop system.

00:56:15.240 --> 00:56:19.220
So after you delete it, because you want to delete it first before you modify it, because

00:56:19.220 --> 00:56:21.280
you're going to change the namespace.

00:56:21.280 --> 00:56:26.980
So remember when you delete, it's going to delete based on the namespace in that file.

00:56:26.980 --> 00:56:31.740
So we need to, we need to delete it first and then modify.

00:56:31.740 --> 00:56:35.160
Let's see, it looks like most everyone has deleted it.

00:56:35.160 --> 00:56:37.480
And then you will modify the ingress,

00:56:37.480 --> 00:56:40.220
so sudo vim service-ingress.yaml.

00:56:40.220 --> 00:56:41.720
And we'll change the namespace

00:56:41.720 --> 00:56:47.590
to the nginx service namespace, which is default, correct.

00:56:47.590 --> 00:56:49.710
Does everyone understand what we were doing there?

00:56:49.710 --> 00:56:53.050
We have an ingress in kubesystem namespace,

00:56:53.050 --> 00:56:56.150
but we have a service in the default namespace.

00:56:56.150 --> 00:56:58.670
We have an app in the default namespace.

00:56:59.030 --> 00:57:01.130
So the app and the service are wired together.

00:57:01.130 --> 00:57:05.830
We tested those earlier, but our ingress was deployed to the wrong namespace.

00:57:05.830 --> 00:57:07.430
It did not have endpoints.

00:57:07.470 --> 00:57:12.350
Most of the time, however, with Gateway API, we can enable it

00:57:12.350 --> 00:57:14.210
to work in different namespaces.

00:57:14.210 --> 00:57:18.070
Gateway API has a lot of features available to it.

00:57:18.070 --> 00:57:19.270
Ah, yes, correct.

00:57:19.310 --> 00:57:21.810
So we'll reapply, we'll deploy and reapply.

00:57:21.870 --> 00:57:25.650
So kubectl apply-f service-ingress.yaml.

00:57:25.650 --> 00:57:31.050
Then we're going to check the ingress and let's do kubectl get ingress, the

00:57:31.050 --> 00:57:34.410
ingress name, hyphen n in the namespace.

00:57:35.850 --> 00:57:37.890
I remember we just changed the namespace.

00:57:37.930 --> 00:57:39.050
And let's describe it.

00:57:39.610 --> 00:57:40.690
I'm not creating any events.

00:57:42.290 --> 00:57:43.530
And what do we see in there?

00:57:44.810 --> 00:57:46.250
You have endpoints, right?

00:57:47.650 --> 00:57:48.250
Yeah.

00:57:48.450 --> 00:57:48.770
Yeah.

00:57:48.770 --> 00:57:53.410
So something to remember when we're working with ingresses and, and services,

00:57:53.410 --> 00:58:00.090
We always want to make sure we have endpoints unless it's, you know, an orphan service or we have something.

00:58:00.210 --> 00:58:04.550
Generally, it's the first place we look if we have a problem with our ingress into the clusters.

00:58:04.750 --> 00:58:05.690
Do we have endpoints?

00:58:05.870 --> 00:58:09.030
And you should see two endpoints listed just like you did with the service.

00:58:09.170 --> 00:58:14.150
So what it does is it grabs those endpoints from the service and it now populates those into the ingress.

00:58:14.250 --> 00:58:15.710
So did that make sense to everyone?

00:58:15.710 --> 00:58:23.050
If you go down to rules under host, NGINX, for example, if you look, you see NGINX service, I believe it's 8080.

00:58:23.410 --> 00:58:26.870
And remember before it said could not, what was it?

00:58:26.970 --> 00:58:28.890
Could not something with a service.

00:58:29.050 --> 00:58:29.210
Yep.

00:58:29.350 --> 00:58:31.790
And so now you can see that you have endpoints in there.

00:58:33.330 --> 00:58:36.700
Ah, yes, yes, yes.

00:58:36.860 --> 00:58:37.260
Okay.

00:58:37.660 --> 00:58:39.700
Does everyone kind of understand how that works now?

00:58:39.840 --> 00:58:41.160
So remember when we looked at this?

00:58:41.280 --> 00:58:44.460
Well, do you remember when we described the service?

00:58:44.780 --> 00:58:51.060
If you describe the service that it's connecting to, which I can't quite see your screen, but I believe it's NGINX-service.

00:58:51.060 --> 00:58:56.980
service. If you describe that service, you should see those same two endpoints. So what

00:58:56.980 --> 00:59:01.140
it's doing is it's hitting that service and it's grabbing the endpoints from that service

00:59:01.140 --> 00:59:08.280
and populating the ingress. So you're in the ingress right now and it is with the YAML

00:59:08.280 --> 00:59:17.220
file. Sometimes this helps having to type up a full YAML file, but in that YAML file

00:59:17.220 --> 00:59:22.280
for the ingress, we are telling it to find that service. So we're giving it the information for

00:59:22.280 --> 00:59:26.980
the service that we're looking for in the default namespace. Remember, we were looking in the kube

00:59:26.980 --> 00:59:31.540
system. There wasn't anything. So that's why we had an error. We changed it to find that service

00:59:31.540 --> 00:59:38.180
in the default namespace. So now it finds that service, and that service has two endpoints

00:59:38.180 --> 00:59:44.580
populated. And so those two endpoints come from that service to the ingress. And so the ingress

00:59:44.580 --> 00:59:48.260
shows both of those endpoints and it should match up with what you see in the service

00:59:49.620 --> 00:59:54.900
okay so now practice eight how's your vm running uh stanley

00:59:56.820 --> 01:00:01.940
okay i want to make sure everyone understands ingress because it's pretty key when you start

01:00:01.940 --> 01:00:05.780
to work with your kubernetes cluster that you understand how the ingress works

01:00:05.780 --> 01:00:11.060
we have endpoints right so we we make sure we have endpoints at the service level first and

01:00:11.060 --> 01:00:17.780
it can connect to our application pods and then our ingress or gateway api we make sure that it has

01:00:18.500 --> 01:00:22.340
access to a correct service can pull those endpoints to populate

01:00:23.220 --> 01:00:29.140
the um the ingress with that okay let's see is it time for i think it is all right we'll take

01:00:29.140 --> 01:00:35.140
a two minute break and when we come back uh we are going to create a mini cluster with a cni

01:00:35.140 --> 01:00:42.020
I'll see you on back here in about two minutes. Okay, so whenever we're ready, you can ensure a

01:00:42.020 --> 01:00:48.660
fresh mini-cube environment, and this time we're going to start it with cnenifal, cnenicillium,

01:00:48.660 --> 01:00:55.300
and just three nodes. So with three nodes, remember it'll just be a single control plane,

01:00:56.580 --> 01:01:01.860
and then two worker nodes because we're not going to mess with the HA because as you remember back

01:01:01.860 --> 01:01:08.980
to yesterday h8 does not have all of the configs in it correctly to work with cilium and cupid

01:01:09.620 --> 01:01:14.900
so anytime you're working with ingress and services the first thing that you always look

01:01:14.900 --> 01:01:19.300
for in points and that'll give you kind of a clue as to if there's something wrong

01:01:20.100 --> 01:01:27.940
also look for events by describing although we generally don't uh see a lot of feedback

01:01:27.940 --> 01:01:33.540
in events even if something is wrong. So it doesn't always trigger an event. So endpoints is the

01:01:34.100 --> 01:01:38.980
quickest way to try to discover if there's a problem. And then once that's up you can get

01:01:38.980 --> 01:01:48.660
your nodes and your pods. And we'll take a look at what we have here. All right so I'm sorry what

01:01:48.660 --> 01:01:57.780
was that? Yeah so it restarted every time it added a node then it restarted. It's got cilium in there

01:01:57.780 --> 01:02:08.340
and so core DNS changed with Cilium. So we have a Cilium agent on every node. We have a Cilium

01:02:08.340 --> 01:02:16.340
envoy on every node. If you do wide, you'll be able to see the node names. So kubectl pods hyphen

01:02:16.340 --> 01:02:23.220
a and then remember we're going to use the hyphen o for options and then wide. And now you can see

01:02:23.220 --> 01:02:28.900
the node names all right and then we have a psyllium operator on the control plane

01:02:29.540 --> 01:02:35.940
node and then we can describe the various pods you can describe for example one of the psyllium just

01:02:35.940 --> 01:02:41.220
pick one of the psyllium agent pods or envoy and just describe that out and take a look at it and

01:02:41.220 --> 01:02:48.740
how many minutes ago probably when it was spinning up is it safe yeah give it like another 10 seconds

01:02:48.740 --> 01:02:53.460
and let's see if it still does that and that'd be interesting uh cube control let's see what um

01:02:54.580 --> 01:03:01.780
uh it's probably in the coop system namespace so uh kubectl describe pod the psyllium space with

01:03:01.780 --> 01:03:09.620
the hash and then hyphen in kuva dash system yeah it should work i think that'll be the envoy but

01:03:09.620 --> 01:03:14.500
yeah and see stanley were you the one having the unhealthy yeah so it looks like that was

01:03:14.500 --> 01:03:20.820
a startup initially and looks like it's fine now. So it doesn't, yeah, it doesn't always provide you

01:03:20.820 --> 01:03:27.300
an event when it solves its issue. It just tells you that it has an event and then now there's no,

01:03:27.300 --> 01:03:33.780
there's no new event because it solved it. So again, one of the ways that, um, sometimes I wish,

01:03:34.500 --> 01:03:39.860
uh, Kubernetes was just a little bit more descriptive. Right. Cause that's the last

01:03:39.860 --> 01:03:45.380
of in right so yeah unfortunately it doesn't tell us that it became healthy

01:03:46.740 --> 01:03:53.620
but generally once it's you know gone past two minutes and you can test you can describe it

01:03:53.620 --> 01:03:59.860
go up scroll up a little bit and you can see how long that startup pro is for so if we scroll up a

01:03:59.860 --> 01:04:06.100
little bit more maybe a startup program here somewhere a little bit more keep going there's

01:04:06.100 --> 01:04:08.800
This is a big Describe file.

01:04:10.480 --> 01:04:11.080
There we go.

01:04:11.260 --> 01:04:11.560
All right.

01:04:11.560 --> 01:04:12.640
Let's see our startup.

01:04:13.280 --> 01:04:16.720
It says, uh, delay five seconds, timeout one.

01:04:16.780 --> 01:04:18.700
I can't read the rest, unfortunately.

01:04:20.240 --> 01:04:21.320
What does it say?

01:04:21.360 --> 01:04:23.140
Uh, oh, it can fail 300 times.

01:04:23.560 --> 01:04:26.380
So anyway, cause it may take a while to start.

01:04:27.140 --> 01:04:27.640
What's that?

01:04:27.720 --> 01:04:29.060
Yes, correct.

01:04:29.840 --> 01:04:31.700
Uh, hyphen in before poop system.

01:04:31.740 --> 01:04:32.300
Yeah.

01:04:32.300 --> 01:04:39.500
and then um so you can see that um you can kind of look up there and see

01:04:39.500 --> 01:04:43.180
uh when it should have kept triggering and obviously

01:04:43.180 --> 01:04:47.100
it's a fairly fast startup probe so three minutes

01:04:47.100 --> 01:04:53.900
for sure it no longer has an issue okay we're going to skip to testing this

01:04:53.900 --> 01:04:58.220
with uh our remember we have our psyllium cli

01:04:58.220 --> 01:05:01.340
installed remember when we check the version on that so we're going to go

01:05:01.340 --> 01:05:10.660
two let's see here so we're gonna do um psyllium status now hey we have color in our terminal yes

01:05:10.660 --> 01:05:18.100
operator is okay envoy is okay hubble relay telemetry is disabled but we don't have

01:05:19.300 --> 01:05:25.060
the configs in for that right cluster mesh is disabled cluster mesh is kind of cool

01:05:25.060 --> 01:05:29.380
takes a while to set up but basically you can have multiple clusters together connected with

01:05:29.380 --> 01:05:37.060
a mesh that's encrypted. So you could have a database cluster and a workload cluster and

01:05:37.060 --> 01:05:42.580
you put a cluster mesh between them, but they take quite a bit of work to set up because they

01:05:42.580 --> 01:05:49.540
have to be fault tolerant. When we were describing the 4000 node cluster and how today that would be

01:05:49.540 --> 01:05:56.180
built with say five clusters of a hundred nodes, you would run a cluster mesh between those so it

01:05:56.180 --> 01:06:03.220
was still viewed as as a single environment connected with an encrypted cluster mesh.

01:06:04.900 --> 01:06:11.620
But those take usually weeks to write the code for the cluster mesh so that it's full.

01:06:11.620 --> 01:06:16.820
So this does have the capability of doing a cluster mesh and we have three warnings. Let's

01:06:16.820 --> 01:06:23.940
see they're down at the bottom I think. Oh yeah, Hubble. See Hubble starting, Hubble starting,

01:06:23.940 --> 01:06:31.140
Hubble Starter because we have telemetry disabled for Hubble Relay. So I don't think that's going to

01:06:31.140 --> 01:06:37.620
work. So it's going to throw warnings. Okay so now we're going to make sure we have a fresh

01:06:37.620 --> 01:06:45.880
MiniCube profile. Let's see actually we can skip config map because we're going to go straight to

01:06:45.880 --> 01:06:54.220
secret. I think let me look because we're going to skip config map. We're going to use a config map

01:06:54.220 --> 01:07:06.940
with a job. But we're going to just treat the secrets. And you'll have these other practices

01:07:06.940 --> 01:07:12.940
in the PDF. So if you want to go through and create a basic config map, you can still go

01:07:12.940 --> 01:07:28.870
through and create that. So it'll still be in the PDF. All right, let's see 89. All right,

01:07:28.870 --> 01:07:34.950
so we're going to create a base64 encoded string of password. We will in just a second. I'm going

01:07:34.950 --> 01:07:42.790
to show you just a concept here of how to base64 encode in case some of you haven't done this

01:07:43.510 --> 01:07:51.750
and then we'll do it. So to base64 encode and it depends on the operating system. I generally do

01:07:51.750 --> 01:07:59.030
hyphen w zero it depends on the operating system hyphen w zero may not be recognized

01:08:00.550 --> 01:08:08.870
so it may give you an error um yeah so it took the uh the string password and it base64 encoded it

01:08:08.870 --> 01:08:16.070
so when we create a secret we need to be able to base64 encode the stream so it looks something

01:08:16.070 --> 01:08:25.350
like this and then we can decode it by using a similar um and in between the string instead of

01:08:25.350 --> 01:08:59.020
password we put that hash that base64 encoded string and it should output password so then

01:08:59.020 --> 01:09:05.660
you know how to base64 encode and decode and again the hyphen w0 may or may not work depending on

01:09:05.660 --> 01:09:14.840
the operating system you're on. You may need hyphen, W, or hyphen zero. They're

01:09:14.840 --> 01:09:19.880
different combinations, but I found this is the more universal way for it to work

01:09:19.880 --> 01:09:26.720
across Mac and Linux. Okay, now we're gonna work on secrets. So we can minicube

01:09:26.720 --> 01:09:31.640
stop, minicube delete all, minicube start, and kube control get nodes. And check our

01:09:31.640 --> 01:09:38.040
OpenSSL. Once you have your nodes up and you've verified you have a node, check your OpenSSL

01:09:38.040 --> 01:09:43.720
version. All right, everyone should have OpenSSL installed. Now we're going to create a local

01:09:43.720 --> 01:09:51.160
self-signed cert for an ingress secret. Notice we are using the name nginx.example

01:09:51.160 --> 01:10:03.360
for our common name, cn. You can just keep typing and it will probably go down to your

01:10:03.360 --> 01:10:09.520
second line it just depends if you if you widen your um your terminal to the entire screen i think

01:10:09.520 --> 01:10:18.560
it's all on one um a bunch of wild characters like pluses minuses and weird stuff pipes okay

01:10:18.560 --> 01:10:26.800
uh see someone's missing something here brian i think you're missing a secret from that tls search

01:10:26.800 --> 01:10:34.760
okay let's check that the secret was created control get secrets hyphen capital a did everyone

01:10:34.760 --> 01:10:43.480
created correctly. Yeah, let me go back. Yeah, there you go. Almost half the time the syntax

01:10:43.480 --> 01:10:50.520
is spelled. One character that brings the whole thing down. So now we can check that the secret

01:10:50.520 --> 01:10:57.240
was created. So we can tell it secrets hyphen capital A. All right. And if you notice it's of

01:10:57.240 --> 01:11:05.800
type kubernetes.io TLS. So we know that this is a TLS secret. All right, so let's view it. We're

01:11:05.800 --> 01:11:14.120
going to use the option flag for outputting in YAML. So our option is YAML. Yes,

01:11:15.400 --> 01:11:22.600
the TLS key and TLS cert are base64 encoded but not encrypted. So now we need a base64 to code

01:11:22.600 --> 01:11:27.720
them but I'm not going to make you cut and paste. We're going to do it this way. So take your previous

01:11:27.720 --> 01:11:37.000
command, but change it from YAML to JSON. We're going to use jq. This is very picky.

01:11:37.000 --> 01:11:42.160
You get one character wrong, it doesn't work right. So, dash r, yeah, single quote, dot

01:11:42.160 --> 01:11:47.840
data. Yeah, because there's a string that starts with dot data and ends with 64d. Mm-hmm.

01:11:47.840 --> 01:11:58.970
Yeah, and then everything after that. Yeah. Ingress TLS, and hyphen o, JSON, and then

01:11:58.970 --> 01:12:06.170
pipe.jq and space after pipe and single quote dot so space after r and then single quote and no

01:12:06.170 --> 01:12:12.010
space after the single quote hard to see on that slide but yeah space pipe equals space that there

01:12:12.010 --> 01:12:19.690
we go all right now that's not very helpful so let's um it's an x509 format and i don't know if

01:12:19.690 --> 01:12:26.810
anyone can interpret that just by looking at it because i sure can so let's output to open ssl so

01:12:26.810 --> 01:12:34.810
similar but we're going to output tls cert and just take a look all right ralph's up john is up

01:12:34.810 --> 01:12:39.850
stanley ryan all right so you can kind of see everything here and that's how we output it in x

01:12:39.850 --> 01:12:46.090
so it was an x509 format and now we use open ssl to output it in human readable format

01:12:47.450 --> 01:12:56.070
all right so now we're going to go to 8. so we're going to create an ingress using the secret we

01:12:56.070 --> 01:13:03.750
just created so remember we had that nginxapp.yaml so we're going to apply that and we're going to

01:13:05.270 --> 01:13:10.150
skip the um we normally just do the node port again and verify that our endpoints work but

01:13:10.150 --> 01:13:14.310
i think we've already verified that just a few minutes ago we know our node port service

01:13:14.310 --> 01:13:19.990
works and connects to the oh you're you're still trying to find the nginx app

01:13:19.990 --> 01:13:28.990
Yeah, that was probably in your root, shouldn't have, do an ls in your current bolt, in your

01:13:28.990 --> 01:13:34.750
current directory, in your terminal, no just do an ls, I see an nginxapp.yaml, okay everyone

01:13:34.750 --> 01:13:39.950
created it, all right, let's see here, we're gonna skip to, we're not gonna test it, we

01:13:39.950 --> 01:13:46.310
already tested it, we know that that works, right, so we're gonna do the minikube add-ons

01:13:46.310 --> 01:13:55.830
configure. Let's skip that test. Give me one second here. We have 15 minutes left, so I'm trying to...

01:13:56.550 --> 01:14:02.630
Yeah, let's go ahead and enable a node port. We don't have time to do that for balancers, so

01:14:03.830 --> 01:14:12.900
go ahead and apply the node-port-service.yml. Then we'll enable ingress. All right, does everyone

01:14:12.900 --> 01:14:20.580
have their node port service running all right so now we're going to configure the ingress so we're

01:14:20.580 --> 01:14:25.300
going to do minicoop add-ons configure ingress different than what we did before and the reason

01:14:25.300 --> 01:14:31.140
why is we need to input the custom cert in a namespace secret format so what is the namespace

01:14:31.140 --> 01:14:37.060
what is the secret name it's going to be coop system ingress tls with a forward slash all right

01:14:37.060 --> 01:14:43.540
One is configured. Two is configured. Three is configured. Four is configured. All right,

01:14:43.540 --> 01:14:47.860
let's see here. Now we're going to enable the ingress. Now we'll do what we did before with

01:14:47.860 --> 01:14:53.540
Minikube add-ons, enable ingress. And now it will start up and it knows where the secret is for the

01:14:53.540 --> 01:15:00.340
TLS. And we'll do kubectl get ingress. So take a second to come up and it has to create the pods

01:15:00.340 --> 01:15:06.100
for the Nginx ingress. And as the two of them complete as jobs, and then they show it's

01:15:06.100 --> 01:15:11.460
completed, and then one of them continuously runs today. Slides are stuck. There we go.

01:15:11.460 --> 01:15:18.020
Do control get ingress hyphen a. And what's going on? Yeah, can anyone think of why that is? Correct,

01:15:18.020 --> 01:15:22.740
we did not apply the ingress. So we have an ingress, we have an nginx ingress capability

01:15:22.740 --> 01:15:27.300
in the cluster, but we have no ingress. We have a service in pods. We have a TLS cert,

01:15:28.100 --> 01:15:34.340
but there's no bridge between the ingress, nginx ingress, and the service. So we need to create

01:15:34.340 --> 01:15:42.420
that using an ingress file but we want a tls ingress file so we're going to create a tls

01:15:42.420 --> 01:15:48.660
ingress.yml file or you already have that in there just make sure it matches this correct

01:15:48.660 --> 01:15:55.140
in the next example oh yes it needs to be under s right right yeah yeah that's correct kind of

01:15:55.140 --> 01:16:01.380
rushing this but if we if we were to take a second and you were to look at this and think back what

01:16:01.380 --> 01:16:08.580
we just did over the last hour what would you see here that may be not quite correct besides

01:16:08.580 --> 01:16:15.300
send yeah we're going to go back through all exercises again and normally um you know if we

01:16:15.300 --> 01:16:18.980
had a little bit additional time i'd take you through that and let you figure it out on your own

01:16:19.620 --> 01:16:28.660
um so yeah so we need to change the namespace what is a namespace yeah oh okay yep uh default

01:16:28.660 --> 01:16:32.820
all right so when you think you have it correct go ahead and apply it let's see what you have

01:16:32.820 --> 01:16:39.140
oh did you apply it okay check your ingress yeah check your ingress okay so now you want to check

01:16:39.140 --> 01:16:46.100
in your browser for https nginx.example yep and go ahead and accept it and welcome to nginx

01:16:48.020 --> 01:16:54.100
so you have to change it from http to https sometimes the browser even though you change

01:16:54.100 --> 01:17:00.500
it to https it will automatically change it back to http it looks like two of you have that issue

01:17:00.500 --> 01:17:07.460
and that is how there's a name for that for why the browser okay so ralph is finally able to get

01:17:07.460 --> 01:17:16.820
through his browser changing it there's a name for that ht i forget what it is hsts where it

01:17:16.820 --> 01:17:21.700
automatically does that yes that is correct and then go ahead and hit advanced and accept it

01:17:21.700 --> 01:17:30.080
yeah and accept that and stanley has problems with his browser so stanley i mean if you played

01:17:30.080 --> 01:17:34.200
around with it long enough you might be able to bypass what's built into the browser but it has

01:17:34.200 --> 01:17:42.880
somehow it is fixing you i think on http yeah um so when i develop and work with ingresses because

01:17:42.880 --> 01:17:50.760
i with kubernetes um oftentimes i will use the incognito so that it doesn't store that state

01:17:50.760 --> 01:17:57.740
in the browser um and that will take care of that so interesting we might have something

01:17:57.740 --> 01:18:06.290
slightly off on your set today you do have an ingress it is default and you know and

01:18:06.290 --> 01:18:12.370
temporarily unavailable check your service and see if you have endpoints check your ingress

01:18:12.370 --> 01:18:17.070
describe your ingress and see if you have it or actually it's in default we don't even need

01:18:17.070 --> 01:18:25.150
hyphen in. TLS ingress. TLS hyphen ingress. Oh, you changed your name to default.

01:18:26.030 --> 01:18:32.110
Yes, that's why it's not working. You have to go back in and change your name back to TLS ingress

01:18:32.910 --> 01:18:36.990
and then change your namespace to default and yours will work. I see what happened there.

01:18:39.230 --> 01:18:44.990
Get a sudo vim back into your ingress file. Oh, actually, no, don't sudo vim in. Delete

01:18:44.990 --> 01:18:51.950
kubectl apply or kubectl delete hyphen f oh wait what's it named default uh

01:18:52.910 --> 01:18:59.550
yeah so kubectl uh delete hyphen f and then the name of the file yeah

01:19:00.430 --> 01:19:05.070
yeah but the name of the file ain't that tls impressed there's another way we could have

01:19:05.070 --> 01:19:10.910
done that okay now so while stanley's doing that um you know how to change it now stanley so

01:19:10.910 --> 01:19:17.090
So, basically, we went through, there's one more practice left.

01:19:17.190 --> 01:19:20.130
We were going to do a Docker config secret.

01:19:20.550 --> 01:19:22.230
So, let's go to the review.

01:19:24.760 --> 01:19:28.060
If anyone wants to know how to do a Docker config secret, I think you already know.

01:19:29.720 --> 01:19:34.960
But if you need help with that, we will have that in the, that will be in the slot.

01:19:43.770 --> 01:19:49.830
So, unless you're working, Stanley, take your ingress and see what it says the name is.

01:19:49.830 --> 01:19:54.630
if that actually changed. Oh, there we go. All right. So in Lesson 5, we learned how service

01:19:54.630 --> 01:20:01.990
objects work. The three primary types of service objects, cluster IP, node port, and load balancer.

01:20:02.950 --> 01:20:06.550
How to create a load balancer using the tunnel, and we skipped the Metal LB.

01:20:08.790 --> 01:20:15.590
How DNS works within the cluster. How to verify internal DNS. How to verify external DNS. We must

01:20:15.590 --> 01:20:22.550
convert how ingress works how ingress enables clients to access workload endpoints and how

01:20:22.550 --> 01:20:27.750
ingress uses an ingress controller how ingress is managed through the kubernetes api

01:20:29.510 --> 01:20:37.670
and an ingress api is being replaced by gateway api now we must convert all ingress kind so that

01:20:37.670 --> 01:20:43.750
is what we just applied was that tls ingress that's a kind ingress kind now those have to

01:20:43.750 --> 01:20:53.590
be converted to gateway api and specifically http route when migrating over and when we convert to

01:20:53.590 --> 01:21:01.030
gateway api we need to install the crds first that gateway api relies on a gateway and http route

01:21:01.830 --> 01:21:10.550
and that gateway can share many http routes and we'll do training on gateway api on your

01:21:11.510 --> 01:21:18.150
RKE2 cluster because we'll have actual HTTP routes. Gateways provide greater flexibility,

01:21:18.150 --> 01:21:27.270
standardization, and scalability. And the Cilium was anticipated to be released in November of 2025

01:21:28.230 --> 01:21:34.550
for the final and they are running behind now. So I'm going to keep that date there and we'll track

01:21:34.550 --> 01:21:38.870
and see how long it takes. But I do anticipate they'll have something this month for the final

01:21:38.870 --> 01:21:43.910
TCP. We learned about container network interfaces, how CNI plugins are used for

01:21:43.910 --> 01:21:49.430
cluster networking, and how they can be used to manage network and security capabilities.

01:21:50.310 --> 01:21:57.110
They can be used to deploy the gateway API. Cilium is an example of a CNI. It's actually

01:21:57.110 --> 01:22:03.030
a full-featured CNI that is free open source. Cilium is a networking observability and security

01:22:03.030 --> 01:22:09.990
solution and how it works well bare metal with kubib. We skipped config maps because they're

01:22:09.990 --> 01:22:16.230
very similar to secrets but config maps are api objects used to store non-confidential data

01:22:16.230 --> 01:22:22.230
in key value pairs and the pods consume the config maps as environment variables.

01:22:23.750 --> 01:22:29.510
The max size for a config map is one megabit. Config maps do not provide secrecy or encryption.

01:22:30.390 --> 01:22:33.810
If you have confidential data, make sure you use a secret.

01:22:33.890 --> 01:22:36.730
ConfigMaps have both data and binary data fields.

01:22:37.830 --> 01:22:40.150
Data fields contain the UTF-8 strings,

01:22:40.710 --> 01:22:44.630
and binary data fields contains base64-encoded strings.

01:22:44.790 --> 01:22:47.750
We learned how to base64-encode and decode strings.

01:22:48.530 --> 01:22:49.750
We learned how to create a secret.

01:22:50.830 --> 01:22:54.830
The maximum secret size is the same as a ConfigMap, one megabit.

01:22:54.830 --> 01:23:00.030
We learned how to base64 encode both TLS cert and TLS key.

01:23:00.030 --> 01:23:04.790
How to read the secret is base64 encoded.

01:23:04.790 --> 01:23:08.430
And we learned how to read an X.509 cert and key a secret.

01:23:08.430 --> 01:23:14.670
We just did the cert and we didn't do the key, both in certificate and X.509 format.

01:23:14.670 --> 01:23:17.950
We learned how to create a Docker config secret.

01:23:17.950 --> 01:23:18.950
It's in there.

01:23:18.950 --> 01:23:23.890
It'll be in the final few pages of PDF format.

01:23:23.890 --> 01:23:26.510
So if you want to go through that exercise, you can.

01:23:29.250 --> 01:23:33.250
Docker config JSON secrets are used to access private repos.

01:23:34.570 --> 01:23:36.410
We learned how to read and decode.

01:23:36.670 --> 01:23:37.870
We did not go through that.

01:23:38.350 --> 01:23:39.070
All right.

01:23:39.570 --> 01:23:40.670
That's lesson five.

01:23:40.750 --> 01:23:41.890
I believe it is 3.30.

01:23:43.150 --> 01:23:44.570
Does anyone have any questions?

01:23:44.570 --> 01:23:48.310
I'm happy to stay later and go through anything if someone wants to.
