Skip to content

Commit

Permalink
Add kubernetes deployment manifests (#31)
Browse files Browse the repository at this point in the history
* Add kubernetes deployment manifests

* Update README.md

* Update README.md

* add a document separator

* Add other definitions

* Make fits its own deployment
  • Loading branch information
joecorall authored Aug 12, 2024
1 parent e9d00cf commit 0293bc7
Show file tree
Hide file tree
Showing 8 changed files with 348 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
44 changes: 44 additions & 0 deletions ci/k8s/coverpage.yaml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions ci/k8s/crayfits.yaml
Original file line number Diff line number Diff line change
@@ -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
49 changes: 49 additions & 0 deletions ci/k8s/fits.yaml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions ci/k8s/homarus.yaml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions ci/k8s/houdini.yaml
Original file line number Diff line number Diff line change
@@ -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
45 changes: 45 additions & 0 deletions ci/k8s/hypercube.yaml
Original file line number Diff line number Diff line change
@@ -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
52 changes: 52 additions & 0 deletions ci/k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0293bc7

Please sign in to comment.