Skip to content

Commit

Permalink
updated stuff to make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
vallard committed Jul 30, 2022
1 parent 18ebcc5 commit 14d3bdd
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 180 deletions.
107 changes: 0 additions & 107 deletions MONITOR01/README.md

This file was deleted.

62 changes: 0 additions & 62 deletions MONITOR01/monitoring-ingress-rules.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions MONITORING-SETUP.md

This file was deleted.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,17 @@ In this segment we'll go over some Kubernetes primitives. We move fast, show wh
### M01 - Basic Monitoring

* [README](m01/README.md)
* [Metrics API](m01/README.md#03.-Metrics-API)
* [Lens](m01/README.md#04.-Basic-Monitoring-with-lens)
* [k9s](m01/README.md#05.-k9s)

### M02 - Slack App Integration

* [README](m02/README.md)
* [Setup app for Kubernetes](m02/README.md#basic-application)
* [External Secretst](m02/README.md#external-secrets)
* [Application Slack Integration](m02/README.md#applicattion-slack-integration)
* [Application Kubernetes Deployment](m02/README.md#

### M03 - Prometheus

Expand Down
Binary file added images/mo/m01-k9s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mo/m01-lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/mo/m02-rad-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 67 additions & 1 deletion m01/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
# Kubernetes Observability and Monitoring

If you've already completed part one of this class you'll have a cluster up that is ready to roll! If not, you'll need to get it all ready for the class. Let's get caught up


## 01. Set up Basic EKS

We have an EKS terragrunt plan in [../02/terragrunt/live/stage-mon](../02/terragrunt/live/stage-mon). To start run:

```
terragrunt run-all apply
```

This will set up the basic cluster you'll need as well as OpenSearch that we'll use for the logging portion of this class at the end.

You should then add the cluster to your kube config with:

```
aws eks update-kubeconfig --name eks-stage-mon \
--alias eks-stage-mon \
--role-arn arn:aws:iam::188966951897:role/eks_dude_role
```

## 02. Kubernetes Additional Users

Once you can access you're Kubernetes cluster you need to add the ingress controller, associate with Route 53, and then add the cert-manager components:

```
```

```
kubectl edit cm -n kube-system aws-auth
Expand All @@ -12,4 +41,41 @@ Add:
- system:masters
rolearn: arn:aws:iam::188966951897:role/eks_dude_role
username: devops:{{SessionName}}
```
```

## 03. Metrics API

We can install the metrics API that we mention in [part 5](../05/metrics-server-0.6.1).

```
kubectl apply -f 05/metrics-server-0.6.1/
```

Once this is done we should be able to run:

```
kubectl top nodes
kubectl top pods -A
kubectl get —-raw /metrics
```




## 04. Basic Monitoring with Lens

Get [Lens](https://k8slens.dev/) and install and open. It should read your `~/.kube/config` and be able to open up a session.

![](../images/mo/m01-lens.png)

Have a look around and notice if there are any issues.

## 05. K9s

Install [k9s](https://k9scli.io/topics/install/). k9s uses your current context to show your cluster and monitor different components.

![](../images/mo/m01-k9s.png)

# Section 1 WrapUp

Cool, we now have a basic cluster, metrics are enabled and we have two different dashboard options we can look at to monitor our cluster. Lens is great especially if you're not into remembering Kubernetes commands and just want a clean IDE to look at.
35 changes: 31 additions & 4 deletions m02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ If you haven't done the first modules in the first class, then we need to quickl

```
cd 04
apply -f nginx-ingress-controller/deploy.yaml
kubectl apply -f nginx-ingress-controller/deploy.yaml
kubectl apply -f cert-manager/cert-manager.yaml
```

Modify the DNS name to match the Load Balancer
Modify the DNS name to match the Load Balancer. This is done in Route53.

```
kubectl apply -f cert-manager/prod-issuer.yaml
Expand All @@ -26,7 +26,6 @@ This includes database permissions, slack APIs, etc. The cost to store this in

```
helm repo add external-secrets https://charts.external-secrets.io
helm install external-secrets \
external-secrets/external-secrets \
-n kube-system \
Expand All @@ -35,7 +34,7 @@ helm install external-secrets \
```


## Modifying the application for Slack
## Application Slack Integration

We first need to create a Slack Application and get a token for posting to our Slack messages.

Expand Down Expand Up @@ -109,4 +108,32 @@ yarn install
yarn start
```

## Installing to Kubernetes

There is a yaml file we can use, be sure to edit to use your own domain. Also ensure your secrets are set inside AWS secrets manager. You can run:

```
kubectl apply -f app-api/app-api.yaml
```

The front end, similarly can be applied with:

```
kubectl apply -f app-fe/app-fe.yaml
```

You can get the urls with

```
kubectl get ing -A
```

When we login we can now see alerts in Slack.

![](../images/mo/m02-rad-app.png)

## Module 2 Summary

In this module we learned how to make a slack client, robot, and receive alerts. The important part that relates to Kubernetes is how you can store the secrets for accessing in Kubernetes without compromising by storing secrets in code.


1 change: 1 addition & 0 deletions m03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ But we would like to customize this first.

First, we'd like to put everything in a `monitoring` namespace so we can keep it all in one go. So we'll create the namespace in a yaml file.


### Basic Authentication

We'd like to protect our data with some authentication even though it may not be the most secure. To do that we can generate an `.htpasswd` file. Let's do that online by entering a user and a password.
Expand Down

0 comments on commit 14d3bdd

Please sign in to comment.