WEBVTT

00:00:01.010 --> 00:00:02.310
Welcome back, everyone.

00:00:04.570 --> 00:00:11.590
Okay, so for Lesson 7, we're going to cover Helm, Operators, and Storage.

00:00:11.590 --> 00:00:17.810
Yeah, so what we'll do is we'll apply with Helm for testing,

00:00:18.110 --> 00:00:24.050
but then with infrastructure as code, we just use Helm as a template.

00:00:24.730 --> 00:00:30.210
So in that case, the IAC actually controls the state instead of Helm,

00:00:30.210 --> 00:00:37.370
And it just uses the Helm template, so your templates directory and your values file and your chart.

00:00:37.930 --> 00:00:42.990
It just uses that to inflate, read the values, and it controls the state management.

00:00:43.030 --> 00:00:53.330
Yeah, so we'll be going over in Lesson 7 here, we'll go through how to create a Helm chart from scratch

00:00:53.330 --> 00:00:56.330
and how to work with the Helm repo and how to apply it.

00:00:56.550 --> 00:00:59.830
So everything relating to Helm will be in this lesson.

00:01:00.210 --> 00:01:08.750
But as far as infrastructure as code, that will be once we build the, once we're ready

00:01:08.750 --> 00:01:13.970
to deploy the IEC part, we'll do a day of training on IEC, and then when we're ready

00:01:13.970 --> 00:01:20.670
for the declarative GitOps part, which would be Argo, we'll do a day of training on declarative

00:01:20.670 --> 00:01:21.670
GitOps.

00:01:21.670 --> 00:01:26.650
So I'll show you how that works and how we take the Helm chart, and it's set up actually

00:01:26.650 --> 00:01:31.450
differently than what we're studying today because if you're applying it manually with Helm it would

00:01:31.450 --> 00:01:36.730
be different than if you're using declarative GitOps. No, tomorrow will be lesson eight and

00:01:36.730 --> 00:01:45.770
nine for Kubernetes, so we're still on Kubernetes. And then once I work out the Proxmox API

00:01:46.890 --> 00:01:55.450
setup with Chris, then I'll deploy the cluster. I have a few things to finish up once I

00:01:55.450 --> 00:02:02.170
meet with Chris, and then I'll test out deploying it on Proxmox. And once I work out your Proxmox

00:02:02.170 --> 00:02:09.530
versus my Proxmox, then we'll be ready to do a half day of training on the IAC.

00:02:10.490 --> 00:02:16.730
So it just depends on how long it takes when I meet with Chris to work out any differences

00:02:16.730 --> 00:02:30.080
between the two Proxmox. I don't yet. So I use Ansible to set up Kubernetes.

00:02:30.640 --> 00:02:37.720
But I use Terraform to create the VM and Ansible has a way now to create the VM and I'm just

00:02:37.720 --> 00:02:41.480
trying to work that out with the Proxmox API.

00:02:41.480 --> 00:02:45.060
So probably sometime in February I'll have that piece worked out.

00:02:45.060 --> 00:02:52.580
So right now we'll use Terraform to create the VM, but we're not enforcing state.

00:02:52.580 --> 00:02:58.060
So although Terraform is great at enforcing state, we won't be using it for that, just

00:02:58.060 --> 00:03:03.820
using it to create the VM resource, and then we'll use Ansible to set up the Kubernetes cluster.

00:03:05.900 --> 00:03:10.460
And then once I work out that issue between Proxmox's API and Ansible,

00:03:11.740 --> 00:03:16.940
the goal is that everything would be in Ansible. So you'd have multiple roles, multiple playbooks,

00:03:18.940 --> 00:03:24.540
and the creation of the VM resource would take place with Ansible instead of Terraform. Right now

00:03:24.540 --> 00:03:29.100
you have to start with terraform and then you switch to another directory for ansible and

00:03:29.100 --> 00:03:36.380
that's kind of the way we've done it for many years but ansible is uh building out their own

00:03:36.380 --> 00:03:41.260
modules so that they can actually replace that small piece into it it will will be nice to just

00:03:41.260 --> 00:03:49.420
have one iac library okay so we're going to cover container storage interfaces snapshotting

00:03:49.420 --> 00:04:00.160
Persistent volumes. Persistent volume claims. Dynamic provisioning with storage class. Helm

00:04:00.160 --> 00:04:07.640
provisioning of storage resources. So the CSI is the Kubernetes standard method for accessing block

00:04:07.640 --> 00:04:14.740
storage, and it stands for the Container Storage Interface, similar to how we learned earlier about

00:04:14.740 --> 00:04:20.420
the CNI, which is the Container Network. It has actually had several names over the years, so

00:04:20.420 --> 00:04:27.700
you may not see it referred to as a CSI if it's an older naming convention. So the Container Storage

00:04:27.700 --> 00:04:34.740
Interface drivers enable volume snapshots. There are options for full featured CSIs.

00:04:35.860 --> 00:04:42.820
Longhorn is a CSI that works well with bare metal clusters. Longhorn enables snapshots,

00:04:42.820 --> 00:04:45.920
encryption, trim discard, and metric.

00:04:45.920 --> 00:04:48.920
Minikube enables volume snapshots with add-on,

00:04:48.920 --> 00:04:52.720
and volume snapshots and CSI HostPath driver are required.

00:04:52.720 --> 00:04:54.420
Persistent volumes.

00:04:54.420 --> 00:04:57.180
A persistent volume, or PV,

00:04:57.180 --> 00:04:59.820
is a volume that is provisioned in cluster.

00:05:00.960 --> 00:05:03.960
It can be provisioned manually or dynamically.

00:05:03.960 --> 00:05:07.220
It is a resource just like a node or pod is a resource.

00:05:07.220 --> 00:05:10.340
PVs have a lifecycle that is independent

00:05:10.340 --> 00:05:18.180
the resource requesting it, such as a pod. It's a similar concept to creating an external volume in

00:05:18.180 --> 00:05:26.740
Docker. So if you've ever created an external volume when you Docker compose down hyphen v,

00:05:26.740 --> 00:05:32.660
it does not wipe out the volume. So it's external or not. Persistent volume claims.

00:05:32.660 --> 00:05:41.160
a persistent volume claim or PVC is a request for storage. PVCs consume PV

00:05:41.160 --> 00:05:47.440
resources. PVCs can request specific size and access. Near access modes can be

00:05:47.440 --> 00:05:54.780
read-write-once, read-only-many, read-write-many, or read-write-once-pond.

00:05:54.780 --> 00:06:00.900
I've never used that last one, I don't believe it. Dynamic provisioning with the storage class allows

00:06:00.900 --> 00:06:06.340
persistent volumes to be provisioned on demand. Enables automated creation of our

00:06:06.340 --> 00:06:13.980
PV objects. It utilizes a persistent volume claim to provision. It can have

00:06:13.980 --> 00:06:20.720
multiple storage class objects. Encrypted storage class which is sensitive.

00:06:20.720 --> 00:06:27.780
Unencrypted storage class non-sensitive. You can have an NVME storage class for

00:06:27.780 --> 00:06:37.140
fast, an SSD storage class for normal, and an HDD storage class for slow. So you can set up all,

00:06:37.140 --> 00:06:40.980
you know, the options that you can think of relating to the speed of your drive or whether

00:06:40.980 --> 00:06:48.510
you have data that's sensitive or not. Deploying resources using helm charts.

00:06:50.270 --> 00:06:58.190
So we're going to cover the helm layout, helm templating, helm issues that arise from upstream

00:06:58.190 --> 00:07:05.790
providers and Helm solutions to those issues. Helm templating follows a specific layout for

00:07:05.790 --> 00:07:12.110
standard charts. Within the chart folder you will find several required folders and files. Capital

00:07:12.110 --> 00:07:19.390
chart so capital C chart.yaml file lists both the chart version and the app. The values.yaml

00:07:19.390 --> 00:07:26.270
file contains the user-defined variables and the templates directory contains our manifest file

