WEBVTT

00:00.143 --> 00:05.303
Hi. Let's go through this practice
test on troubleshooting

00:05.453 --> 00:07.233
and application failure.

00:07.313 --> 00:09.483
The first question is a simple two-tier

00:09.563 --> 00:12.543
application is deployed
in the alpha namespace,

00:12.623 --> 00:15.873
it must display a green webpage on success.

00:15.953 --> 00:19.353
Click on the App tab at the top
of your terminal to view your application.

00:19.433 --> 00:22.443
I can click here to open the application

00:22.523 --> 00:26.273
and I see that it is indeed
in a failed state.

00:27.173 --> 00:29.463
If I look at the error message, here,

00:29.543 --> 00:31.023
we can see
some of the environment variables,

00:31.103 --> 00:35.043
which we can use
while troubleshooting but it says,

00:35.123 --> 00:39.963
"Can't connect to MySQL
server on MySQL service:3306,

00:40.043 --> 00:41.961
name does not resolve."

00:42.053 --> 00:45.633
Basically, it looks like this web
application is unable to reach

00:45.713 --> 00:51.093
the MySQL service
because there's some issue with the name,

00:51.173 --> 00:53.341
is not able to resolve it.

00:53.513 --> 00:56.493
Let's look at this architecture diagram.

00:56.573 --> 00:59.253
Here, so it's a two-tier application.

00:59.333 --> 01:03.003
You have the web service here,
and you have the database service here

01:03.083 --> 01:05.673
and then you have the user accessing it.

01:05.753 --> 01:10.253
We know that this is most likely
a deployment or a pod,

01:10.343 --> 01:13.763
the web application is on 8080

01:14.183 --> 01:16.923
and then you have this web service,
which is on 8080

01:17.003 --> 01:19.803
and then this is the node port
that the users are accessing,

01:19.883 --> 01:23.853
which is 30081
and then you have the MySQL service,

01:23.933 --> 01:27.087
which is a service
that the web application user

01:27.167 --> 01:31.523
tries to connect to and this is a MySQL pod.

01:31.943 --> 01:35.853
Now looking at this state,
so we know that the web application loads,

01:35.933 --> 01:40.923
it's failed, the application is failed,
but at least the interface loads.

01:41.003 --> 01:46.763
Looking at it, this area seems
to be okay because this port 30081,

01:47.213 --> 01:51.400
this is the port that we are on, 30081.

01:51.700 --> 01:53.153
That's good.

01:54.143 --> 01:55.620
This patch looks okay,

01:55.700 --> 01:58.023
this web service has loaded the application.

01:58.103 --> 01:59.753
This also looks okay.

01:59.833 --> 02:01.413
There's some issue in this area,

02:01.493 --> 02:04.920
the application is unable
to reach the MySQL service

02:05.000 --> 02:07.353
at this name or at this port.

02:07.433 --> 02:11.017
Let's first take a look at the application.

02:11.183 --> 02:12.663
It's in the Alpha namespace.

02:12.743 --> 02:17.993
We're going to do a kubectl,
we'll get pods-namespace alpha.

02:19.523 --> 02:23.043
We're going to run a lot
of commands in the alpha namespace.

02:23.123 --> 02:25.893
It's best if we switch our context

02:25.973 --> 02:28.293
and set the alpha namespace
as the default namespace

02:28.373 --> 02:32.453
because we don't want to be typing
in the namespace for each command.

02:32.533 --> 02:37.700
Let's do a kubectl config
and let's check the help,

02:38.600 --> 02:40.226
find out the command.

02:40.306 --> 02:42.413
We can use a set context.

02:46.473 --> 02:52.253
We're going to do a set context
and then let's check the help.

02:54.053 --> 02:58.720
Now, what we want to do is,
we want to set the namespace.

02:58.853 --> 03:00.387
We're going to use the set context

03:00.467 --> 03:03.053
and then the current context.

03:04.133 --> 03:08.300
We want to set the namespace
of the current context

03:09.267 --> 03:12.593
to the namespace equals alpha.

03:14.903 --> 03:16.120
Okay, so that's nullified.

03:16.200 --> 03:19.473
Let's try because we'll just get pods now

03:19.553 --> 03:24.803
and we'll see that we can see
the pods in the current namespace.

03:25.343 --> 03:28.953
As we suspected,
the web application is a deployment.

