From 4eb23e409a376320a4c00fbf128604cb5f148e09 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 26 Jul 2025 23:58:04 +0300 Subject: add apache example --- f3s/example-apache/Makefile | 9 +++++++ f3s/example-apache/apache-deployment.yaml | 21 ++++++++++++++++ f3s/example-apache/apache-ingress.yaml | 40 +++++++++++++++++++++++++++++++ f3s/example-apache/apache-service.yaml | 16 +++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 f3s/example-apache/Makefile create mode 100644 f3s/example-apache/apache-deployment.yaml create mode 100644 f3s/example-apache/apache-ingress.yaml create mode 100644 f3s/example-apache/apache-service.yaml 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 -- cgit v1.2.3