00:07:26.270 --> 00:07:33.230
templates templates are designed to read variables in the values that yaml file templates really

00:07:33.230 --> 00:07:38.430
contain user-defined variables themselves the charge directory is optional and may

00:07:38.430 --> 00:07:43.790
contain upstream charts that are in the home templating follows a specific design pattern

00:07:45.470 --> 00:07:51.150
it is designed to enable devops personnel to modify the chart modifications are to the values

00:07:51.150 --> 00:07:56.590
that yaml file only the rest of the chart is maintained by upstream chart captain and the

00:07:56.590 --> 00:08:03.630
chart is versioned and installed by latest or version so you can use a version or later and then

00:08:03.630 --> 00:08:09.710
an umbrella chart would be like an all-in-one so we typically see those used for demonstration

00:08:09.710 --> 00:08:15.950
purposes if you just want one helm chart and it'll spin up everything including these sub charts

00:08:15.950 --> 00:08:22.910
And those are great for demonstrations but they don't always work well in production,

00:08:22.910 --> 00:08:30.950
especially if you're using declarative GitOps. So it can interfere with the sequencing as well

00:08:30.950 --> 00:08:37.710
as the updating or upgrading of the individual charts. Because remember in declarative GitOps

00:08:37.710 --> 00:08:43.570
we won't be using Helm to install or uninstall, we're using declarative GitOps processes which

00:08:43.570 --> 00:08:48.550
is Argos. But the Helm Captain is the designation for the individual who

00:08:48.550 --> 00:08:53.750
actually writes the Helm chart. Yeah, so what was interesting is that for

00:08:53.750 --> 00:09:01.350
years the only way to learn Helm was through the Helm website. And whoever

00:09:01.350 --> 00:09:05.010
had access to that, the primary responsibility was unreachable for

00:09:05.010 --> 00:09:11.410
something like a year or two years. Which we'll work with here in a

00:09:11.410 --> 00:09:17.890
minute but the helm template that you download and install actually did not work so for probably

00:09:17.890 --> 00:09:22.130
close to two years it was very difficult for anyone to actually learn how to become a helm

00:09:22.130 --> 00:09:27.810
captain because none of the training work or the templates were actually working okay helm issues

00:09:29.570 --> 00:09:33.090
upstream providers often do not have a full-time helm captain

00:09:34.530 --> 00:09:38.290
so this leads to upstream personnel maintaining the templating themselves

00:09:38.290 --> 00:09:45.650
Errors can arise due to lack of templating knowledge and common errors that we see are

00:09:45.650 --> 00:09:51.690
headless service not working, ingress incorrect, ports and image.

00:09:51.690 --> 00:09:57.510
So the solutions to these issues are you can modify the home templating within the chart

00:09:57.510 --> 00:10:00.110
and fix the issues.

00:10:00.110 --> 00:10:05.130
This however leads to a requirement to maintain your own version.

00:10:05.130 --> 00:10:11.930
requires you to have your own chart repo. So common repos that you can set up are GitLab and

00:10:11.930 --> 00:10:18.330
GitHub. However, every time you upgrade to a new version, you need to compare charts for any changes

00:10:18.330 --> 00:10:24.670
and pull them manually. And it can be tedious to maintain a downstream chart. So there is a way to

00:10:24.670 --> 00:10:31.030
do that, but just keep in mind it is tedious and that workload will

00:10:31.030 --> 00:10:37.990
continue to increase as you maintain that chart yourself. Alright, so software

00:10:37.990 --> 00:10:46.150
extensions use the custom resources from our operators. The operators are designed

00:10:46.150 --> 00:10:51.250
to mimic how a human operator would manage the resources and you'll see that

00:10:51.250 --> 00:10:55.730
today we have a lot of applications that have switched over to using operators. They enable

00:10:55.730 --> 00:11:01.730
the automated deployment of the resources. They interact with the Kubernetes API server. They

00:11:01.730 --> 00:11:09.010
almost always require a CRD or custom resource definition and the operators are relatively new

00:11:09.010 --> 00:11:14.530
and may not contain all of the features. So if you're used to deploying for example a database

00:11:14.530 --> 00:11:18.930
without an operator it might be fully featured and if you're using an operator there may still

00:11:18.930 --> 00:11:25.010
be a few features that have not been included yet into the operator. And so we'll go through

00:11:25.890 --> 00:11:32.610
Mongo as one of our examples that we use that uses an operator. I think most of you probably

00:11:32.610 --> 00:11:43.600
know what MongoDB is, so we'll skip through this. So a MongoDB stateful set. So remember when we

00:11:43.600 --> 00:11:49.600
talked about stateful sets and what do they have at the end of the name of the pod? Does anyone

00:11:49.600 --> 00:11:56.960
remember? Yeah, so stateful sets are indexed to zero, and so for Mongo, it would be a stateful

00:11:56.960 --> 00:12:04.400
set indexed to zero. The same with Minio. Minio should be the same way. So the Mongo stateful

00:12:04.400 --> 00:12:12.480
sets enable a high availability setup and provide redundancy. So we have a primary that receives all

00:12:12.480 --> 00:12:19.520
write operations. Now we have secondaries that replicate the operations from the primary.

00:12:20.400 --> 00:12:25.920
And there's an election process to elect a primary. And you can also have arbiter nodes

00:12:25.920 --> 00:12:30.480
that participate in the election to break ties, but they don't actually store any data.

00:12:30.480 --> 00:12:36.080
So MongoDB staple sets with PVs ensure data availability and durability.

00:12:37.040 --> 00:12:43.520
It decouples the storage lifecycle from the Mongo app lifecycle, so the persistent volumes can

00:12:43.520 --> 00:12:54.160
remain even if MongoDB does not. It uses stateful sets, stable persistent storage for every Mongo

00:12:54.160 --> 00:13:02.160
pod. It enables new Mongo pods to attach to existing persistent volumes, so you can

00:13:02.960 --> 00:13:09.200
delete Mongo, keep the persistent volumes, spin Mongo back up, and reattach to the existing

00:13:09.200 --> 00:13:15.700
volumes. It's similar to running Mongo with Docker Compose and external volumes.

00:13:15.700 --> 00:13:21.780
Minikube requires local path storage for stateful sets and PV. All right, so for our labs,

00:13:21.780 --> 00:13:28.980
we're going to install a CSI and dynamically provision a PV using the storage class.

00:13:29.940 --> 00:13:34.980
We're going to create a snapshot of the PV. We're going to restore the PV from a snapshot.

00:13:36.500 --> 00:13:42.020
We're going to work with Helm charting. We're going to use Helm to install an operator for

00:13:42.020 --> 00:13:48.820
a staple set. We'll use Helm to install a storage staple set with dynamic PVs,

00:13:48.820 --> 00:13:53.780
and we'll use Helm to uninstall the storage staples. And with any luck, if we get to that,

00:13:54.740 --> 00:13:58.420
you'll see how sometimes Helm does not work as intended. All right, so we want to ensure we

00:13:58.420 --> 00:14:05.620
have a fresh Minikube environment. Start a single node Minikube. Minikube start. And once you get

00:14:05.620 --> 00:14:11.780
that up, kubectl git nodes, make sure it's up. And then we're going to do an add-on for enable

00:14:11.780 --> 00:14:18.980
volume snapshots so that we can enable those. And then we will verify what was added to the node

00:14:18.980 --> 00:14:27.860
with kubectl git pods hyphenate. We can describe them the same. Yes, you'll need the namespace

00:14:27.860 --> 00:14:33.620
kube system and controlled by a replica set. From the pod then you can get the replica set. Or you

00:14:33.620 --> 00:14:40.020
could just do kubectl describe deployments hyphen a. All right we're going to create a persistent

00:14:40.020 --> 00:14:47.060
volume claim. So we're going to enable the storage add-ons for the CSI. So minikube add-ons enable