03:29.033 --> 03:30.713
Let's do a deploy.

03:31.193 --> 03:35.043
The web app is a deployment
and the SQL Server is a pod

03:35.123 --> 03:37.933
and we also have services

03:39.719 --> 03:43.306
and so the SQL Server has the MySQL service

03:43.643 --> 03:46.893
and the web application has the web service.

03:46.973 --> 03:52.233
There's another way to test if the web
application is accessible or not,

03:52.313 --> 03:55.683
is basically at this level
of test is to do a curl

03:55.763 --> 03:59.883
and then we're going to go to localhost

03:59.963 --> 04:04.533
because it's accessible on the node port,
and the port is 30081.

04:04.613 --> 04:09.513
We can see this in a text format,

04:09.593 --> 04:12.513
and we can see that database
connection has failed,

04:12.593 --> 04:16.760
and can't connect to MySQL
Server on MySQL service.

04:17.213 --> 04:20.547
We're going to look more into this area.

04:21.353 --> 04:24.053
Let's look at the deployment.

04:27.767 --> 04:33.160
We're going to do a kubectl
describe deployment webapp

04:34.867 --> 04:37.653
MySQL, so that's the deployment name.

04:37.733 --> 04:40.563
Here we see that we have the pod template.

04:40.643 --> 04:43.893
The image is simple web app MySQL,
the port is 8080

04:43.973 --> 04:45.393
and these are some of the environment
variables.

04:45.473 --> 04:48.483
The database host is MySQL service,
the user is root,

04:48.563 --> 04:51.397
and the password is this password.

04:52.433 --> 04:54.600
The host is MySQL service.

04:56.123 --> 04:59.553
Let's look at the service
called MySQL service.

04:59.633 --> 05:03.120
Let's do a get service
and we see that the name

05:03.200 --> 05:07.784
of the service is not MySQL service,
it's instead MySQL.

05:08.567 --> 05:10.113
That seems to be the problem here.

05:10.193 --> 05:12.360
This and this should match

05:13.133 --> 05:15.393
because from within this application
is going to try

05:15.473 --> 05:19.223
and reach a service
by the name MySQL service,

05:19.403 --> 05:21.783
and this doesn't look like that.

05:21.863 --> 05:22.983
That seems to be the problem.

05:23.063 --> 05:23.720
What we're going to do

05:23.800 --> 05:26.050
is we're going to fix that.

05:28.300 --> 05:32.013
Let's try and edit the service.

05:32.093 --> 05:36.753
We can't edit the service name,
but let's give it a shot.

05:36.833 --> 05:41.093
All we want to do is change
this to MySQL service.

05:42.443 --> 05:43.923
Let's try and save that.

05:44.003 --> 05:45.543
Now, it's not going to allow
you to save that,

05:45.623 --> 05:49.653
but the changes we made
is in this temporary file.

05:49.733 --> 05:51.483
This is what we need.

05:52.643 --> 05:55.623
Here, you have a service
and you have the MySQL service

05:55.703 --> 06:00.933
and everything else seems
to be as what we want.

06:01.013 --> 06:02.453
The port numbers are there,

06:02.533 --> 06:04.953
selector is there or another approach
we could do

06:05.033 --> 06:08.193
is to just delete the service and export

06:08.273 --> 06:12.603
or expose the MySQL service again,
but for now,

06:12.683 --> 06:13.953
we could just go ahead with this.

06:14.033 --> 06:20.663
We could do a kubectl delete
SVC and delete the MySQL service.

06:22.763 --> 06:27.383
Then we're going to create SVC--

06:28.823 --> 06:33.293
No, we're going to create using this file.

06:36.773 --> 06:39.563
Let's check service now.

06:40.493 --> 06:45.773
We see that the MySQL service
has now been created on port 3306.

06:46.973 --> 06:49.473
Let's go ahead and check this.

06:50.633 --> 06:54.883
When you check this application,
it's now a success.

06:57.083 --> 06:57.820
Check our work.

06:57.900 --> 06:59.580
That's successful.

07:00.023 --> 07:02.523
Let's proceed to the next one.

07:04.643 --> 07:09.153
In this one, the same two-tier application
is deployed in the beta namespace,

07:09.233 --> 07:12.123
and it must display
a green web page on success.

07:12.203 --> 07:12.873
Click on the App.

07:12.953 --> 07:15.653
Let's click on this app to see

