Compare commits
9 Commits
7127914de2
...
95dc0acabd
Author | SHA1 | Date | |
---|---|---|---|
|
95dc0acabd | ||
|
36e2c25f94 | ||
|
1ed41d6c36 | ||
|
a74507cafb | ||
|
4c2f9bc035 | ||
|
63a08f2264 | ||
|
95d4a1e13e | ||
|
9dedfc1690 | ||
|
bed36a7dd2 |
6
molgenis-jenkins/resources/README.md
Normal file
6
molgenis-jenkins/resources/README.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
To be able to run helm inside a jenkins pod, you'll need to
|
||||||
|
* create a role in the namespace where tiller is installed
|
||||||
|
* bind that role to the user that jenkins pods run as
|
||||||
|
|
||||||
|
This directory contains yaml for these resources.
|
||||||
|
See also https://github.com/helm/helm/blob/master/docs/rbac.md
|
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: tiller-jenkins-binding
|
||||||
|
namespace: kube-system
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: tiller-user
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: default
|
||||||
|
namespace: molgenis-jenkins
|
18
molgenis-jenkins/resources/tiller-user-role.yaml
Normal file
18
molgenis-jenkins/resources/tiller-user-role.yaml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: tiller-user
|
||||||
|
namespace: kube-system
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- pods/portforward
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- pods
|
||||||
|
verbs:
|
||||||
|
- list
|
@ -416,6 +416,12 @@ jenkins:
|
|||||||
key: VAULT_ADDR
|
key: VAULT_ADDR
|
||||||
secretName: molgenis-pipeline-vault-secret
|
secretName: molgenis-pipeline-vault-secret
|
||||||
secretKey: addr
|
secretKey: addr
|
||||||
|
helm:
|
||||||
|
Image: "lachlanevenson/k8s-helm"
|
||||||
|
ImageTag: "v2.10.0"
|
||||||
|
Command: cat
|
||||||
|
WorkingDir: /home/jenkins
|
||||||
|
TTY: true
|
||||||
NodeSelector: {}
|
NodeSelector: {}
|
||||||
node:
|
node:
|
||||||
Label: node-carbon
|
Label: node-carbon
|
||||||
@ -447,6 +453,69 @@ jenkins:
|
|||||||
secretName: molgenis-pipeline-vault-secret
|
secretName: molgenis-pipeline-vault-secret
|
||||||
secretKey: addr
|
secretKey: addr
|
||||||
NodeSelector: {}
|
NodeSelector: {}
|
||||||
|
molgenis-it:
|
||||||
|
InheritFrom: molgenis
|
||||||
|
Label: molgenis-it
|
||||||
|
NodeUsageMode: EXCLUSIVE
|
||||||
|
Containers:
|
||||||
|
elasticsearch:
|
||||||
|
Image: docker.elastic.co/elasticsearch/elasticsearch
|
||||||
|
ImageTag: 5.5.3
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "1Gi"
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: "1500Mi"
|
||||||
|
EnvVars:
|
||||||
|
- type: KeyValue
|
||||||
|
key: ES_JAVA_OPTS
|
||||||
|
value: "-Xms512m -Xmx512m"
|
||||||
|
- type: KeyValue
|
||||||
|
key: cluster.name
|
||||||
|
value: molgenis
|
||||||
|
- type: KeyValue
|
||||||
|
key: bootstrap.memory_lock
|
||||||
|
value: "true"
|
||||||
|
- type: KeyValue
|
||||||
|
key: xpack.security.enabled
|
||||||
|
value: "false"
|
||||||
|
- type: KeyValue
|
||||||
|
key: discovery.type
|
||||||
|
value: single-node
|
||||||
|
postgres:
|
||||||
|
Image: postgres
|
||||||
|
ImageTag: 9.6-alpine
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "250Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: "250Mi"
|
||||||
|
EnvVars:
|
||||||
|
- type: KeyValue
|
||||||
|
key: POSTGRES_USER
|
||||||
|
value: molgenis
|
||||||
|
- type: KeyValue
|
||||||
|
key: POSTGRES_PASSWORD
|
||||||
|
value: molgenis
|
||||||
|
- type: KeyValue
|
||||||
|
key: POSTGRES_DB
|
||||||
|
value: molgenis
|
||||||
|
opencpu:
|
||||||
|
Image: molgenis/opencpu
|
||||||
|
AlwaysPullImage: true
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: "100m"
|
||||||
|
memory: "256Mi"
|
||||||
|
limits:
|
||||||
|
cpu: "1"
|
||||||
|
memory: "512Mi"
|
||||||
|
NodeSelector: {}
|
||||||
|
|
||||||
#secret contains configuration for the kubernetes secrets that jenkins can access
|
#secret contains configuration for the kubernetes secrets that jenkins can access
|
||||||
secret:
|
secret:
|
||||||
# vault configures the vault secret
|
# vault configures the vault secret
|
||||||
|
21
molgenis-opencpu/.helmignore
Normal file
21
molgenis-opencpu/.helmignore
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# 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
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
8
molgenis-opencpu/Chart.yaml
Normal file
8
molgenis-opencpu/Chart.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
appVersion: "1.0"
|
||||||
|
description: Opencpu stack for MOLGENIS
|
||||||
|
name: molgenis-opencpu
|
||||||
|
version: 0.1.1
|
||||||
|
sources:
|
||||||
|
- https://git.webhosting.rug.nl/molgenis/molgenis-ops-docker-helm.git
|
||||||
|
icon: https://git.webhosting.rug.nl/molgenis/molgenis-ops-docker-helm/raw/master/molgenis-opencpu/catalogIcon-molgenis-opencpu.svg
|
38
molgenis-opencpu/README.md
Normal file
38
molgenis-opencpu/README.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# MOLGENIS - OpenCPU Helm Chart
|
||||||
|
|
||||||
|
NEXUS repository for kubernetes to deploy on a kubernetes cluster with NFS-share
|
||||||
|
|
||||||
|
## Containers
|
||||||
|
|
||||||
|
This chart will deploy the following containers:
|
||||||
|
|
||||||
|
- OpenCPU
|
||||||
|
- MOLGENIS-httpd (to proxy the registry and docker to one domain)
|
||||||
|
|
||||||
|
## Provisioning
|
||||||
|
You can choose for the OpenCPU image from which repository you want to pull. Experimental builds are pushed to registry.molgenis.org and the stable builds to hub.docker.com.
|
||||||
|
You need to fill out 2 properties to determine which repository you are going to use.
|
||||||
|
|
||||||
|
- ```opencpu.image.repository```
|
||||||
|
- ```opencpu.image.tag```
|
||||||
|
|
||||||
|
You can do this in the questions in Rancher or in the ```values.yaml```.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Development
|
||||||
|
You can test in install the chart by executing:
|
||||||
|
|
||||||
|
```helm lint .```
|
||||||
|
|
||||||
|
To test if your helm chart-syntax is right and:
|
||||||
|
|
||||||
|
```helm install . --dry-run --debug```
|
||||||
|
|
||||||
|
To test if your hem chart works and:
|
||||||
|
|
||||||
|
```helm install .```
|
||||||
|
|
||||||
|
To deploy it on the cluster.
|
||||||
|
|
||||||
|
|
1
molgenis-opencpu/catalog-molgenis-opencpu.svg
Normal file
1
molgenis-opencpu/catalog-molgenis-opencpu.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 245 KiB |
28
molgenis-opencpu/questions.yml
Normal file
28
molgenis-opencpu/questions.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
categories:
|
||||||
|
- MOLGENIS
|
||||||
|
questions:
|
||||||
|
- variable: ingress.enabled
|
||||||
|
label: Enable ingress
|
||||||
|
default: false
|
||||||
|
description: "Enable ingress"
|
||||||
|
type: boolean
|
||||||
|
required: true
|
||||||
|
group: "Loadbalancing"
|
||||||
|
- variable: opencpu.image.repository
|
||||||
|
label: Registry
|
||||||
|
default: "registry.hub.docker.com"
|
||||||
|
description: "Select a registry to pull from"
|
||||||
|
type: enum
|
||||||
|
options:
|
||||||
|
- "registry.hub.docker.com"
|
||||||
|
- "registry.molgenis.org"
|
||||||
|
required: true
|
||||||
|
group: "Provisioning"
|
||||||
|
- variable: opencpu.image.tag
|
||||||
|
label: Version
|
||||||
|
default: ""
|
||||||
|
description: "Select a OpenCPU version (check the registry.molgenis.org or hub.docker.com for released tags)"
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
group: "Provisioning"
|
32
molgenis-opencpu/templates/_helpers.tpl
Normal file
32
molgenis-opencpu/templates/_helpers.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "opencpu.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 "opencpu.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 "opencpu.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
35
molgenis-opencpu/templates/deployment.yaml
Normal file
35
molgenis-opencpu/templates/deployment.yaml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml . | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
name: {{ template "opencpu.fullname" . }}
|
||||||
|
labels:
|
||||||
|
app: {{ template "opencpu.name" . }}
|
||||||
|
chart: {{ template "opencpu.chart" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ template "opencpu.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ template "opencpu.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
{{- with .Values.opencpu }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
image: "{{ .image.repository }}/{{ .image.name }}:{{ .image.tag }}"
|
||||||
|
imagePullPolicy: {{ .image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .service.port }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
|
36
molgenis-opencpu/templates/ingress.yaml
Normal file
36
molgenis-opencpu/templates/ingress.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{{- if .Values.ingress.enabled }}
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: "{{ $.Release.Name }}-ingress"
|
||||||
|
labels:
|
||||||
|
app: {{ $.Values.opencpu.name }}
|
||||||
|
chart: "{{ $.Chart.Name }}-{{ $.Chart.Version }}"
|
||||||
|
release: "{{ $.Release.Name }}"
|
||||||
|
heritage: "{{ $.Release.Service }}"
|
||||||
|
annotations:
|
||||||
|
{{- if .tls }}
|
||||||
|
ingress.kubernetes.io/secure-backends: "true"
|
||||||
|
{{- end }}
|
||||||
|
{{- range $key, $value := .annotations }}
|
||||||
|
{{ $key }}: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: {{ .name }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: {{ default "/" .path }}
|
||||||
|
backend:
|
||||||
|
serviceName: {{ $.Values.opencpu.service.name }}
|
||||||
|
servicePort: {{ $.Values.opencpu.service.port }}
|
||||||
|
{{- if .tls }}
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .name }}
|
||||||
|
secretName: {{ .tlsSecret }}
|
||||||
|
{{- end }}
|
||||||
|
---
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
20
molgenis-opencpu/templates/service.yaml
Normal file
20
molgenis-opencpu/templates/service.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Values.opencpu.service.name }}
|
||||||
|
labels:
|
||||||
|
app: {{ .Values.opencpu.service.name }}
|
||||||
|
release: {{ .Release.Name }}
|
||||||
|
heritage: {{ .Release.Service }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.opencpu.service.type }}
|
||||||
|
loadBalancerSourceRanges:
|
||||||
|
{{- range $index, $rule := .Values.opencpu.service.firewall }}
|
||||||
|
- {{ $rule }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.opencpu.service.name }}
|
||||||
|
port: {{ .Values.opencpu.service.port }}
|
||||||
|
selector:
|
||||||
|
app: {{ template "opencpu.name" . }}
|
||||||
|
release: {{ .Release.Name }}
|
41
molgenis-opencpu/values.yaml
Normal file
41
molgenis-opencpu/values.yaml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
# Default values for nexus.
|
||||||
|
# This is a YAML-formatted file.
|
||||||
|
# Declare variables to be passed into your templates.
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
environment: production
|
||||||
|
|
||||||
|
opencpu:
|
||||||
|
name: opencpu
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
restartPolicy: Always
|
||||||
|
image:
|
||||||
|
repository: registry.hub.docker.com
|
||||||
|
name: molgenis/opencpu
|
||||||
|
tag: stable
|
||||||
|
pullPolicy: Always
|
||||||
|
service:
|
||||||
|
name: opencpu
|
||||||
|
type: LoadBalancer
|
||||||
|
port: 8004
|
||||||
|
firewall:
|
||||||
|
- 145.100.224.1/24
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
annotations: {
|
||||||
|
kubernetes.io/ingress.class: "nginx",
|
||||||
|
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
||||||
|
}
|
||||||
|
path: /
|
||||||
|
hosts:
|
||||||
|
- name: opencpu.molgenis.org
|
||||||
|
tls: []
|
||||||
|
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
affinity: {}
|
Loading…
x
Reference in New Issue
Block a user