00:14:47.780 --> 00:14:53.540
CSI hostpath drive. And we will verify what was added to the node again. We want to verify

00:14:53.540 --> 00:14:59.940
the CSI HostPath Attacher, Resizer, and HostPath Plugin were added. That's a lot. You'll find that

00:14:59.940 --> 00:15:09.220
when you get into CSIs that it adds a lot to your cluster. But many of those pods use maybe a tenth

00:15:09.220 --> 00:15:15.140
of a CPU, so they don't actually consume a lot of resources. So it looks like a lot of pods are

00:15:15.140 --> 00:15:21.620
running for the CSI, especially when you start to look at Longhorn once we spin up that cluster

00:15:21.620 --> 00:15:28.120
for you with RKE2. You'll see a lot of pods with Longhorn, but most of those use just a fraction

00:15:28.120 --> 00:15:39.940
of a CPU. Okay, we're going to go ahead and get the storage class name. Correct. MCSI host path

00:15:39.940 --> 00:15:48.760
SC. All right, now we're going to create a persistent volume claim, and in your lesson 7

00:15:48.760 --> 00:15:55.640
directory you should have a pvc.yaml just want to make sure it matches this

00:15:55.640 --> 00:16:02.700
on the screen and when you do you can go ahead and apply it mm-hmm that's correct

00:16:02.700 --> 00:16:08.860
now we're going to check the persistent volume claim kubectl get pvc-n

00:16:08.860 --> 00:16:15.540
and then our namespace oh so if it's giving you an issue with the namespace

00:16:15.540 --> 00:16:21.860
and go ahead and kubectl create ns and then the name of the namespace and then reapply it.

00:16:23.220 --> 00:16:28.820
Correct. Then reapply your YAML and it should create right. When we get our pvc we should

00:16:28.820 --> 00:16:36.500
see that our pvc is bound to a specific namespace and we can check if the pv was created dynamically

00:16:36.500 --> 00:16:46.300
by looking at kubectl get pv instead of pvc pvc's are namespaced pvs are not pvs are tied

00:16:46.300 --> 00:16:54.780
to a pvc so it should be kubectl get pvc hyphen n pvc there's a namespace that we're in remember

00:16:54.780 --> 00:17:01.380
we created a namespace of pvc all right so let's see everyone has a pvc and the pv all right

00:17:01.380 --> 00:17:10.980
and we're going to get the volume snapshot class so read a snapshot we run kubectl get volume

00:17:10.980 --> 00:17:19.100
snapshot class and what is displayed in the terminal right right yeah all right it looks

00:17:19.100 --> 00:17:25.800
like everyone has a volume snapshot class so we're good to go to the next step now that we

00:17:25.800 --> 00:17:31.380
have a class. We're going to create a snapshot of the volume, and I believe I

00:17:31.380 --> 00:17:37.380
provided this one for you as well. It would be csisnapshot.yml. Make sure it

00:17:37.380 --> 00:17:42.480
matches what you see there. If it does, go ahead and apply it. What this is doing is

00:17:42.480 --> 00:17:47.060
snapshotting the existing volume that we created. So we had a PVC which created a

00:17:47.060 --> 00:17:51.120
volume, a persistent volume, and now we are snapshotting that. It's just taking a

00:17:51.120 --> 00:17:55.200
picture in a moment in time. That's kind of catchy every time, don't they?

00:17:55.200 --> 00:18:01.520
All right, did everyone catch the errors? Okay, let's go ahead and get the volume snapshot.

00:18:02.640 --> 00:18:08.240
Group control, get volume snapshot, type in in, and then the name of the namespace. And what is

00:18:08.240 --> 00:18:16.480
listed for the volume snapshot? All right. Okay, so now, all right, so we created a PVC, which

00:18:16.480 --> 00:18:22.240
created a persistent volume, right? Then we snapshotted it. So now we just had something

00:18:22.240 --> 00:18:28.400
really horrible happen with our persistent volume and we need to restore from our snapshot and this

00:18:28.400 --> 00:18:32.800
is all how to do this manage try to take the mystery we're going to restore snapshot of the

00:18:32.800 --> 00:18:40.960
volume and create a csi restore.yml file which i've already provided to you make sure it matches

00:18:40.960 --> 00:18:50.160
what you see on the screen and once you're sure that it does go ahead and apply this is going to

00:18:50.160 --> 00:18:56.220
create a new persistent volume claim from the snapshot. Alright, so now we're

00:18:56.220 --> 00:19:03.000
looking for a PVC, right? So we should see the PVC in there, assuming everyone has

00:19:03.000 --> 00:19:09.600
applied it. Let's check for the PVC. kubectl get PVC hyphen in and then a

00:19:09.600 --> 00:19:13.680
namespace. So what happened here? Figure out and tell me what happened. Stanley

00:19:13.680 --> 00:19:25.560
cheated. Stanley skipped ahead. So now we're gonna check the PVC for all

00:19:25.560 --> 00:19:31.080
namespaces, Stanley. I don't see anything. It's a little off. Yeah. Why do you think

00:19:31.080 --> 00:19:35.300
that is? There we go. Alright, so how do we fix this? Well, we delete the failed

00:19:35.300 --> 00:19:42.180
restore. So kubectl delete hyphen f CSIRestore.yaml. And then verify that

00:19:42.180 --> 00:19:46.820
that's gone. Change the namespace to match the existing persistent volume.

00:19:46.820 --> 00:19:52.780
Remember it's namespaced to PVC. Once you change that namespace within that YAML

00:19:52.780 --> 00:19:58.860
file, then you're going to apply the modified restore file. It should be

00:19:58.860 --> 00:20:06.180
namespace under metadata. It should say namespace colon space PVC. That is in the

00:20:06.180 --> 00:20:10.660
CSIRestore.yaml. No, you keep the name in there. So we still have a metadata name.

00:20:10.660 --> 00:20:15.700
That's what names the restore, but we need to add a namespace to our metadata

00:20:15.700 --> 00:20:20.340
as well so we'd have name on the first line and then namespace on the second both with the same

00:20:20.340 --> 00:20:26.820
indentation the name is going to be csi hyphen pvc hyphen restore and then below that we have

00:20:26.820 --> 00:20:32.740
another line that says namespace colon and that will be pvc you have to have a name and the name

00:20:32.740 --> 00:20:39.460
space correct and you have to delete the old one yep and it's not instant so if you check

00:20:39.460 --> 00:20:44.660
it immediately it might show that it's still pending okay yeah so depending on the speed

00:20:44.660 --> 00:20:49.940
of your VM, the speed of the write, because it's writing a gig, it may take a few seconds.

00:20:49.940 --> 00:20:58.500
So when we check the pvc, kubectl get pvc namespace, we just see two pvcs and one is

00:20:58.500 --> 00:21:04.660
the restored snapshot. The first one was corrupted, we restored from our snapshot,

00:21:04.660 --> 00:21:12.820
and now we have a restored persistent volume claim from the snapshot. For most of them,

00:21:12.820 --> 00:21:17.700
it's a good practice. However, for testing and quick development, you can leave it off and

00:21:17.700 --> 00:21:25.540
everything will go into the default namespace, which is designed for testing. But when we're

00:21:25.540 --> 00:21:31.140
developing something for production or for the development cluster itself, then we want to get

00:21:31.140 --> 00:21:37.460
into the practice of trying to use namespaces as much as possible. And some things are cluster

00:21:37.460 --> 00:21:41.540
scoped, so they're not namespace scoped, so the namespace won't have any effect.

00:21:42.820 --> 00:21:48.280
But it's always a good practice that if you see metadata and there's no namespace in there,

00:21:48.620 --> 00:21:51.860
for most YAML files, you'll want to put a namespace in there.

00:21:51.940 --> 00:21:54.540
All right, so now I'm sure you have a fresh...

00:21:54.540 --> 00:21:56.280
Did that work well with everyone?