07:19.223 --> 07:20.323
the status.

07:21.443 --> 07:23.883
As you can see, it's in a failed state.

07:23.963 --> 07:26.223
If you look at this,
you have the environment variables.

07:26.303 --> 07:30.453
The database host is MySQL service,
user is root, password.

07:30.533 --> 07:35.433
It says, "Can't connect to MySQL
server on 'MySQL-service:3306'."

07:35.513 --> 07:37.473
It says, "Connection refused."

07:37.553 --> 07:40.103
Let's take a look at it.

07:41.423 --> 07:46.633
First,
we're going to switch context to beta.

07:48.533 --> 07:51.200
We're going to do a set-context,

07:52.283 --> 07:57.683
config set-context command,

07:57.983 --> 08:01.927
then we're going to set the current context

08:03.000 --> 08:05.243
namespace to beta.

08:07.703 --> 08:12.367
Now we're going to do a get pods.

08:16.283 --> 08:18.820
We see the MySQL pod

08:18.900 --> 08:22.567
and you have the webapp pod, so that's fine.

08:23.273 --> 08:27.333
Then we also have services
called the MySQL service

08:27.413 --> 08:28.893
and the webapp service.

08:28.973 --> 08:32.140
If you look at this, again, as before,

08:32.363 --> 08:38.453
the port 30081 seems to be correct
as we can access that here

08:38.903 --> 08:44.133
and this whole application loads,
so this whole thing should be good.

08:44.213 --> 08:46.053
Again, it looks
like it's a connectivity issue

08:46.133 --> 08:47.793
between the web application

08:47.873 --> 08:51.423
and the SQL server,
so this is what we have to verify.

08:51.503 --> 08:54.243
Now, last time the issue was with the name,

08:54.323 --> 08:56.223
but now it looks like the name is correct.

08:56.303 --> 08:58.043
It is MySQL service,

08:58.313 --> 09:03.773
but we will anyway also check
the deployment on what is set,

09:04.703 --> 09:09.353
describe deploy webapp MySQL.

09:10.823 --> 09:14.613
We see that the database
host given here is MySQL service,

09:14.693 --> 09:16.533
and this is MySQL service as well.

09:16.613 --> 09:17.813
That's good.

09:18.353 --> 09:20.520
Now let's just look at the service.

09:20.600 --> 09:21.963
This to this is good.

09:22.043 --> 09:23.973
Now let's just focus on this.

09:24.053 --> 09:29.153
We're going to do a describe
service MySQL-service,

09:30.893 --> 09:34.763
and we see the selector is right.

09:34.943 --> 09:40.360
The endpoints, it has detected
the endpoint, so that's 10.42.0.12.

09:44.533 --> 09:48.963
Let's make sure that this endpoint
is the pod, which is the MySQL port.

09:49.043 --> 09:55.853
Let's do a kubectl get pods-o
wide to see the IP of the pod.

09:56.813 --> 10:01.313
We see that the MySQL pod
has an IP address, 10.42.0.12

10:01.553 --> 10:03.453
and this is 10.42.0.12.

10:03.533 --> 10:04.620
That's right.

10:04.700 --> 10:08.133
If you look at this right here,
it says port 8080

10:08.213 --> 10:10.893
and so the IP is okay,
so then we check the port.

10:10.973 --> 10:15.633
It's port 8080,
and 8080 is not the port for the database.

10:15.713 --> 10:20.753
If you look at it here,
the port here is 3306 and not 8080.

10:21.713 --> 10:23.133
That seems to be the problem.

10:23.213 --> 10:28.433
Let's do an edit as we see, MySQL service.

10:30.833 --> 10:33.993
You can see the port here is 3306,
which is right.

10:34.073 --> 10:37.233
The target port given is 8080,
and that is not right.

10:37.313 --> 10:39.646
That should be 3306 as well.

10:40.493 --> 10:42.093
Let's edit that.

10:42.653 --> 10:45.753
Let's make sure the changes took place.

10:45.833 --> 10:51.533
Now is 3306, and let's check the endpoint

10:55.943 --> 11:00.193
and we see that the endpoint
is now 10.42.0.12:3306.

11:01.700 --> 11:07.587
Let's now check our application and yes,
you can see that it's a success.

11:07.667 --> 11:09.417
Let's check our work.

11:10.343 --> 11:11.343
Okay.

