Browse Source

added ingress manifest

master
fillkalpa 6 months ago
parent
commit
d522814c5b
4 changed files with 36 additions and 4 deletions
  1. 2
    2
      README.md
  2. 1
    2
      dockerfiles/hugo/Dockerfile
  3. 19
    0
      ingress/ingress-after-dark-tls.yaml
  4. 14
    0
      ingress/ingress-after-dark.yaml

+ 2
- 2
README.md View File

@@ -78,5 +78,5 @@ Grab the port number next to `8080:` and use it to browse to your site using the
* In case you delete your hugo pod or it crashes for other reasons, your site will still be served by the nginx which picks ups the last known built from the output folder mentioned above.
Whenever you delete your hugo pod, K8s scheduler will recreate it from scratch so you will start fresh. You will then need to copy back your stuff.
* If you are running in a multi node cluster (not currenty recommended, unless you have refactored the deployments to use shared [persistent volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)) both hugo and nginx will always be scheduled on the same node to ensure nginx is fed properly.
* The [nodeport](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport) this deployment uses to expose our web server is bound on all worker nodes of your cluster if you have more than one. This means you can reach you site form any node ([k8s service discovery and loadbalancing](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)). In the event you loose the node that actually holds the site your deployment will still be up as it will be rescheduled on an available worker but you will have to restore yours posts.
* Edit the provided ingress manifest in folder x to match your domain name e.g. example.com so that your site is publicly available in a nice URL instead of the nodeport
* The [nodeport](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport) this deployment uses to expose our web server is bound on all worker nodes of your cluster if you have more than one. This means you can reach you site form any node ([k8s service discovery and loadbalancing](https://kubernetes.io/docs/concepts/services-networking/service)). In the event you loose the node that actually holds the site your deployment will still be up as it will be rescheduled on an available worker but you will have to restore yours posts.
* Edit the provided ``ingress-after-dark.yaml`` manifest in folder ``hugo`` to match your domain name e.g. example.com so that your site is publicly available in a nice URL instead of the nodeport

+ 1
- 2
dockerfiles/hugo/Dockerfile View File

@@ -1,8 +1,7 @@
# Use Alpine Linux as our base image so that we minimize the overall size our final container, and minimize the surface area of packages that could be out of date.
FROM alpine:3.9@sha256:b3dbf31b77fd99d9c08f780ce6f5282aba076d70a513a8be859d8d3a4d0c92b8
FROM alpine:latest

LABEL description="Docker container for building static sites with the Hugo static site generator."
LABEL maintainer="Johannes Mitlmeier <dev.jojomi@yahoo.com>"

# config
ENV HUGO_VERSION=0.53

+ 19
- 0
ingress/ingress-after-dark-tls.yaml View File

@@ -0,0 +1,19 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-after-dark
annotations:
kubernetes.io/ingress.class: traefik
traefik.ingress.kubernetes.io/frontend-entry-points: http,https
traefik.ingress.kubernetes.io/redirect-entry-point: https
traefik.ingress.kubernetes.io/redirect-permanent: "true"
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: after-dark-service
servicePort: 8080
tls:
- secretName: example-tls

+ 14
- 0
ingress/ingress-after-dark.yaml View File

@@ -0,0 +1,14 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-after-dark
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: example.com
http:
paths:
- backend:
serviceName: after-dark-service
servicePort: 8080

Loading…
Cancel
Save