diff --git a/README.md b/README.md index 10aeee2..03d53ff 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,31 @@ Update your [ISLE docker-compose.yml](https://github.com/Islandora-Devops/isle-s <<: [*prod, *fits] ``` +#### Kubernetes deployment + +The demo kubernetes manifests in this repo uses the `ingress-nginx` controller to route requests from a single domain to the proper microservice. + +##### Create a the TLS secret + +``` +kubectl create secret tls CHANGE-ME --key key.pem --cert cert.pem +``` + +#### Apply the kubernetes manifests + +Now you can apply your kube manifests, being sure to replace `__DOMAIN__` and `__DOCKER_REPOSITORY__` with the proper valuyes + +``` +DOMAIN=CHANGE-ME.bar.com +DOCKER_REPOSITORY=CHANGE-ME.docker.io +KUBE_TLS_SECRET=CHANGE-ME +sed -e "s|__DOMAIN__|$DOMAIN|" \ + -e "s|__DOCKER_REPOSITORY__|$DOCKER_REPOSITORY|" \ + -e "s|__KUBE_TLS_SECRET__|$KUBE_TLS_SECRET|" \ + *.yaml \ +| kubectl apply -f - +``` + ### Configure alpaca and Drupal Until we define a subscription spec for Islandora Events in this repo, you'll also need to: diff --git a/ci/k8s/coverpage.yaml b/ci/k8s/coverpage.yaml new file mode 100644 index 0000000..27a59c2 --- /dev/null +++ b/ci/k8s/coverpage.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: islandora-coverpage +spec: + selector: + app: islandora-coverpage + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: islandora-coverpage +spec: + replicas: 3 + selector: + matchLabels: + app: islandora-coverpage + template: + metadata: + labels: + app: islandora-coverpage + spec: + containers: + - name: scyllaridae-coverpage + image: __DOCKER_REPOSITORY__/scyllaridae-coverpage:main + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "128Mi" + cpu: "250m" + limits: + memory: "512Mi" + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthcheck + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/crayfits.yaml b/ci/k8s/crayfits.yaml new file mode 100644 index 0000000..fb4bacd --- /dev/null +++ b/ci/k8s/crayfits.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: islandora-crayfits +spec: + selector: + app: islandora-crayfits + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: islandora-crayfits +spec: + replicas: 3 + selector: + matchLabels: + app: islandora-crayfits + template: + metadata: + labels: + app: islandora-crayfits + spec: + containers: + - name: scyllaridae-crayfits + image: __DOCKER_REPOSITORY__/scyllaridae-fits:main + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "32Mi" + cpu: "100m" + limits: + memory: "128Mi" + ports: + - containerPort: 8080 + hostPort: 8080 + readinessProbe: + httpGet: + path: /healthcheck + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/fits.yaml b/ci/k8s/fits.yaml new file mode 100644 index 0000000..50dd273 --- /dev/null +++ b/ci/k8s/fits.yaml @@ -0,0 +1,49 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: fits +spec: + selector: + app: fits + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fits +spec: + replicas: 3 + selector: + matchLabels: + app: fits + template: + metadata: + labels: + app: fits + spec: + containers: + - name: fits + image: islandora/fits:3.3.0 + imagePullPolicy: IfNotPresent + env: + - name: FITS_MAX_REQUEST_SIZE + value: "100000" + - name: FITS_MAX_UPLOAD_FILE_SIZE + value: "100000" + resources: + requests: + memory: "256Mi" + cpu: "250m" + limits: + memory: "2Gi" + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /fits/version + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/homarus.yaml b/ci/k8s/homarus.yaml new file mode 100644 index 0000000..133adbf --- /dev/null +++ b/ci/k8s/homarus.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: islandora-ffmpeg +spec: + selector: + app: islandora-ffmpeg + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: islandora-ffmpeg +spec: + replicas: 3 + selector: + matchLabels: + app: islandora-ffmpeg + template: + metadata: + labels: + app: islandora-ffmpeg + spec: + containers: + - name: scyllaridae-ffmpeg + image: __DOCKER_REPOSITORY__/scyllaridae-ffmpeg:main + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "128Mi" + cpu: "500m" + limits: + memory: "4Gi" + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthcheck + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/houdini.yaml b/ci/k8s/houdini.yaml new file mode 100644 index 0000000..134a44c --- /dev/null +++ b/ci/k8s/houdini.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: islandora-imagemagick +spec: + selector: + app: islandora-imagemagick + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: islandora-imagemagick +spec: + replicas: 3 + selector: + matchLabels: + app: islandora-imagemagick + template: + metadata: + labels: + app: islandora-imagemagick + spec: + containers: + - name: scyllaridae-imagemagick + image: __DOCKER_REPOSITORY__/scyllaridae-imagemagick:main + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1Gi" + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthcheck + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/hypercube.yaml b/ci/k8s/hypercube.yaml new file mode 100644 index 0000000..ef26282 --- /dev/null +++ b/ci/k8s/hypercube.yaml @@ -0,0 +1,45 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: islandora-tesseract +spec: + selector: + app: islandora-tesseract + ports: + - protocol: TCP + port: 8080 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: islandora-tesseract + +spec: + replicas: 3 + selector: + matchLabels: + app: islandora-tesseract + template: + metadata: + labels: + app: islandora-tesseract + spec: + containers: + - name: scyllaridae-tesseract + image: __DOCKER_REPOSITORY__/scyllaridae-tesseract:main + imagePullPolicy: IfNotPresent + resources: + requests: + memory: "128Mi" + cpu: "250m" + limits: + memory: "2Gi" + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthcheck + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 10 diff --git a/ci/k8s/ingress.yaml b/ci/k8s/ingress.yaml new file mode 100644 index 0000000..c863fc1 --- /dev/null +++ b/ci/k8s/ingress.yaml @@ -0,0 +1,52 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: islandora-microservices + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$2 +spec: + tls: + - hosts: + - __DOMAIN__ + secretName: __KUBE_TLS_SECRET__ + ingressClassName: nginx + rules: + - host: __DOMAIN__ + http: + paths: + - path: /coverpage(/|$)(.*) + pathType: Prefix + backend: + service: + name: islandora-coverpage + port: + number: 8080 + - path: /crayfits(/|$)(.*) + pathType: Prefix + backend: + service: + name: islandora-crayfits + port: + number: 8080 + - path: /homarus(/|$)(.*) + pathType: Prefix + backend: + service: + name: islandora-ffmpeg + port: + number: 8080 + - path: /houdini(/|$)(.*) + pathType: Prefix + backend: + service: + name: islandora-imagemagick + port: + number: 8080 + - path: /hypercube(/|$)(.*) + pathType: Prefix + backend: + service: + name: islandora-tesseract + port: + number: 8080