11:11.515 --> 11:13.015
We're two down.

11:14.700 --> 11:18.053
The next question
is the same two-tier application

11:18.133 --> 11:19.520
is deployed in the gama namespace,

11:19.600 --> 11:22.018
it must display green webpage

11:22.223 --> 11:25.890
and click on the App tab at the top to view.

11:26.003 --> 11:29.123
It looks like it's the same question.

11:29.603 --> 11:32.436
Let's go and open the application.

11:35.753 --> 11:37.943
Just keeps spinning

11:40.643 --> 11:46.400
and meanwhile,
we'll go here and clear our work and

11:49.967 --> 11:54.533
we'll switch to the gama namespace.

11:55.613 --> 12:01.133
Let's check status of pods
and let's check services.

12:02.213 --> 12:07.213
We have both the pods are running
and the services are there,

12:08.123 --> 12:11.603
but this doesn't look like it's loading.

12:12.983 --> 12:14.763
Let's try and find out why.

12:14.843 --> 12:20.103
It looks like the issue is somewhere here,
the page itself isn't loading,

12:20.183 --> 12:21.483
the service itself isn't loading.

12:21.563 --> 12:24.153
Let's start looking at it right from here.

12:24.233 --> 12:27.483
The first thing to look
at is this port 30081,

12:27.563 --> 12:32.043
because that is the port
that we are trying to access, 30081

12:32.123 --> 12:36.323
and it's now timed out, so 30081.

12:37.463 --> 12:39.633
If you look at the service
called web service,

12:39.713 --> 12:44.043
you see that it's set to node
port and the node port is 30081,

12:44.123 --> 12:44.973
so that's fine.

12:45.053 --> 12:46.143
That looks good.

12:46.223 --> 12:47.687
Next thing is the service itself.

12:47.767 --> 12:51.323
Let's check if the service has a endpoint.

12:51.413 --> 12:56.643
We're going to do describe
service web-service.

12:56.723 --> 13:00.640
We see the name, web service,
namespace is gama,

13:00.743 --> 13:05.283
has the right selectors
and has the endpoints 10.42.0.14

13:05.363 --> 13:08.963
and the ports are 8080 and 8080.

13:09.203 --> 13:10.353
That looks right.

13:10.433 --> 13:11.933
Let's make sure

13:13.763 --> 13:17.343
the IP address,
the endpoints are picked up correctly.

13:17.423 --> 13:19.913
This endpoint is 10.42.0.14

13:20.303 --> 13:23.373
and the web app is on 10.42.0.14

13:23.453 --> 13:25.786
as well, so that checks out.

13:27.413 --> 13:28.323
The next step is--

13:28.403 --> 13:29.703
The web service is good.

13:29.783 --> 13:32.616
Let's check the deployment itself.

13:34.043 --> 13:37.133
We do our kubectl, we get pod.

13:38.423 --> 13:39.423
We do

13:41.183 --> 13:46.553
a describe deployment webapp MySQL,

13:47.633 --> 13:53.300
and we see that it has one desired
and one available, so that's fine.

13:53.903 --> 13:56.913
The image looks correct.

13:56.993 --> 14:01.353
The database host is MySQL service,
user is root, password.

14:01.433 --> 14:03.603
All of that seems to be okay.

14:03.683 --> 14:07.143
It's still,
we're unable to use the deployment.

14:07.223 --> 14:13.640
Let's check out the logs because it looks
like the webserver isn't responding.

14:14.153 --> 14:15.653
Let's do a logs

14:20.063 --> 14:21.063
on the pod

14:22.853 --> 14:28.103
and this seems to be okay.

14:29.033 --> 14:35.033
This application itself, it says
it started, it's available on this port.

14:36.503 --> 14:38.336
That seems to be okay.

14:42.113 --> 14:47.063
However, we are still not able
to access the application.

14:50.000 --> 14:53.193
Let's anyway, go through and complete
our checks because we assume

14:53.273 --> 14:55.743
that it's going to be somewhere here,
but anyway,

14:55.823 --> 14:58.983
let's go down and complete our checks.

14:59.063 --> 15:01.533
MySQL service is supposed to be on 3306.

15:01.613 --> 15:03.293
Let's check that.

15:04.163 --> 15:07.443
We have the MySQL service and it's on 3306.

15:07.523 --> 15:09.953
Let's check the endpoint,

