Skip to content

Commit

Permalink
chore: housekeeping
Browse files Browse the repository at this point in the history
Signed-off-by: Devin Buhl <[email protected]>
  • Loading branch information
onedr0p committed Feb 16, 2024
1 parent 91386e6 commit a0d9b5d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/upgrade-talos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,15 @@ jobs:
KUBECONFIG: "${{ steps.kubeconfig.outputs.filePath }}"
run: kubectl cnpg --context ${{ github.event.inputs.kubeClusterName }} -n database status ${{ github.event.inputs.pgClusterName }}

- if: ${{ github.event.inputs.pgMaintenanceMode == 'true' }}
name: Merge Talos Upgrade PR
- name: Upgrade Talos
shell: bash
env:
GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}"
run: gh pr merge ${{ github.event.inputs.talosPullRequestNumber }} --squash

- name: Change CNPG Maintenance Mode
shell: bash
env:
KUBECONFIG: "${{ steps.kubeconfig.outputs.filePath }}"
run: |
if [ "${{ github.event.inputs.pgMaintenanceMode }}" == "true" ]; then
kubectl cnpg --context ${{ github.event.inputs.kubeClusterName }} maintenance set --reusePVC --all-namespaces
gh pr merge ${{ github.event.inputs.talosPullRequestNumber }} --squash
else
kubectl cnpg --context ${{ github.event.inputs.kubeClusterName }} maintenance unset --reusePVC --all-namespaces
fi
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ My Kubernetes cluster is deploy with [Talos](https://www.talos.dev). This is a s

### Core Components

- [actions-runner-controller](https://github.com/actions/actions-runner-controller): self-hosted Github runners
- [cilium](https://github.com/cilium/cilium): internal Kubernetes networking plugin
- [cert-manager](https://cert-manager.io/docs/): creates SSL certificates for services in my cluster
- [external-dns](https://github.com/kubernetes-sigs/external-dns): automatically syncs DNS records from my cluster ingresses to a DNS provider
- [external-secrets](https://github.com/external-secrets/external-secrets/): managed Kubernetes secrets using [1Password Connect](https://github.com/1Password/connect).
- [ingress-nginx](https://github.com/kubernetes/ingress-nginx/): ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer
- [rook](https://github.com/rook/rook): distributed block storage for persistent storage
- [sops](https://toolkit.fluxcd.io/guides/mozilla-sops/): managed secrets for Kubernetes, Ansible, and Terraform which are committed to Git
- [spegel](https://github.com/XenitAB/spegel): stateless cluster local OCI registry mirror
- [tf-controller](https://github.com/weaveworks/tf-controller): additional Flux component used to run Terraform from within a Kubernetes cluster.
- [volsync](https://github.com/backube/volsync): backup and recovery of persistent volume claims
- [actions-runner-controller](https://github.com/actions/actions-runner-controller): Self-hosted Github runners.
- [cert-manager](https://github.com/cert-manager/cert-manager): Creates SSL certificates for services in my cluster.
- [cilium](https://github.com/cilium/cilium): Internal Kubernetes container networking interface.
- [cloudflared](https://github.com/cloudflare/cloudflared): Enables Cloudflare secure access to certain ingresses.
- [external-dns](https://github.com/kubernetes-sigs/external-dns): Automatically syncs ingress DNS records to a DNS provider.
- [external-secrets](https://github.com/external-secrets/external-secrets): Managed Kubernetes secrets using [1Password Connect](https://github.com/1Password/connect).
- [ingress-nginx](https://github.com/kubernetes/ingress-nginx): Kubernetes ingress controller using NGINX as a reverse proxy and load balancer.
- [rook](https://github.com/rook/rook): Distributed block storage for peristent storage.
- [sops](https://github.com/getsops/sops): Managed secrets for Kubernetes and Terraform which are commited to Git.
- [spegel](https://github.com/XenitAB/spegel): Stateless cluster local OCI registry mirror.
- [tf-controller](https://github.com/weaveworks/tf-controller): Additional Flux component used to run Terraform from within a Kubernetes cluster.
- [volsync](https://github.com/backube/volsync): Backup and recovery of persistent volume claims.

### GitOps

Expand Down Expand Up @@ -195,15 +196,3 @@ Outside the `external-dns` instance mentioned above another instance is deployed
## 🤝 Gratitude and Thanks

Thanks to all the people who donate their time to the [Home Operations](https://discord.gg/home-operations) Discord community. Be sure to check out [kubesearch.dev](https://kubesearch.dev/) for ideas on how to deploy applications or get ideas on what you may deploy.

---

## 📜 Changelog

See my _awful_ [commit history](https://github.com/onedr0p/home-ops/commits/main)

---

## 🔏 License

See [LICENSE](./LICENSE)
16 changes: 10 additions & 6 deletions kubernetes/main/apps/default/kromgo/app/resources/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,25 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kashalls/kromgo/main/config.schema.json
metrics:
- name: cluster_node_count
query: count(count by (node) (kube_node_status_condition{kubernetes_node=~"k8s-[0-9]+", condition="Ready"}))
query: count(count by (node) (kube_node_status_condition{kubernetes_node=~"k8s-[0-9]", condition="Ready"}))
colors:
- { color: "green", min: 0, max: 9999 }

- name: cluster_pod_count
query: sum(kube_pod_status_phase{kubernetes_node=~"k8s-[0-9]+", phase="Running"})
query: sum(kube_pod_status_phase{kubernetes_node=~"k8s-[0-9]", phase="Running"})
colors:
- { color: "green", min: 0, max: 9999 }

- name: cluster_cpu_usage
query: round(avg(instance:node_cpu_utilisation:rate5m{kubernetes_node=~"k8s-[0-9]+"}) * 100, 0.1)
query: round(avg(instance:node_cpu_utilisation:rate5m{kubernetes_node=~"k8s-[0-9]"}) * 100, 0.1)
suffix: "%"
colors:
- { color: "green", min: 0, max: 35 }
- { color: "orange", min: 36, max: 75 }
- { color: "red", min: 76, max: 9999 }

- name: cluster_memory_usage
query: round(sum(node_memory_MemTotal_bytes{kubernetes_node=~"k8s-[0-9]+"} - node_memory_MemAvailable_bytes{kubernetes_node=~"k8s-[0-9]+"}) / sum(node_memory_MemTotal_bytes{kubernetes_node=~"k8s-[0-9]+"}) * 100, 0.1)
query: round(sum(node_memory_MemTotal_bytes{kubernetes_node=~"k8s-[0-9]"} - node_memory_MemAvailable_bytes{kubernetes_node=~"k8s-[0-9]"}) / sum(node_memory_MemTotal_bytes{kubernetes_node=~"k8s-[0-9]"}) * 100, 0.1)
suffix: "%"
colors:
- { color: green, min: 0, max: 35 }
Expand All @@ -32,15 +36,15 @@ metrics:
- { color: "red", min: 751, max: 9999 }

- name: cluster_age_days
query: round((time() - min(kube_node_created{kubernetes_node=~"k8s-[0-9]+"}) ) / 86400)
query: round((time() - min(kube_node_created{kubernetes_node=~"k8s-[0-9]"}) ) / 86400)
suffix: "d"
colors:
- { color: "green", min: 0, max: 180 }
- { color: "orange", min: 181, max: 360 }
- { color: "red", min: 361, max: 9999 }

- name: cluster_uptime_days
query: round(avg(node_time_seconds{kubernetes_node=~"k8s-[0-9]+"} - node_boot_time_seconds{kubernetes_node=~"k8s-[0-9]+"}) / 86400)
query: round(avg(node_time_seconds{kubernetes_node=~"k8s-[0-9]"} - node_boot_time_seconds{kubernetes_node=~"k8s-[0-9]"}) / 86400)
suffix: "d"
colors:
- { color: "green", min: 0, max: 180 }
Expand Down

0 comments on commit a0d9b5d

Please sign in to comment.