00:21:56.400 --> 00:21:58.440
Everyone that's out appending now?

00:21:58.620 --> 00:21:59.520
Yep, looks like it.

00:21:59.620 --> 00:22:02.540
Okay, so I'm sure we have a fresh Minicoop profile.

00:22:02.920 --> 00:22:07.060
Create a single node Minicoop cluster and make sure the cluster is up.

00:22:08.480 --> 00:22:12.300
And once it's up, we're going to create a Helm chart in the root directory.

00:22:12.300 --> 00:22:16.000
So you want to make sure you're in the root directory on this one once you're up.

00:22:16.180 --> 00:22:22.220
And remember, we already tested our Helm version on Monday, so Helm should be up and running.

00:22:22.400 --> 00:22:23.920
Oh, yeah, home student.

00:22:24.180 --> 00:22:25.360
Yeah, your home directory.

00:22:25.520 --> 00:22:29.540
So we're going to use Helm, and we're going to Helm create test hyphen.

00:22:29.620 --> 00:22:30.900
And we'll cd into that.

00:22:31.020 --> 00:22:32.040
View the contents.

00:22:32.220 --> 00:22:32.820
That's correct.

00:22:32.980 --> 00:22:36.440
We'll use less for values.yaml to open that up.

00:22:36.520 --> 00:22:38.200
And do you see anything familiar in there?

00:22:39.060 --> 00:22:47.400
And we'll go ahead and view the chart.yaml file.

00:22:47.400 --> 00:22:56.620
So you'll notice that that values.yml file contains some of the similar keys and values that we had earlier when we created deployments and pod charts.

00:22:57.220 --> 00:22:59.700
And we have a version and an app version.

00:23:00.300 --> 00:23:09.320
The version is the chart version, and the app version would be basically our Helm charts should have one container in them other than an it.

00:23:10.160 --> 00:23:16.160
And so that should be the version of your app image, which turns into a container.

00:23:17.400 --> 00:23:24.520
So that's technically how we version our Helm charts, and they don't necessarily run together.

00:23:25.960 --> 00:23:32.680
So the Helm chart version can be completely different than the app. All right, let's take

00:23:32.680 --> 00:23:38.840
a look at the chart directory, lowercase charts. What is this folder for? Remember?

00:23:38.840 --> 00:23:48.300
Yep, so the chart.yaml is where we list out our versions for our app and our chart, and

00:23:48.300 --> 00:23:53.700
then the charts directory, lowercase, is for subcharts.

00:23:53.700 --> 00:23:59.760
So if we were to list out subcharts in our capital C, chart.yaml, then it would reference

00:23:59.760 --> 00:24:05.460
subcharts along with our values.yaml and our subcharts in our charts directory.

00:24:05.460 --> 00:24:07.840
Okay, now let's go into the templates folder.

00:24:07.840 --> 00:24:17.460
Then you've got a helpers file with HPA horizontal pod autoscaler with an ingress with service account.

00:24:18.460 --> 00:24:23.040
Go ahead and less the ingress.

00:24:23.160 --> 00:24:30.020
These are the Helm templates, and they are generally not modifiable unless you maintain them independently.

00:24:30.860 --> 00:24:33.200
So this is what the ingress looks like in Helm chart.

00:24:33.200 --> 00:24:37.480
And oftentimes the upstream maintainers will make a mistake.

00:24:37.840 --> 00:24:45.340
either the ingress or the service and the only way to correct that is you can

00:24:45.340 --> 00:24:50.660
submit up a change and when they get around to it they'll fix it or you can

00:24:50.660 --> 00:24:54.940
maintain your own so you can go ahead and you can download the chart you can

00:24:54.940 --> 00:25:00.280
update it and correct the mistake and then you can maintain your own version

00:25:00.280 --> 00:25:02.680
All right, let's go ahead and deploy a Helm chart.

00:25:04.560 --> 00:25:08.320
Change back to the home folder.

00:25:08.320 --> 00:25:10.700
We'll create a namespace called test app,

00:25:10.700 --> 00:25:12.800
and we're gonna deploy the Helm chart

00:25:12.800 --> 00:25:16.780
using Helm install and then the command.

00:25:16.780 --> 00:25:19.300
So the format is our command deployment name,

00:25:19.300 --> 00:25:21.400
chart name, and namespace.

00:25:21.400 --> 00:25:25.980
So Helm install NGINX app,

00:25:25.980 --> 00:25:27.420
which is what we're calling it.

00:25:27.420 --> 00:25:29.080
So that is our deployment name.

00:25:30.040 --> 00:25:36.520
test app as our chart name because remember we called it test app but we downloaded it and then

00:25:36.520 --> 00:25:43.000
hyphen in tells us our namespace it's also going to be test app just to make it really confusing

00:25:43.000 --> 00:25:50.400
for you all right and once that's up and running we'll get all hyphen in namespace give you a

00:25:50.400 --> 00:25:56.960
little message there yeah and there's actually a notes file and so when you build your own helm

00:25:56.960 --> 00:26:01.880
charts you can add your own notes in there. Go ahead and get all, type in

00:26:01.880 --> 00:26:09.680
namespace. We should see service in there. If the image is true you can try

00:26:09.680 --> 00:26:17.240
kubectl get ingress. So it's set to not create an ingress although it does have

00:26:17.240 --> 00:26:24.460
an ingress template. Our values.yaml file is probably set ingress enable false.

00:26:24.460 --> 00:26:30.000
Okay, now let's list all of our Helm deployments. So Helm list, hyphen, capital

00:26:30.000 --> 00:26:35.860
A. You can see we only have one Helm and this is with Helm managing the state. So

00:26:35.860 --> 00:26:41.500
Helm is telling us that there's only one application running which Helm is

00:26:41.500 --> 00:26:48.080
responsible for and that is the NGINX app which is running in the test app

00:26:48.080 --> 00:26:52.020
names. And if you're managing your installs using Helm, this is how you

00:26:52.020 --> 00:26:59.300
see what is running in the cluster with Helm. And if you're using Argo, then obviously you have your

00:26:59.300 --> 00:27:04.900
UI with Argo, which will show you what is running. Okay, we're going to uninstall the Helm chart now.

00:27:04.900 --> 00:27:13.060
So Helm uninstall. We have a command, a deployment name, and then our namespace. And remember

00:27:14.900 --> 00:27:18.820
what the deployment name and the namespace are. Namespace is test app. Yep.

00:27:18.820 --> 00:27:22.060
Remember what the deployment name is?

00:27:22.060 --> 00:27:26.010
I believe so.

00:27:26.010 --> 00:27:31.210
It's hard to see your screen, but I'm pretty sure that's right.

00:27:31.210 --> 00:27:32.210
Yes.

00:27:32.210 --> 00:27:33.210
All right.

00:27:33.210 --> 00:27:35.770
On to the next one.

00:27:35.770 --> 00:27:39.330
So we can see if it was removed.

00:27:39.330 --> 00:27:41.090
We can list our Helm deployments again.

00:27:41.090 --> 00:27:42.090
You can get...

00:27:42.090 --> 00:27:43.770
Should be nothing in there.

00:27:43.770 --> 00:27:49.700
And you can also use Kube control to get all of your pods and services.

00:27:49.700 --> 00:27:53.620
to ensure a fresh minicoop environment install a cni free cluster

00:27:56.740 --> 00:28:03.460
and once that is up verify it and once that is up go ahead and take a two minute break and we'll

00:28:03.460 --> 00:28:12.500
come back at 2 37. all right does everyone have their cni free anything and you'll notice it's cni

00:28:12.500 --> 00:28:22.780
free because I believe there's no KineNet in there. Someone tell me if you see a

00:28:22.780 --> 00:28:29.580
KineNet pod. Yep, so KineNet. Yep, yeah we have no network overlay so 4DNS will

00:28:29.580 --> 00:28:36.780
probably stay that way. No network overlay, no network. Alright everyone's up

