-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm charts for Hyrax and FCRepo #4496
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d77014e
create a helm chart for Hyrax
d89e83a
chart: update chart description
9480d3d
set a HYRAX_ENGINE_PATH for dassie in the hyrax-engine-dev image
970d36b
add asset precompilation to dockerfile
4275783
helm: configure the chart to connect to postgres
821fdd5
chart: add an fcrepo chart
66ab98e
dassie: configure hyrax's base path
408a3d4
make fcrepo work with hyrax chart!
748a337
chart: finish initial helm deploys
2da6eea
Need the psql vars on both sides of the or to create fedora db
orangewolf f2c34c8
app runs on port 3000
orangewolf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
ingress: | ||
enabled: true | ||
annotations: {} | ||
hosts: | ||
- host: "staging.dassie.dld.library.ucsb.edu" | ||
paths: ["/"] | ||
tls: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
image: | ||
repository: samveralabs/dassie | ||
pullPolicy: IfNotPresent | ||
tag: "stable" | ||
|
||
ingress: | ||
enabled: true | ||
annotations: {} | ||
hosts: | ||
- host: "dassie.dld.library.ucsb.edu" | ||
paths: ["/"] | ||
tls: [] | ||
|
||
memcached: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
charts/* | ||
Chart.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v2 | ||
name: fcrepo | ||
description: Fedora Commons Repository 4 | ||
type: application | ||
version: 0.4.0 | ||
appVersion: 4.7 | ||
dependencies: | ||
- name: postgresql | ||
version: 9.3.3 | ||
repository: https://charts.bitnami.com/bitnami | ||
condition: postgresql.enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Fedora Commons Helm Chart | ||
========================= | ||
|
||
Fedora is the flexible, modular, open source repository platform with native | ||
linked data support. | ||
|
||
## Installation | ||
|
||
```sh | ||
helm dep up chart/fcrepo | ||
helm install fcrepo chart/fcrepo | ||
``` | ||
|
||
## Configuration | ||
|
||
By default, this chart deploys with Postgresql as the backend for Fedora. | ||
Without other configuration, it will deploy a new Postgresql instance/database | ||
as a service available to the `fcrepo` deployment. | ||
|
||
In practice, users may want to forego installing postgres for two reasons: | ||
|
||
_First_, when you are deploying Fedora into a more complex application | ||
environment you may wish to reuse an existing Postgres instance already | ||
maintained with that environment. | ||
|
||
In this case, `fcrepo` should be deployed with postgresql explictly disabled, an | ||
`exernalDatabaseUsername`, and an `fcrepoSecretName`. `fcrepoSecretName` must | ||
correspond to an existing secret providing `DATABASE_PASSWORD`, `DATABASE_HOST`, | ||
and `JAVA_OPTS`. | ||
|
||
Optionally, a `externalDatabaseName` may be given to avoid collissions in the | ||
case that the default `fcrepo` is not an acceptable database name. | ||
|
||
This is usually done in the context of a parent chart which provides the postgresql instance, for example: | ||
|
||
```yaml | ||
fcrepo: | ||
enabled: true | ||
fcrepoSecretName: "mychart.fcrepo.fullname" | ||
externalDatabaseUsername: "mydbuser" | ||
servicePort: 8080 | ||
postgresql: | ||
enabled: false | ||
``` | ||
|
||
_Second_, because they want to use another backend for Fedora. This use case is broadly unsupported here. In theory, you can get a default (Infinispan) configuration by setting `postgresql.enabled` to `false`. **THIS CONFIGURATION IS UNTESTED AND UNSUPPORTED**: | ||
|
||
```sh | ||
helm install --set postgresql.enabled=false fcrepo-test chart/fcrepo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if .Values.ingress.enabled }} | ||
{{- range $host := .Values.ingress.hosts }} | ||
{{- range .paths }} | ||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- else if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "fcrepo.fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "fcrepo.fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "fcrepo.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
echo http://$SERVICE_IP:{{ .Values.servicePort | default .Values.service.port }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "fcrepo.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:{{ .Values.servicePort | default .Values.service.port }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "fcrepo.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "fcrepo.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "fcrepo.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "fcrepo.labels" -}} | ||
helm.sh/chart: {{ include "fcrepo.chart" . }} | ||
{{ include "fcrepo.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "fcrepo.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "fcrepo.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "fcrepo.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "fcrepo.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- define "fcrepo.postgresql.fullname" -}} | ||
{{- $name := default "postgresql" .Values.postgresql.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "fcrepo.fullname" . }}-env | ||
labels: | ||
app.kubernetes.io/name: {{ include "fcrepo.name" . }} | ||
helm.sh/chart: {{ include "fcrepo.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
data: | ||
{{- if .Values.postgresql.enabled }} | ||
DATABASE_NAME: {{ .Values.postgresql.postgresqlDatabase }} | ||
DATABASE_USER: {{ .Values.postgresql.postgresqlUsername }} | ||
{{- else }} | ||
{{- if .Values.externalDatabaseUsername }} | ||
DATABASE_NAME: {{ .Values.externalDatabaseName | default "fcrepo" }} | ||
DATABASE_USER: {{ .Values.externalDatabaseUsername }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "fcrepo.fullname" . }} | ||
labels: | ||
{{- include "fcrepo.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
{{- include "fcrepo.selectorLabels" . | nindent 6 }} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "fcrepo.selectorLabels" . | nindent 8 }} | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
restartPolicy: Always | ||
serviceAccountName: {{ include "fcrepo.serviceAccountName" . }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: {{ template "fcrepo.fullname" . }} | ||
initContainers: | ||
- name: "remove-lost-found" | ||
image: "busybox:1.32.0" | ||
command: | ||
- rm | ||
- -fr | ||
- /data/lost+found | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
{{- if not .Values.postgresql.enabled }} | ||
{{- if .Values.fcrepoSecretName }} | ||
- name: "init-db" | ||
image: {{ .Values.postgresql.image.repository | default "bitnami/postgresql" }}:{{ .Values.postgresql.image.tag | default "latest" }} | ||
command: | ||
- sh | ||
- -c | ||
- export PGPASSWORD=$DATABASE_PASSWORD PGHOST=$DATABASE_HOST PGUSER=$DATABASE_USER | ||
- psql -tc "SELECT 1 FROM pg_database WHERE datname = '$DATABASE_NAME'" | grep -q 1 || createdb -e -w $DATABASE_NAME | ||
envFrom: | ||
- configMapRef: | ||
name: {{ include "fcrepo.fullname" . }}-env | ||
- secretRef: | ||
name: {{ include .Values.fcrepoSecretName . }} | ||
{{- end }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 12 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
envFrom: | ||
- configMapRef: | ||
name: {{ include "fcrepo.fullname" . }}-env | ||
{{- if .Values.postgresql.enabled }} | ||
- secretRef: | ||
name: {{ template "fcrepo.fullname" . }} | ||
{{- else }} | ||
{{- if .Values.fcrepoSecretName }} | ||
- secretRef: | ||
name: {{ include .Values.fcrepoSecretName . }} | ||
{{- end }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
initialDelaySeconds: {{ default 15 .Values.healthCheck.initialDelay }} | ||
readinessProbe: | ||
httpGet: | ||
path: / | ||
port: http | ||
initialDelaySeconds: {{ default 15 .Values.healthCheck.initialDelay }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can these be set in an
environment
block below?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably. i'm going to suggest we merge and tweak from there.
this is now deploying successfully and i'm keen on being able to work both on improving the chart and on getting some fashion of CD in place.
nurax
's current issues are worrisome since only a few people can work on its infra.