summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-26 23:58:04 +0300
committerPaul Buetow <paul@buetow.org>2025-07-26 23:58:04 +0300
commit4eb23e409a376320a4c00fbf128604cb5f148e09 (patch)
tree437a85ac0cd91ebf036eb9b8eb4fb27992c9d932
parent06ae46c9c522ed66ba4392fe221d93286539a702 (diff)
add apache example
-rw-r--r--f3s/example-apache/Makefile9
-rw-r--r--f3s/example-apache/apache-deployment.yaml21
-rw-r--r--f3s/example-apache/apache-ingress.yaml40
-rw-r--r--f3s/example-apache/apache-service.yaml16
4 files changed, 86 insertions, 0 deletions
diff --git a/f3s/example-apache/Makefile b/f3s/example-apache/Makefile
new file mode 100644
index 0000000..e56e363
--- /dev/null
+++ b/f3s/example-apache/Makefile
@@ -0,0 +1,9 @@
+apply:
+ kubectl apply -f apache-service.yaml
+ kubectl apply -f apache-deployment.yaml
+ kubectl apply -f apache-ingress.yaml
+
+delete:
+ kubectl delete -f apache-ingress.yaml
+ kubectl delete -f apache-service.yaml
+ kubectl delete -f apache-deployment.yaml
diff --git a/f3s/example-apache/apache-deployment.yaml b/f3s/example-apache/apache-deployment.yaml
new file mode 100644
index 0000000..364de1d
--- /dev/null
+++ b/f3s/example-apache/apache-deployment.yaml
@@ -0,0 +1,21 @@
+# Apache HTTP Server Deployment
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: apache-deployment
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: apache
+ template:
+ metadata:
+ labels:
+ app: apache
+ spec:
+ containers:
+ - name: apache
+ image: httpd:latest
+ ports:
+ # Container port where Apache listens
+ - containerPort: 80
diff --git a/f3s/example-apache/apache-ingress.yaml b/f3s/example-apache/apache-ingress.yaml
new file mode 100644
index 0000000..aa575ed
--- /dev/null
+++ b/f3s/example-apache/apache-ingress.yaml
@@ -0,0 +1,40 @@
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: apache-ingress
+ namespace: test
+ annotations:
+ spec.ingressClassName: traefik
+ traefik.ingress.kubernetes.io/router.entrypoints: web
+spec:
+ rules:
+ - host: f3s.buetow.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: apache-service
+ port:
+ number: 80
+ - host: standby.f3s.buetow.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: apache-service
+ port:
+ number: 80
+ - host: www.f3s.buetow.org
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: apache-service
+ port:
+ number: 80
diff --git a/f3s/example-apache/apache-service.yaml b/f3s/example-apache/apache-service.yaml
new file mode 100644
index 0000000..93b24ac
--- /dev/null
+++ b/f3s/example-apache/apache-service.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+ labels:
+ app: apache
+ name: apache-service
+spec:
+ ports:
+ - name: web
+ port: 80
+ protocol: TCP
+ # Expose port 80 on the service
+ targetPort: 80
+ selector:
+ # Link this service to pods with the label app=apache
+ app: apache