Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cmwylie19/kubescrub-operator
https://github.com/cmwylie19/kubescrub-operator
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/cmwylie19/kubescrub-operator
- Owner: cmwylie19
- Created: 2023-03-15T21:50:41.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T14:21:29.000Z (almost 2 years ago)
- Last Synced: 2024-06-19T11:38:31.965Z (6 months ago)
- Language: Go
- Size: 234 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubescrub Operator
**Video Demo**
[![Video Demo](https://img.youtube.com/vi/AmrmLz01NJM/0.jpg)](https://youtu.be/AmrmLz01NJM?t=5)
Kubernetes is a powerful and versatile container orchestration platform that allows organizations to deploy, manage, and scale containerized applications with ease. However, as Kubernetes environments grow in complexity, it can become challenging to keep track of all the resources being used and to ensure that none of them are orphaned or left unused. This is where the Kubescrub app comes in handy.Kubescrub is an intelligent application that makes educated predictions about whether resources in a Kubernetes cluster are orphaned or not. With its highly configurable nature, Kubescrub can be tailored to meet the specific needs of an individual or organization. Users can choose the theme, polling options, polling intervals, and specify which resources and namespaces to watch.
_This operator deploys the kubescrub application (written last week over a few days), consisting of a React frontend and a Go backend. See the [usage](#usage) section for configuration options._
This operator installs and deploys:
- NGINX Ingress Depedencies
- Kubescrub Operator Dependencies
- Ingress (NGINX)
- Frontend Deployment
- Backend Deployment
- Frontend Service
- Backend Service
- Service Account for backend (Needs permissions to look at resources)
- ClusterRole for SA
- ClusterRoleBinding for SA**TOC**
- [Usage](#usage)
- [Prereqs](#prereqs)
- [Tutorial](#tutorial)
- [Sites](#sites)
- [Clean Up](#clean-up)## Usage
| Name | Type | Description | Values | Optional |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------ | ------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------ |
| [Poll](https://github.com/cmwylie19/KubeScrub/blob/4ce1dc3723f53d693227595a2f1c3b4507d5e88b/server/cmd/kubescrub/server.go#L35) | string | Frontend polls backend for updates | "true", "false" | true, default to false |
| [PollInterval](https://github.com/cmwylie19/KubeScrub/blob/4ce1dc3723f53d693227595a2f1c3b4507d5e88b/server/cmd/kubescrub/server.go#L36) | string | Interval that frontend queries backend for updates in seconds | "5", "60" | true, defaults to 60 seconds |
| [Namespaces](https://github.com/cmwylie19/KubeScrub/blob/4ce1dc3723f53d693227595a2f1c3b4507d5e88b/server/cmd/kubescrub/server.go#L37) | string | Namespaces to watch for orphaned resources | "default, kube-system, kube-public" | true, defaults "kybe-system, default" |
| [Resources](https://github.com/cmwylie19/KubeScrub/blob/4ce1dc3723f53d693227595a2f1c3b4507d5e88b/server/cmd/kubescrub/server.go#L39) | string | types of resources to watch | "ConfigMaps, ServiceAccounts, Secrets" | true, defaults to ConfigMaps, ServiceAccounts, Secrets |
| [Theme](https://github.com/cmwylie19/KubeScrub/blob/4ce1dc3723f53d693227595a2f1c3b4507d5e88b/server/cmd/kubescrub/server.go#L38) | string | Dark or light theme for the frontend | "dark", "light" | "dark" (defaults to dark) |## Prereqs
_You need [Kind](https://kind.sigs.k8s.io/) to run this demo_. We will configure the kind cluster to map containerPort 31469 to hostPort 8080, which means we can use port 8080 of our laptop to access 31469 in the cluster. All communication and routing is done through the Kubernetes Ingress. Port 31469 is the nodePort of the `ingress-nginx-controller` service. The operator deploys NGINX Ingress depedencies at install time through a **[Job](https://github.com/cmwylie19/kubescrub-operator/blob/main/config/manager/manager.yaml#L762) and deploys ingress resources at runtime in the reconcile loop.
**The raw manifests for the NGINX Ingress controller are mounted in a [configmap](https://github.com/cmwylie19/kubescrub-operator/blob/main/config/manager/manager.yaml#L108) fromFile. The configmap is mounted as a [volume](https://github.com/cmwylie19/kubescrub-operator/blob/main/config/manager/manager.yaml#L772) in the job. The job does a `kubectl create/apply -f`. This is a prereq to install the `nginx` ingressClass
## Tutorial
_In this tutorial, we will deploy the Kubescrub operator and demonstrate the usage/configurations of the Kubescrub application._
Spin up the kind cluster:
```bash
cat <