Skip to content

Commit

Permalink
Add configurations for webserver003 and webserver004, including deplo…
Browse files Browse the repository at this point in the history
…yments, services, namespaces, and ingress rules
  • Loading branch information
EliasDeHondt committed Jan 13, 2025
1 parent 7ed4114 commit a2b56b7
Show file tree
Hide file tree
Showing 19 changed files with 337 additions and 95 deletions.
6 changes: 6 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
blank_issues_enabled: false # Disable blank issues
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
**/*/Secret.yaml
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
**/*/Secret.yaml
42 changes: 42 additions & 0 deletions Documentation/Setup-Secrets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
![logo](https://eliasdh.com/assets/media/images/logo-github.png)
# 💙🤍Setup Secrets🤍💙

## 📘Table of Contents

1. [📘Table of Contents](#📘table-of-contents)
2. [🖖Introduction](#🖖introduction)
3. [✨Steps](#✨steps)
1. [👉Step 1: Create a GitHub Secrets](#👉step-1-create-a-github-secrets)
2. [👉Step 2: Create a GitHub Secrets](#👉step-2-create-a-github-secrets)
4. [🔗Links](#🔗links)

---

## 🖖Introduction

This document provides a step-by-step guide to setting up `Kubernetes Secrets` on the servers (nodes) in the supercluster. The steps outlined in this document are essential for ensuring the proper functioning of the servers (nodes) and the supercluster.

## ✨Steps

### 👉Step 1: Create a GitHub Secrets

```bash
kubectl create secret docker-registry github-registry \
--docker-server=https://ghcr.io \
--docker-username=<username> \
--docker-password=<access_token>
```

### 👉Step 2: Create a GitHub Secrets

```bash
kubectl create secret docker-registry gitlab-registry \
--docker-server=registry.gitlab.com \
--docker-username=<username> \
--docker-password=<access_token> \
--docker-email=<email>
```

## 🔗Links
- 👯 Web hosting company [EliasDH.com](https://eliasdh.com).
- 📫 How to reach us elias.dehondt@outlook.com
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Please also see following documents:
3. [Setup Kubernetes](Documentation/Setup-Kubernetes.md).
4. [Setup The Proxy Server For The Master Nodes](Documentation/Setup-Proxy.md).
5. [Setup The Clusters For The Supercluster](Documentation/Setup-Clusters.md).
6. [Setup The Kubernetes Secrets](Documentation/Setup-Secrets.md).

- Setup Cluster Infrastructure:
1. [Setup Cert Manager](Documentation/Setup-CertManager.md).
Expand Down
36 changes: 11 additions & 25 deletions Supercluster/Cluster01/WebServer001/Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,16 @@ spec:
labels:
app: webserver001
spec:
initContainers:
- name: init-git-clone
image: alpine/git
command: ["sh", "-c", "git clone --depth=1 https://github.com/EliasDH-com/Eliasdh.com.git /app"]
volumeMounts:
- name: webserver001-volume
mountPath: /app
containers:
- name: webserver001-container
image: python:3.9-slim
command: ["python3", "-m", "http.server", "8080", "--directory", "/app", "--bind", "0.0.0.0"]
ports:
- containerPort: 8080
resources:
limits:
memory: "128Mi"
cpu: "500m"
requests:
memory: "64Mi"
cpu: "250m"
volumeMounts:
- name: webserver001-volume
mountPath: /app
volumes:
- name: webserver001-volume
emptyDir: {}
- name: webserver001-container
image: "ghcr.io/eliasdh-com/eliasdhcom-frontend:latest"
ports:
- containerPort: 8080
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
---
2 changes: 1 addition & 1 deletion Supercluster/Cluster01/WebServer001/Namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
labels:
name: webserver001
app: webserver001
owner: EliasDH
owner: "EliasDH"
environment: production
annotations:
description: This namespace is used for the webserver001 application.
Expand Down
48 changes: 0 additions & 48 deletions Supercluster/Cluster01/WebServer002/Deployment.yaml

This file was deleted.

19 changes: 3 additions & 16 deletions Supercluster/Cluster01/WebServer002/Ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,10 @@ spec:
ingressClassName: nginx
tls:
- hosts:
- zizis.com
secretName: zizis-tls
- hosts:
- www.zizis.com
secretName: wwwzizis-tls
- app.levelup.be
secretName: applevelup-tls
rules:
- host: zizis.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webserver002-service
port:
number: 80
- host: www.zizis.com
- host: app.levelup.be
http:
paths:
- path: /
Expand Down
2 changes: 1 addition & 1 deletion Supercluster/Cluster01/WebServer002/Namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
labels:
name: webserver002
app: webserver002
owner: Zizis
owner: "Ter Eiken Sport"
environment: production
annotations:
description: This namespace is used for the webserver002 application.
Expand Down
22 changes: 22 additions & 0 deletions Supercluster/Cluster01/WebServer003/ClusterIssuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: webserver003
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: elias.dehondt@outlook.com
privateKeySecretRef:
name: letsencrypt-prod-key
solvers:
- http01:
ingress:
class: nginx
---
34 changes: 34 additions & 0 deletions Supercluster/Cluster01/WebServer003/Deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webserver003-deployment
namespace: webserver003
spec:
replicas: 3
selector:
matchLabels:
app: webserver003
template:
metadata:
labels:
app: webserver003
spec:
containers:
- name: webserver003-container
image: "ghcr.io/eliasdh-com/levelupbe-frontend:latest"
ports:
- containerPort: 8080
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
---
47 changes: 47 additions & 0 deletions Supercluster/Cluster01/WebServer003/Ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
namespace: webserver003
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
nginx.ingress.kubernetes.io/ssl-redirect: "true" # Redirect HTTP to HTTPS
spec:
ingressClassName: nginx
tls:
- hosts:
- levelup.be
secretName: levelup-tls
- hosts:
- www.levelup.be
secretName: wwwlevelup-tls
rules:
- host: levelup.be
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webserver003-service
port:
number: 80
- host: www.levelup.be
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: webserver003-service
port:
number: 80
---
19 changes: 19 additions & 0 deletions Supercluster/Cluster01/WebServer003/Namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: v1
kind: Namespace
metadata:
name: webserver003
labels:
name: webserver003
app: webserver003
owner: "Ter Eiken Sport"
environment: production
annotations:
description: This namespace is used for the webserver003 application.
contact: info@eliasdh.com
---
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
apiVersion: v1
kind: Service
metadata:
name: webserver002-service
namespace: webserver002
name: webserver003-service
namespace: webserver003
spec:
selector:
app: webserver002
app: webserver003
ports:
- protocol: TCP
port: 80
Expand Down
22 changes: 22 additions & 0 deletions Supercluster/Cluster01/WebServer004/ClusterIssuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
############################
# @author Elias De Hondt #
# @see https://eliasdh.com #
# @since 24/11/2024 #
############################
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: webserver004
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: elias.dehondt@outlook.com
privateKeySecretRef:
name: letsencrypt-prod-key
solvers:
- http01:
ingress:
class: nginx
---
Loading

0 comments on commit a2b56b7

Please sign in to comment.