00:28:36.780 --> 00:28:46.000
So let's connect our Helm instance to an upstream Helm repo. We're going to use

00:28:46.000 --> 00:28:51.900
the Cilium Helm repo. So we're going to use a search engine in our browser to

00:28:51.900 --> 00:28:56.940
locate the cilium.io Helm chart repo. And the command is repo add. The name is

00:28:56.940 --> 00:29:04.920
Cilium. Something like this. You want to locate the Helm chart repo. So you'll go

00:29:04.920 --> 00:29:13.800
to a cilium and you're going to look for in the readme of the cilium so you for

00:29:13.800 --> 00:29:18.780
those that are on the actual chart repo itself go back one step to the readme or

00:29:18.780 --> 00:29:25.000
you can also do cilium helm values and that'll bring it up well but you want to

00:29:25.000 --> 00:29:32.280
go to the github so cilium helm values github let me see how difficult it is to

00:29:32.280 --> 00:29:37.480
actually find the name of the repo. And now look for the readme file. Now that you're in the values.yaml

00:29:37.480 --> 00:29:44.760
go back one step and look for the readme in that directory with the values.yaml. And in there it

00:29:44.760 --> 00:29:51.880
should give you the string for adding it, adding the HelmShot repo. But you'll want a home repo

00:29:51.880 --> 00:30:02.980
add i see it on routes look like this home repo add psyllium and almost always it's going to be an

00:30:02.980 --> 00:30:14.020
https hopefully and it can actually sometimes be difficult to find the home repo add string

00:30:15.860 --> 00:30:21.140
for the chart so occasionally you will find an upstream team that forgets to put that in yeah

00:30:21.140 --> 00:30:26.180
Or you can just type what I have up on the slide, Helm repo add cilium HTTPS.

00:30:28.420 --> 00:30:32.420
That was more of an exercise in finding the repo name. And we're going to Helm repo list

00:30:32.420 --> 00:30:38.580
and verify that it was added. We should see a cilium in there with the URL. And let's search

00:30:38.580 --> 00:30:45.940
the Helm repo and see what's available. We have Tetragon or something like that. Yeah.

00:30:45.940 --> 00:30:53.920
Now let's see. Yeah, so we've got two different charts available, and it's

00:30:53.920 --> 00:30:58.400
showing the latest chart, 1.18.5, but you know what? Let's just see what

00:30:58.400 --> 00:31:03.700
versions can we get through this. So, home search repo cilium, but now at the end

00:31:03.700 --> 00:31:11.460
we'll do a hyphen L. Yeah, so let's say that the latest version has a

00:31:11.460 --> 00:31:15.480
regression, a major regression, or a bug, and that happens frequently, by the way.

00:31:15.480 --> 00:31:23.240
um especially on dot zeros and dot ones so there are certain teams that like with psyllium i would

00:31:23.240 --> 00:31:30.340
not install a dot zero or a dot one now wait for a dot two the worst offender is longhorn i wait

00:31:30.340 --> 00:31:39.960
for a dot three usually on longhorn um before i install so if the latest is 1.18.0 for example

00:31:39.960 --> 00:31:46.620
and that's not what you want you can helm repo helm search repo cilium hyphen l and then pick

00:31:46.620 --> 00:31:54.780
a version um that's a little bit more stable than the most recent major yeah generally you always

00:31:54.780 --> 00:32:02.920
want to test it um on development but um yes that would be correct yeah yeah longhorn i wait for dot

00:32:02.920 --> 00:32:07.680
three i've been burned so many times by that team i mean they're a great team and i've helped them

00:32:07.680 --> 00:32:14.740
out you know on debugging their their errors but but they'll admit to you that they test on a very

00:32:14.740 --> 00:32:21.540
basic test kind cluster that's provided by the cncf foundation and it's only as good as the

00:32:21.540 --> 00:32:26.960
tests that they write and none of them run it in production so they have no idea what to write for

00:32:26.960 --> 00:32:32.820
their tests unless you tell them so if you run into something it's always good to communicate

00:32:32.820 --> 00:32:38.060
that to the Longhorn team, and then when they get around to it, they'll write that into their test.

00:32:38.060 --> 00:32:46.980
But they'll create a new feature, and it won't be fully tested, and it'll break your

00:32:46.980 --> 00:32:54.140
application. That's one of the reasons that you never should be upgrading in place on a

00:32:54.140 --> 00:32:59.100
production cluster. If you had something like Longhorn or Silium, and you upgraded in place

00:32:59.100 --> 00:33:05.260
a dot zero you really risk fragging your production cluster so one of the reasons

00:33:05.260 --> 00:33:10.300
that we test with infrastructure as code on a development cluster and once it's tested it's

00:33:10.300 --> 00:33:16.460
written into the infrastructure as code now we can spin up a new production cluster with the tested

00:33:16.460 --> 00:33:23.100
it's fraught with peril if you do it the old way all right so we're going to update the repo now

00:33:23.100 --> 00:33:29.980
Obviously we just added it, so it has the latest 1.18.5, but in the event that you had already

00:33:29.980 --> 00:33:36.780
added it and you wanted to install the chart, the latest chart, you would run helm repo update,

00:33:36.780 --> 00:33:40.700
and that would pull in whatever the latest version is. Let's show the values. Let's see

00:33:40.700 --> 00:33:47.580
if this works on your instance. Sometimes this does not work. So show values, silly and silly.

00:33:47.580 --> 00:33:55.380
Yep. Worked for Stanley. Yep. Looks like it's working. All right. Let's see. So there's

00:33:55.380 --> 00:34:02.480
a lot in there, right? You want to know how many lines there are? Yeah, a lot. So, yeah.

00:34:03.820 --> 00:34:08.200
All right. Did you make that up or did you read that? Oh, there you go. All right. So

00:34:08.200 --> 00:34:13.720
what we're going to do is we're going to cap the values to a values.yaml file. So helm

00:34:13.720 --> 00:34:20.520
show values again and then we'll cat it to um psyllium hyphen helm hyphen values dot yaml

00:34:21.800 --> 00:34:26.200
and make sure everyone's in their home folder here and then we'll sudo vim into that

00:34:26.200 --> 00:34:32.600
file once you cat look you must have used a different name go ahead and colon q

00:34:33.640 --> 00:34:40.360
uh exclamation point check your naming all right so now we can see we can go in and we can modify

00:34:40.360 --> 00:34:47.500
values. So we'll exit out of the file and we're going to deploy the Cilium Helm

00:34:47.500 --> 00:34:50.880
chart using the helm install command. We're going to use a deployment name of

00:34:50.880 --> 00:34:55.880
Cilium and deploy in the kube-system namespace. That'll make it easy.

00:34:55.880 --> 00:35:02.800
We're going to obtain the chart name using helm search repo cilium and this

00:35:02.800 --> 00:35:06.640
is our format. Remember how we would install this using that format?

00:35:06.640 --> 00:35:12.480
Yep, cilium, cilium, yep, cilium, cilium.

00:35:12.480 --> 00:35:18.300
It's a little confusing with Helm charts sometimes, especially when the team name or the provider

00:35:18.300 --> 00:35:21.900
name is the same as the application name, but yes, cilium, cilium.

00:35:21.900 --> 00:35:25.660
And then our namespace, which is going to be the Poop system namespace, so it'll look

00:35:25.660 --> 00:35:26.660
like this.

00:35:26.660 --> 00:35:33.480
Helm install cilium, cilium, cilium, hyphen n, and then our namespace is Poop.

00:35:33.480 --> 00:35:41.200
we will check our pods once we've installed that. Alright looks like

00:35:41.200 --> 00:35:49.860
everyone's got it up. KoopaTool get pods and the Koop system namespace. You can see

00:35:49.860 --> 00:35:55.300
Cilium starting up. Oh yeah we took so long our core DNS went into

00:35:55.300 --> 00:35:59.380
crash loop back off but it should come out of that. I think after five failures