15:14.573 --> 15:19.253
describe MySQL service
and here you have the endpoints

15:19.343 --> 15:21.513
but it looks like there are no endpoints.

15:21.593 --> 15:26.687
Apparently, the service hasn't detected
MySQL pod as an endpoint.

15:26.767 --> 15:29.517
Let's take a look at why that is.

15:31.103 --> 15:33.346
If you look at the selectors right here,

15:33.426 --> 15:38.652
it says name equals
SQL00001 and for the pod,

15:43.013 --> 15:45.953
describe pod MySQL.

15:46.943 --> 15:51.243
We know that the labels
for this is name equals MySQL.

15:51.323 --> 15:54.063
That should be the selector
not name equals SQL00001

15:54.143 --> 15:56.853
and that's why doesn't have any endpoints.

15:56.933 --> 15:59.351
Let's go ahead and edit that.

16:02.303 --> 16:08.303
Not the pod, we're going to edit
the service, MySQL service,

16:09.533 --> 16:13.267
and we're going to change the selector

16:14.333 --> 16:19.396
to MySQL, then save that.

16:20.573 --> 16:27.233
Okay, now we're going to do describe
service MySQL

16:27.923 --> 16:31.673
and we see
that we have the service protected.

16:32.233 --> 16:34.443
Let's go and check out our application.

16:34.523 --> 16:36.487
Okay, so that's connected successfully.

16:36.567 --> 16:41.043
Apparently, even though we were not able
to access the web application,

16:41.123 --> 16:44.463
that's because the web application
is trying to access the MySQL service

16:44.543 --> 16:47.543
and that service was not responding,

16:47.723 --> 16:52.557
which is why the web application
was not responding either.

16:53.033 --> 16:55.203
Even though we thought
that the issue is somewhere here,

16:55.283 --> 16:58.233
we went through and we made
sure that everything's fine

16:58.313 --> 17:02.523
and we just went through the remaining,
just to check,

17:02.603 --> 17:03.303
and just to be sure,

17:03.383 --> 17:07.720
and that's how we identified
that the issue is somewhere here.

17:07.800 --> 17:10.320
That's another approach or technique

17:10.400 --> 17:14.153
that you should use
if you're not really sure.

17:14.813 --> 17:18.243
You start with an intuition
on where the issue

17:18.323 --> 17:22.953
could be but if you can really figure out,

17:23.033 --> 17:26.463
you just keep looking at those things just

17:26.543 --> 17:29.587
to make sure
that they're working as expected.

17:29.667 --> 17:31.417
Let's check our work,

17:36.383 --> 17:39.050
and let's wait for the next one.

17:40.793 --> 17:41.793
Okay.

17:43.253 --> 17:46.623
Here, the same two-tier application
is deployed in the delta namespace

17:46.703 --> 17:49.870
and it looks like it's the same setup.

17:50.093 --> 17:53.510
Here we have, and it's in a failed state.

17:55.463 --> 18:00.173
Let's first change our context to

18:04.673 --> 18:05.700
delta

18:07.673 --> 18:10.883
and then let's check the pods

18:11.813 --> 18:14.230
and let's check our services.

18:15.353 --> 18:16.453
Let's check the error message.

18:16.533 --> 18:21.423
The DB host is MySQL service, users,
SQL user, password is password.

18:21.503 --> 18:23.993
It says,"Can't connect to MySQL server

18:24.073 --> 18:26.423
on MySQL service: 3306.

18:26.963 --> 18:28.643
Connection refused."

18:30.143 --> 18:32.420
Okay, I'm going to try that out again.

18:32.500 --> 18:34.203
I'm just refresh it, and it says,

18:34.283 --> 18:38.603
"Access denied for our user
SQL user at 10.42.0.16.

18:39.053 --> 18:40.263
Using password."

18:40.343 --> 18:43.510
It says, "Access denied for the user."

18:45.067 --> 18:47.984
Here, you can see the user details.

18:48.863 --> 18:50.973
The DB host has to be MySQL service,

18:51.053 --> 18:54.153
and the DB user is root
and the password is password.

18:54.233 --> 18:57.067
Let's check the settings for that.

18:58.103 --> 19:02.313
The web application
must access MySQL service,

19:02.393 --> 19:06.213
and this is where the credentials
are stored.

19:06.293 --> 19:13.793
Let's do a describe on webapp MySQL,
describe deployment,

