-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kubernetes resources for webserver2 including Deployment, Service…
…, Ingress, Namespace, and ClusterIssuer
- Loading branch information
1 parent
beb6823
commit 6fb5cd6
Showing
5 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: webserver2 | ||
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 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
############################ | ||
# @author Elias De Hondt # | ||
# @see https://eliasdh.com # | ||
# @since 24/11/2024 # | ||
############################ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: webserver2-deployment | ||
namespace: webserver2 | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: webserver2 | ||
template: | ||
metadata: | ||
labels: | ||
app: webserver2 | ||
spec: | ||
initContainers: | ||
- name: init-git-clone | ||
image: alpine/git | ||
command: ["sh", "-c", "git clone --depth=1 https://github.com/EliasDH-com/Zizis.com.git /app"] | ||
volumeMounts: | ||
- name: webserver2-volume | ||
mountPath: /app | ||
containers: | ||
- name: webserver2-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: webserver2-volume | ||
mountPath: /app | ||
volumes: | ||
- name: webserver2-volume | ||
emptyDir: {} | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: webserver2 | ||
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: | ||
- zizis.com | ||
secretName: zizis-tls | ||
- hosts: | ||
- www.zizis.com | ||
secretName: wwwzizis-tls | ||
rules: | ||
- host: zizis.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: webserver2-service | ||
port: | ||
number: 80 | ||
- host: www.zizis.com | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: webserver2-service | ||
port: | ||
number: 80 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: webserver2 | ||
labels: | ||
name: webserver2 | ||
app: webserver2 | ||
owner: Zizis | ||
environment: production | ||
annotations: | ||
description: This namespace is used for the webserver2 application. | ||
contact: info@eliasdh.com | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Service | ||
metadata: | ||
name: webserver2-service | ||
namespace: webserver2 | ||
spec: | ||
selector: | ||
app: webserver2 | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 8080 | ||
--- |