00:35:59.380 --> 00:36:04.220
and you can look at the pod manifest.

00:36:06.140 --> 00:36:09.760
Yeah, so after it is unsuccessful, I think it's five times,

00:36:09.860 --> 00:36:13.300
depending on how it's set for either the startup or the readiness probe,

00:36:13.960 --> 00:36:15.780
it'll go into crash loop back off,

00:36:15.860 --> 00:36:20.860
so it doesn't keep hammering your API server, your scheduler, and your etcd.

00:36:22.780 --> 00:36:25.800
It's resource intensive when it's trying to start up.

00:36:25.800 --> 00:36:29.120
Anytime a cluster is starting up, a pod or application is starting.

00:36:29.380 --> 00:36:35.300
So it doesn't want to keep hammering the API server in etcd, so it will go into a back off

00:36:36.100 --> 00:36:44.020
mode so that it isn't draining your resources. Ah, let's see. Yes. Yes. So what it did is it

00:36:44.020 --> 00:36:51.300
deleted the old hash and created a new one. So our psyllium, they're probably, is everyone

00:36:51.300 --> 00:36:57.940
up on our psyllium? Are they still pending or? Yeah. So if you describe that operator,

00:36:57.940 --> 00:37:02.620
So find the offending operator that's pending and go ahead and kubectl describe it.

00:37:03.560 --> 00:37:05.560
Remember your namespace is kubesystem.

00:37:06.460 --> 00:37:09.340
And someone read to me what that error is.

00:37:10.900 --> 00:37:11.700
Fascinating.

00:37:11.940 --> 00:37:14.680
You know, I want to think of why that might be.

00:37:15.220 --> 00:37:24.880
They are, and we only have one node and we have our cilium values that yaml file is set to install two operators.

00:37:24.880 --> 00:37:32.280
However, that is a high availability setup. We only have one node and so they

00:37:32.280 --> 00:37:36.420
each need the same port. I believe it's 9963 that you're seeing.

00:37:36.420 --> 00:37:45.340
It can't install the second operator on the same node. It only has one port 9963

00:37:45.340 --> 00:37:50.620
to assign, so that went to the first. So that will remain in pending until we

00:37:50.620 --> 00:37:54.160
create a second node, which we're not going to do. So we're going to go ahead and remove

00:37:54.160 --> 00:38:01.120
the selling Helm deployment is. Helm uninstall cilium and then the namespace. So our deployment

00:38:01.120 --> 00:38:08.300
name was cilium, not to be confused with cilium cilium, the chart name. So Helm uninstall cilium

00:38:08.300 --> 00:38:15.820
the deployment name and then the namespace. And we'll get all and make sure it's uninstalled.

00:38:16.000 --> 00:38:20.180
All right, so now we're going to install the MongoDB repo. We're going to use a Percona

00:38:20.180 --> 00:38:24.740
distribution, which enables encryption. I don't know if we'll get all the way through this or not,

00:38:24.740 --> 00:38:31.780
we'll see. So I'm going to have you try to find the repo. I think Percona is one of those

00:38:31.780 --> 00:38:38.580
difficult ones perhaps. So I'm going to provide it for you. Tell them repo add, and then that's

00:38:38.580 --> 00:38:43.540
a long one. Then we'll update the repo. Although it's generally not a requirement because we're

00:38:43.540 --> 00:38:49.380
pulling it in fresh, we'll go ahead and update it. That's a good practice. Then we're unable to

00:38:49.380 --> 00:38:56.340
added or okay everyone's got it in there so now let's verify the repo is installed home repo list

00:38:56.340 --> 00:39:02.420
we should see two repos in there one for cilium and one for percona so okay let's see here

00:39:04.900 --> 00:39:11.380
now let's search the repo and percona has a lot done and so you should see percona

00:39:11.380 --> 00:39:21.300
PSMDB-DB and Percona PSMDB-Operator because we're going to install an operator and you should be

00:39:21.300 --> 00:39:28.180
able to verify all the versions available in the home repo of each of those names and we are going

00:39:28.180 --> 00:39:36.420
to insert a fresh Minikube profile now and we're going to create a single node Minikube cluster

00:39:36.420 --> 00:39:43.860
with two cpus this time and two gig of memory and once that is up kube control get nodes

00:39:43.860 --> 00:39:49.380
all right we're going to install the mongo operator helm chart for the operator so this

00:39:49.380 --> 00:39:56.740
would be helm install mongo operator and then percona psmdb dash operator which i believe

00:39:56.740 --> 00:40:02.020
stands for percona server mongodb yeah so we won't give it a version we'll just give it the

00:40:02.020 --> 00:40:09.700
home install. It'll automatically assume latest or it should and it should do this in the default

00:40:09.700 --> 00:40:14.340
namespace. Yeah I believe it's going to install it automatically in the default namespace. You could

00:40:14.340 --> 00:40:18.900
and I typically name those the operator has its own namespace just for the operator

00:40:19.700 --> 00:40:25.140
and then the databases that it's responsible for spinning up and the volumes that those databases

00:40:25.140 --> 00:40:30.820
manage get installed to their own unique namespaces because you might have a Mongo database for

00:40:32.020 --> 00:40:37.060
i mean you don't use mongo but we might have a mongo for automation we might have a mongo for cars

00:40:37.700 --> 00:40:42.980
we might have an automation for we might have a mongo for a runner so each one we get their

00:40:42.980 --> 00:40:48.820
own unique namespace and have their own database and then the mongo operators generally i install

00:40:48.820 --> 00:40:54.500
it under mongo operator namespace and once that is up looks like everyone is it up

00:40:55.380 --> 00:41:00.180
see if the operator is running good control get pods all right we're up and running now we're

00:41:00.180 --> 00:41:07.700
to install the mongo server helm chart and this is herkona server mongodb dash db and we'll make

00:41:07.700 --> 00:41:16.580
sure the db is running they have their own k8 squad that's cool pause initializing initializing

00:41:16.580 --> 00:41:22.980
what's going on here let's go ahead and describe one of those so we should have one running and one

00:41:22.980 --> 00:41:28.420
pending we have one running and one pending zero should be running and one should be pending and

00:41:28.420 --> 00:41:36.020
it's going to try to spin up two perhaps, and two will be pending as well. Keep checking your pods

00:41:36.020 --> 00:41:40.740
and see what happens here. See anything pending? Okay, and then describe that one that's pending.

00:41:42.820 --> 00:41:49.140
And remember the pod anti-infinity is a repellent, so the first pod that is scheduled to that node,

00:41:49.780 --> 00:41:54.100
when the second pod tries to schedule to that same node, what happens? It gets repelled

00:41:54.100 --> 00:42:00.370
because it says I cannot be on the same node as the first pod. So pod anti-infinity,

00:42:01.970 --> 00:42:10.450
meaning they cannot be on the same node. Well, we'd be able to install two, but this is installing

00:42:10.450 --> 00:42:14.210
high availability out of the box. So I believe it's going to install three, but we'll find out

00:42:14.210 --> 00:42:20.610
here in just a second. So now make sure you have a fresh Minicoop profile, and this time we're going

00:42:20.610 --> 00:42:26.610
to do three nodes so the same thing but three nodes and make sure the cluster is up we actually

00:42:26.610 --> 00:42:31.090
had two errors if we work through i believe you have another one with um persistent volume claims

00:42:31.090 --> 00:42:35.090
yeah and it had a persistent volume claim there yeah so we should have had two errors

00:42:35.090 --> 00:42:39.890
a persistent volume claim and um a pod anti-infinity

00:42:41.970 --> 00:42:55.730
all right let's skip ahead here whoever hits a mini poop start first seems to

00:42:55.730 --> 00:42:58.910
to be quite a bit ahead of everybody else.

00:42:58.910 --> 00:43:01.050
So maybe that's a network thing.

00:43:01.050 --> 00:43:01.890
Okay. All right.

00:43:01.890 --> 00:43:02.710
We're all up.