19:14.963 --> 19:16.563
on webapp MySQL.

19:16.643 --> 19:18.033
Let's look at the settings.

19:18.113 --> 19:20.703
Here you have the environment variables,
and you have the host,

19:20.783 --> 19:22.420
which is MySQL service.

19:22.500 --> 19:24.303
The user it says SQL user,

19:24.383 --> 19:28.503
but it's actually root
and the password is password.

19:28.583 --> 19:31.553
This seems to be the problem.

19:32.123 --> 19:34.343
Let's edit that

19:37.223 --> 19:42.323
and update the user to root.

19:47.603 --> 19:51.503
Okay,
and let's wait for the pod to be running.

19:51.623 --> 19:53.373
It's running already.

19:53.573 --> 19:57.240
Let's refresh the page and that's a success.

19:57.383 --> 19:59.383
That was the issue here.

20:01.867 --> 20:03.617
Let's check that out,

20:07.133 --> 20:11.217
and while the new one loads,
let's close this one,

20:11.767 --> 20:13.684
let's clear our screen.

20:14.723 --> 20:20.103
The next one is the same application
is deployed in the epsilon namespace.

20:20.183 --> 20:24.443
It must display a green web page on success.

20:25.800 --> 20:30.717
Let's open the web page
and we have a similar error message.

20:32.753 --> 20:37.053
It says, "The environment variables,
DB hosts, MySQL service database.

20:37.133 --> 20:38.433
It's not set.

20:38.543 --> 20:44.043
User is SQL user and the password
access denied for user SQL user."

20:44.433 --> 20:47.183
That's kind of the similar error.

20:47.663 --> 20:53.273
Let's take a look at it but first
let's change the context to

20:58.300 --> 20:59.467
episilon

21:01.793 --> 21:06.383
and select the pods.

21:08.667 --> 21:12.003
We know that it's a similar error
message where it says,

21:12.083 --> 21:13.533
"Access denied for SQL user."

21:13.613 --> 21:14.853
That's what we just solved.

21:14.933 --> 21:16.353
The user is not a SQL user.

21:16.433 --> 21:19.383
It's a root user,
so let's go ahead and fix that.

21:19.463 --> 21:25.463
Edit deployment webapp MySQL.

21:32.933 --> 21:35.843
Here we see the user is SQL user.

21:35.963 --> 21:38.663
Let's change that to root.

21:41.833 --> 21:45.567
Let's check the pods, it's running.

21:46.233 --> 21:48.233
Let's rephrase the page.

21:48.500 --> 21:51.723
Now the error message
has changed and it says,

21:51.803 --> 21:53.943
"Access denied for user root."

21:54.023 --> 21:57.107
Again, so the access is still denied,

21:57.383 --> 22:00.883
but the user has now been updated to root.

22:02.693 --> 22:06.543
The user credentials
are either set on the application

22:06.623 --> 22:11.873
that's trying to connect
to the database or the database itself.

22:12.023 --> 22:15.003
We've already fixed
it on the deployment here,

22:15.083 --> 22:18.003
but now the issue could be here.

22:18.083 --> 22:24.033
Let's check out the pod
because that's the only other place

22:24.113 --> 22:26.433
where anything could be set.

22:26.513 --> 22:31.593
Here we see additional details,
and here we have the environment variable

22:31.673 --> 22:36.003
and the MySQL root password is set
to something other than password,

22:36.083 --> 22:37.833
which should be this.

22:37.943 --> 22:39.723
That needs to be changed.

22:39.803 --> 22:46.033
Let's do a edit pod MySQL

22:47.000 --> 22:53.063
and let's change this password to paswrd.

22:54.923 --> 22:55.923
Save that.

22:57.053 --> 22:59.973
It's not going to allow
us because it's a pod.

23:00.053 --> 23:02.887
We're going to do kubectl replace,

23:03.593 --> 23:07.766
replace force and we'll give the file.

23:13.433 --> 23:14.487
It's deleted.

23:14.567 --> 23:15.867
It's back up.

23:17.133 --> 23:18.433
It's running.

23:18.667 --> 23:21.167
Let's try to refresh the page.

23:23.033 --> 23:25.823
Now it say, "Connection refused."

23:27.203 --> 23:30.537
No, that was because we tried too early.

23:30.653 --> 23:33.333
The pod was just being initiated.

