Skip to content

Commit

Permalink
Merge pull request #73 from ufosc/feature/k8s
Browse files Browse the repository at this point in the history
Feature/k8s
  • Loading branch information
IkeHunter authored Nov 17, 2024
2 parents 6902c20 + 8020652 commit e04b7cc
Show file tree
Hide file tree
Showing 142 changed files with 19,293 additions and 1 deletion.
61 changes: 61 additions & 0 deletions k8s/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Kubernetes Config

## Running Locally

### Initial Setup

1. Install docker ([install](Docker, Docker Compose ([install](https://docs.docker.com/compose/install/))))
2. Install kubectl ([install](https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/))
3. Install minikube ([install](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Farm64%2Fstable%2Fbinary+download))

### Running cluster

1. In root project directory, navigate to the `k8s` directory:

```sh
cd k8s
```

2. Start Minikube:

```sh
minikube start
```

3. Apply the cluster:

```sh
kubectl apply -f .
```

4. Optionally, start up the minikube dashboard:

```sh
minikube dashboard
```

### Accessing Cluster

The general way to access a nodeport is via the following command:

```sh
kubectl port-forward svc/service-name host-port:service-port --namespace namespace
```

Running this command will start a long-running process in that terminal tab. You would start a new terminal instance for each port you forward.

#### Forwarding Base Routes

Run this command to open up the base 8080 port onto 30080 on your local machine:

```sh
kubectl port-forward svc/proxy 30080:8080 --namespace main
```

#### Forwarding Club Manager Admin

Use this command to forward the port 8081, used for the club manager site/admin, onto 30081 of your local machine:

```sh
kubectl port-forward svc/proxy 30081:8081 --namespace main
```
41 changes: 41 additions & 0 deletions k8s/charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Local Helm Charts

## Commands

Add new repo:

```sh
helm repo add new-repo-name https://repo-uri.example.com/new-repo-name
```

Pull new chart:

```sh
helm pull repo-name/chart-name --untar
```

Install chart:

```sh
helm install chart-name repo-name/chart-name
```

Then move the new chart into the charts directory.

## Charts

### PostgreSQL

- **Namespace**: `postgres`
- **Chart**: postgresql
- **Repo**: bitnami
- **Repo URI**: oci://registry-1.docker.io/bitnamicharts
- **Docs**: <https://artifacthub.io/packages/helm/bitnami/postgresql>

### Redis

- **Namespace**: `redis`
- **Chart**: redis
- **Repo**: bitnami
- **Repo URI**: oci://registry-1.docker.io/bitnamicharts
- **Docs**: <https://artifacthub.io/packages/helm/bitnami/redis>
6 changes: 6 additions & 0 deletions k8s/charts/postgresql-values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
global:
postgresql:
auth:
username: testuser
password: testpass
database: testdb
25 changes: 25 additions & 0 deletions k8s/charts/postgresql/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
# img folder
img/
# Changelog
CHANGELOG.md
6 changes: 6 additions & 0 deletions k8s/charts/postgresql/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.20.3
digest: sha256:569e1c9d81abdcad3891e065c0f23c83786527d2043f2bc68193c43d18886c19
generated: "2024-06-18T12:01:32.074984263Z"
37 changes: 37 additions & 0 deletions k8s/charts/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
annotations:
category: Database
images: |
- name: os-shell
image: docker.io/bitnami/os-shell:12-debian-12-r22
- name: postgres-exporter
image: docker.io/bitnami/postgres-exporter:0.15.0-debian-12-r33
- name: postgresql
image: docker.io/bitnami/postgresql:16.3.0-debian-12-r16
licenses: Apache-2.0
apiVersion: v2
appVersion: 16.3.0
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
tags:
- bitnami-common
version: 2.x.x
description: PostgreSQL (Postgres) is an open source object-relational database known
for reliability and data integrity. ACID-compliant, it supports foreign keys, joins,
views, triggers and stored procedures.
home: https://bitnami.com
icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-220x234.png
keywords:
- postgresql
- postgres
- database
- sql
- replication
- cluster
maintainers:
- name: Broadcom, Inc. All Rights Reserved.
url: https://github.com/bitnami/charts
name: postgresql
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
version: 15.5.11
Loading

0 comments on commit e04b7cc

Please sign in to comment.