00:43:02.710 --> 00:43:05.150
So now we need a local path storage provisioner.

00:43:05.150 --> 00:43:06.250
I just skipped one.

00:43:06.250 --> 00:43:08.550
I would have shown you another error message.

00:43:09.690 --> 00:43:13.530
We're gonna skip through the different sections.

00:43:13.530 --> 00:43:15.870
So Rancher solved this issue.

00:43:15.870 --> 00:43:17.270
It's an issue with Minicoob.

00:43:19.430 --> 00:43:21.750
And so when we go to install this,

00:43:21.750 --> 00:43:24.650
if we had to work through the errors for debugging,

00:43:24.650 --> 00:43:26.930
And we're through at 3.30 today, so.

00:43:28.510 --> 00:43:32.810
And we would see we have an issue with local storage, so rancher solve this.

00:43:34.550 --> 00:43:37.630
Minikube add-ons enable storage provisioner rancher.

00:43:38.050 --> 00:43:43.040
We'll make sure the storage class is provisioned and is the default.

00:43:43.120 --> 00:43:44.640
Get the storage class.

00:43:45.800 --> 00:43:46.280
Get in here.

00:43:46.380 --> 00:43:47.040
Oh, yeah, yeah.

00:43:47.220 --> 00:43:48.460
You should be able to still get it.

00:43:49.220 --> 00:43:51.480
Minikube needs to fix this.

00:43:51.480 --> 00:43:56.880
Yeah, Ryan, you're the only one with that.

00:43:56.880 --> 00:44:00.940
Try to make sure that you have it typed out exactly the way that I have it.

00:44:00.940 --> 00:44:02.240
You have the hyphens in there?

00:44:02.240 --> 00:44:03.240
Okay.

00:44:03.240 --> 00:44:04.720
All right, and get your storage class.

00:44:04.720 --> 00:44:05.720
All right.

00:44:05.720 --> 00:44:06.720
See local path default.

00:44:06.720 --> 00:44:10.600
So now we need a namespace for MongoDB.

00:44:10.600 --> 00:44:14.320
So create a namespace and then verify that the namespace has been created.

00:44:14.320 --> 00:44:17.680
And now we're going to view the operator values file.

00:44:17.680 --> 00:44:24.620
I'll show values Percona, PSMDB-operator, just to make sure our command is correct.

00:44:24.740 --> 00:44:29.000
And we're going to make sure that I'll put something in the terminal, assuming that it

00:44:29.000 --> 00:44:29.460
does.

00:44:29.660 --> 00:44:36.940
Now we're going to do the command to cap that to PSMDB-operator-home-values.yaml.

00:44:36.980 --> 00:44:41.020
Note, this is one that we're creating from scratch from the output to the terminal.

00:44:41.180 --> 00:44:43.720
So it should be a full values.yaml file.

00:44:43.820 --> 00:44:47.660
If your file is blank and something happens, and you'll need a space.

00:44:47.680 --> 00:44:53.700
between the whoops so if you can see the cat command here where my cursor is

00:44:53.700 --> 00:45:03.820
you'll need a space between that cat and the PSMDB okay so you want a space here

00:45:03.820 --> 00:45:09.140
but you see where my cursor is well you want to make sure you have a space there

00:45:09.140 --> 00:45:15.200
there you go there you go okay get out of that and LS you see it listed there

00:45:15.200 --> 00:45:21.120
Go ahead and delete that out, sudo rm-f and then name of that YAML file.

00:45:21.120 --> 00:45:32.720
So do sudo rm-f whatever the values that YAML is, the whole thing.

00:45:33.680 --> 00:45:38.720
PSMDB operator, Helm values, or actually just sudo vim into PSMDB operator

00:45:38.720 --> 00:45:47.400
dash helm dash values.yaml. Looks like you were just viming into the wrong values.yaml file.

00:45:47.480 --> 00:45:55.440
And you can hit the tab. No, not Cilium, just PSMDB. So go back and then type PSMDB and there

00:45:55.440 --> 00:46:01.800
you go. Now what we're going to do is we're going to look for disabled telemetry. And did everybody

00:46:01.800 --> 00:46:08.280
sudo vim in? And so this is referred to as your values.yaml file. It's named PSMDB hyphen operator

00:46:08.280 --> 00:46:14.040
hyphen helm hyphen values dot yaml. Just to be clear. So we're going to look for disabled

00:46:14.040 --> 00:46:20.440
telemetry and change it to true. And we'll save that. And install the operator using helm. So

00:46:20.440 --> 00:46:26.600
it's helm install mongo operator because that's what we're calling it. And then Percona PSMDB

00:46:26.600 --> 00:46:34.440
operator is the name of the chart. And then we're going to give it a file. PSMDB dash operator dash

00:46:34.440 --> 00:46:40.040
helm-values.yaml, and then we're going to give it a namespace, a namespace at MongoDB.

00:46:41.320 --> 00:46:45.720
That's a lot to type in, but that is the way that we would install it with Helm.

00:46:45.720 --> 00:46:52.600
All right, now we need to create a values.yaml file for, now let's show values for the DB file,

00:46:52.600 --> 00:46:58.120
that was the operator, and the operator will spin up our database, so we need to view the values for

00:46:58.120 --> 00:47:05.160
the db file and we'll cap the values.yaml to and again you'll you'll need to remember there's a

00:47:05.160 --> 00:47:15.710
space here between this cat symbol and psmdb make sure you put a space here so if i'm on a server

00:47:15.710 --> 00:47:23.870
i'll cap it and if i am building infrastructure as code then i copy and paste the entire yaml

00:47:23.870 --> 00:47:31.770
file starting out and then I delete what I don't need. So when I make a change I keep that but then

00:47:31.770 --> 00:47:38.630
I delete what I'm not changing. So I end up with a values.yaml file that just has the minimum number

00:47:38.630 --> 00:47:45.090
of lines and what I don't have in my values.yaml file it will automatically pull from the main

00:47:45.090 --> 00:47:54.250
values.yaml file. So if I have a key and value in mind, it overwrites whatever is in the main

00:47:54.250 --> 00:48:01.290
values.yaml file. Otherwise, it leaves it alone. But my goal is to have a minified values.yaml

00:48:01.290 --> 00:48:13.160
file. Did that make sense? Yes. Correct. Yes. Yes. And so with IEC, you can't run full values.yaml

00:48:13.160 --> 00:48:19.080
files for some of these Helm charts, simply because the format that they're in does not work.

00:48:19.080 --> 00:48:24.120
We use Jinja templates for IAC, and the format does not work for Jinja templates.

00:48:24.120 --> 00:48:31.720
You'd have to modify the values.yaml file in a way that would make it difficult to work.

00:48:33.960 --> 00:48:38.840
So with infrastructure as code, it's Jinja. So it's a Jinja template. We turn it into a Jinja

00:48:38.840 --> 00:48:43.500
template, but, um, and that's not for declarative GitOps.

00:48:43.500 --> 00:48:45.380
That's just for infrastructure as code.

00:48:45.800 --> 00:48:50.300
But some of the templating that's in the home values.yaml file is

00:48:50.300 --> 00:48:51.740
not compatible with Jinja.

00:48:51.800 --> 00:48:54.920
It'll give you a go error instead of a go warning.

00:48:55.400 --> 00:48:57.920
We use very little just for the infrastructure as code.

00:48:57.920 --> 00:49:01.880
And then we use the basic values.yaml file for our declarative GitOps.

00:49:01.880 --> 00:49:04.520
So not too much in Jinja 2.

00:49:04.520 --> 00:49:14.280
Okay, so we're going to vim into our psndb-db, and we are going to change the three of these.

00:49:14.280 --> 00:49:18.700
So Kona, find these with, yeah, we need to find these three.

00:49:18.700 --> 00:49:22.460
Yeah, sharding enabled should be false.

00:49:22.460 --> 00:49:24.240
Backup enabled should be false.