23:33.413 --> 23:35.153
Now it's success.

23:35.500 --> 23:37.113
That was the issue.

23:37.193 --> 23:42.993
Now, another thing to note here
is in this case, it's very simple,

23:43.073 --> 23:47.873
straightforward examples
of setting environment variables,

23:48.173 --> 23:50.703
but this could also be part of config map.

23:50.783 --> 23:54.003
There could be another config map
associated with the MySQL service,

23:54.083 --> 23:57.250
which is how it is usually configured.

23:59.183 --> 23:59.920
If that is the case,

24:00.000 --> 24:03.917
then you should inspect
the config maps as well.

24:08.173 --> 24:11.007
Let's get ready for the final one.

24:15.266 --> 24:19.773
The same two-tier application
is deployed in the zeta name space.

24:19.853 --> 24:25.703
Let's first set the context to zeta

24:28.223 --> 24:31.223
and let's check out the application.

24:32.300 --> 24:34.217
It says, "Bad gateway,"

24:37.913 --> 24:39.313
right upfront.

24:40.133 --> 24:41.967
Let's start from here.

24:46.500 --> 24:47.853
We're assuming because it says

24:47.933 --> 24:49.443
we're not even able
to access the web service,

24:49.523 --> 24:51.796
we're going to start right from the top.

24:51.876 --> 24:54.220
The node pod is 30081,

24:54.300 --> 24:57.033
because that's what we are trying
to access here.

24:57.113 --> 25:00.197
Let's see the status of the services.

25:00.503 --> 25:05.553
We see that the web service
has a node port, but here you see,

25:05.633 --> 25:07.803
it's not on 30081, it's on 30088.

25:07.883 --> 25:10.703
That's what we're going to fix.

25:11.363 --> 25:14.003
Edit service web service.

25:16.343 --> 25:22.667
The node port has to be 30081.

25:24.386 --> 25:29.553
We'll save that and let's make
sure that it's updated.

25:29.633 --> 25:31.163
It's 30081.

25:32.663 --> 25:33.353
Okay.

25:33.433 --> 25:34.113
That's done.

25:34.193 --> 25:38.013
We're now able to access
the application at least.

25:38.093 --> 25:42.819
Now it says, "Access denied
for user SQL user using password,"

25:42.899 --> 25:47.816
so that's something we have seen
already so let's check out.

25:48.293 --> 25:49.653
Okay. Let's look at the deployment.

25:49.733 --> 25:52.073
Describe deploy webapp

25:54.563 --> 25:55.563
MySQL,

25:57.053 --> 26:02.253
and we see that their environment variables.

26:02.333 --> 26:06.187
MySQL services, SQL server,
SQL user, and password.

26:06.267 --> 26:08.993
Let's edit that

26:12.653 --> 26:14.403
to change it to root.

26:29.603 --> 26:30.487
Okay.

26:30.567 --> 26:33.067
The new pod has been deployed.

26:36.473 --> 26:39.573
Now the username is updated,
but it still says,

26:39.653 --> 26:42.487
"Access denied for our user root."

26:42.593 --> 26:48.680
We have to go down and check the password

26:48.767 --> 26:51.233
configured on the MySQL service.

26:51.313 --> 26:53.903
Let's do a describe pod MySQL.

26:55.943 --> 26:59.643
We see that we have the password
issue here, the environment variable.

26:59.723 --> 27:01.223
Let's edit that

27:07.073 --> 27:11.013
and it should be password.

27:13.000 --> 27:15.033
Let's save that.

27:15.293 --> 27:21.773
That's not going to go through,
so let's do a replace with this.

27:27.100 --> 27:32.423
Let's wait for the pod to run.

27:33.983 --> 27:35.663
Okay, yes.

27:37.403 --> 27:40.570
Now that's successful, check our work.

27:43.283 --> 27:44.823
Okay. That's about it.

27:44.903 --> 27:47.049
I know
that there's a little bit of repetition

27:47.129 --> 27:48.303
on the type of questions

27:48.383 --> 27:51.687
and that's really in case
you didn't get it the first time

27:51.767 --> 27:54.003
for you to just get that practice again

27:54.083 --> 27:58.250
and get it the next time
and build some confidence.

27:58.943 --> 28:02.073
I hope
that was a good troubleshooting session

28:02.153 --> 28:06.320
and we'll have more coming
up in the upcoming labs.

