diff options
Diffstat (limited to 'f3s/example-apache')
| -rw-r--r-- | f3s/example-apache/Makefile | 9 | ||||
| -rw-r--r-- | f3s/example-apache/apache-deployment.yaml | 21 | ||||
| -rw-r--r-- | f3s/example-apache/apache-ingress.yaml | 40 | ||||
| -rw-r--r-- | f3s/example-apache/apache-service.yaml | 16 |
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 |