00:49:24.240 --> 00:49:26.520
And make, I believe we have to make sure it's uncommon.

00:49:26.520 --> 00:49:29.680
It should be there somewhere and, oh yeah.

00:49:29.680 --> 00:49:31.320
All right.

00:49:31.320 --> 00:49:32.520
And go ahead and save that.

00:49:32.520 --> 00:49:41.400
We're going to install it using helm, remember it's helm install, our deployment name, our chart name, hyphen f, our file name, hyphen n, our namespace.

00:49:41.840 --> 00:49:47.500
And we'll verify the db is running, kubectl get psmdb, hyphen n, mongodb.

00:49:49.120 --> 00:49:56.420
Yep, it'll take a few minutes to provision all the volumes and the stateful sets, but you can do kubectl get all, hyphen n, mongodb.

00:49:56.420 --> 00:50:02.200
And this allows you to see the operator and the databases operating in the same namespace.

00:50:02.420 --> 00:50:08.480
So it's great for learning and testing, but in production, we'd want to separate those namespaces.

00:50:08.580 --> 00:50:11.920
Correct, because the operator will control multiple databases.

00:50:13.120 --> 00:50:17.140
So it would be in its own namespace, and each database would be in its own namespace.

00:50:25.060 --> 00:50:29.660
Correct, so in automation, I forget, is automation prod its own namespace?

00:50:29.660 --> 00:50:33.900
So then you could put a Mongo database in automation prod namespace.

00:50:34.200 --> 00:50:49.200
If it were on the same cluster, if it's on its own database as a service, then you could call it, you know, automation prod, still, you know, cars prod.

00:50:49.200 --> 00:50:51.200
I'm not sure what you name the other one.

00:50:51.200 --> 00:51:08.440
And if we keep trying, we can get pbc-nmongodb.

00:51:08.440 --> 00:51:18.290
Is it ready? It's ready.

00:51:18.290 --> 00:51:27.390
Get PSMDB. All right. Get PB. Now let's minicube SSH into the minicube server.

00:51:27.390 --> 00:51:31.330
Oh, there might be a space in there. Do you have a space between minicube and mo2?

00:51:31.330 --> 00:51:38.450
Okay. I think it's minicube 0.02. Or 0.02. Okay. Then we're gonna cd into...

00:51:38.450 --> 00:51:46.920
Yeah, that'll work. So cd into OptiLocalPathProvisioning. Yeah, and we're

00:51:46.920 --> 00:51:51.000
gonna CD into that PVC. You should be able to just tab once you start typing.

00:51:51.000 --> 00:51:56.940
And we'll LSLA and there is your volume and if you know anything about Mongo you

00:51:56.940 --> 00:52:02.560
see something familiar. You have Wired Tiger, you have your collectors,

00:52:02.560 --> 00:52:11.380
collections, I mean you have your indexes, lock file, logs. Alright so that's what it

00:52:11.380 --> 00:52:17.400
looks like. Now I'm gonna exit so just type exit and we're gonna check the

00:52:17.400 --> 00:52:22.200
database encryption at rest. It's a long string, but you can actually check

00:52:22.200 --> 00:52:30.780
kubectl get pods and you'll see that it's MongoDB PSMDB DB RS 0 0.

00:52:30.780 --> 00:52:39.780
Should be. So kubectl logs MongoDB PSMDB and the command is mongod and we

00:52:39.780 --> 00:52:44.040
might have to change that depending on which version it just installed for

00:52:44.040 --> 00:52:51.640
Mongo, but it might not allow MongoD, might have to change that to Mongo, vice versa.

00:52:51.640 --> 00:52:59.560
MongoD is, so it's the command for the Mongo shell, the Mongo daemon, and the namespace

00:52:59.560 --> 00:53:00.560
mongodb.

00:53:00.560 --> 00:53:08.280
Yeah, so you, oh, what'd you get, you have an error in yours, Stanley, or you can try

00:53:08.280 --> 00:53:19.500
MongoDB MongoSH. I think it's MongoSH. I'm not sure which version of Mongo

00:53:19.500 --> 00:53:25.980
it's using. Okay try MongoD. Let's see. Just take out the "-d mongod". Let's try

00:53:25.980 --> 00:53:32.100
it without that. Take out the "-c mongod". Enable encryption. Yeah I have to check

00:53:32.100 --> 00:53:37.780
that and see what version we ran. Can anyone scroll up and see what

00:53:37.780 --> 00:53:43.700
version we just installed because we did latest we didn't pin it yeah you scroll up you'll have

00:53:43.700 --> 00:53:50.980
the list of mongo versions for the db and i'll write down what version is now the latest i

00:53:50.980 --> 00:53:56.580
should have pinned that to a version i guess 121.1 is what we have all right yeah i think um

00:53:58.660 --> 00:54:04.100
yeah so i think when we went to 1.21 that's the issue so i'll have to investigate that and

00:54:04.100 --> 00:54:08.900
somebody just output the full logs. Let's see what the full logs are. It's actually 330 with them.

00:54:09.860 --> 00:54:15.300
Let's take a look at the logs here. But nothing that says encryption keys db is initialized

00:54:15.300 --> 00:54:20.980
successfully. All right 1.21 might have required a flag for they may have turned encryption off

00:54:20.980 --> 00:54:28.500
actually and we may need to enable flags so I'll investigate that tonight and see what 121 did.

00:54:28.500 --> 00:54:38.060
uh but yeah okay so it's hard to read your screen but um yeah and it should output into the log

00:54:38.060 --> 00:54:44.060
that our encryption is enabled but for some reason it's not so i'll have to investigate 1.21 and see

00:54:44.060 --> 00:54:51.400
what is changing in that and then figure out what i need to pin it to but essentially you

00:54:51.400 --> 00:54:58.460
you can see how we were able to install an operator and then from the operator we installed

00:54:58.460 --> 00:55:04.480
a database and we can install multiple databases so we can keep spinning up those database helm

00:55:04.480 --> 00:55:14.350
charts with a different name each time so we can spin up one with this one's called um what we

00:55:14.350 --> 00:55:22.250
call this one psmdb what did we call this uh mongodb so this one we called it mongo-db we

00:55:22.250 --> 00:55:28.970
could call the next one mongo-db1 mongo-dd2 etc right and just as long as it's been created in

00:55:28.970 --> 00:55:36.890
on a namespace and have multiple databases with one operator so you can see how operators work

00:55:39.050 --> 00:55:43.530
and we can use it you know it doesn't have to be with just a database there are other

00:55:43.530 --> 00:55:51.130
ways to use operators as well so all right i have additional exercises it'll be in the pdf

00:55:51.130 --> 00:55:56.490
if you wanted to go through and play around you can add a a user to mongo

00:55:56.490 --> 00:56:05.190
I believe I have in here where you can add a side card to it in another example.

00:56:05.190 --> 00:56:10.440
That will be tomorrow for collecting metrics.

00:56:10.440 --> 00:56:12.440
Alright, anyone have any questions?

00:56:12.440 --> 00:56:17.440
Alright, so Ralph, did you want the PDFs for 8 and 9?

00:56:17.440 --> 00:56:19.440
Yeah.

00:56:19.440 --> 00:56:23.440
Yeah, I'll go through them. They may have some typos.

00:56:23.440 --> 00:56:33.980
Yes, I'll send the updated ones, and then the ones that you'll receive tonight for 8 and 9 will probably have typos in them, and then I'll fix those in the morning.

00:56:35.560 --> 00:56:37.760
Otherwise, I have to go through twice and fix it.

00:56:38.100 --> 00:56:39.200
I think so.

00:56:41.640 --> 00:56:51.240
I'll just add it to the same group email, so you can just kind of scroll back through and just remember the most recent email will have the most recent version of the PDF without the typos.

00:56:51.240 --> 00:56:56.600
so all right so with that i will see everyone at 11 a.m okay see you guys tomorrow
