Skip to content
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

Add basic Kubernetes installation documentation #220

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
kind: ConfigMap
apiVersion: v1
metadata:
name: tower-backend-cfg
labels:
app: backend-cfg
data:
TOWER_ENABLE_UNSAFE_MODE: "true"
TOWER_ROOT_USERS: "<root_users>"
TOWER_SERVER_URL: "http://localhost:8080"
TOWER_CONTACT_EMAIL: "[email protected]"
TOWER_JWT_SECRET: "<jwt_secret>"
TOWER_DB_URL: jdbc:mysql://mysql:3306/tower?permitMysqlScheme=true
TOWER_DB_DRIVER: "org.mariadb.jdbc.Driver"
TOWER_DB_USER: "tower"
TOWER_DB_PASSWORD: "tower"
TOWER_DB_DIALECT: "io.seqera.util.MySQL55DialectCollateBin"
TOWER_DB_MIN_POOL_SIZE: "2"
TOWER_DB_MAX_POOL_SIZE: "10"
TOWER_DB_MAX_LIFETIME: "180000"
TOWER_SMTP_HOST: "mailcatcher"
TOWER_SMTP_USER: ""
TOWER_SMTP_PASSWORD: ""
TOWER_CRYPTO_SECRETKEY: "<crypt_secret>"
TOWER_LICENSE: "<license>"
TOWER_ENABLE_PLATFORMS: "local-platform"
FLYWAY_LOCATIONS: "classpath:db-schema/mysql"
TOWER_REDIS_URL: "redis://redis:6379"
---
kind: ConfigMap
apiVersion: v1
metadata:
name: tower-yml
labels:
app: backend-cfg
data:
tower.yml: |
mail:
smtp:
auth: false
# FIXME `starttls` should be enabled with a production SMTP host
starttls:
enable: false
required: false
ssl:
protocols: "TLSv1.2"

auth:
mail:
duration: 30m

# Set a custom application name for the Micronaut environment to deploy multiple instances from the same Enterprise account
# Required for AWS Parameter Store configuration. For more information, see https://docs.seqera.io/platform/latest/enterprise/configuration/aws_parameter_store
micronaut:
application:
name: tower-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
apiVersion: v1
kind: Pod
metadata:
name: mailcatcher
labels:
app: mailcatcher
spec:
containers:
- name: mailcatcher
image: sj26/mailcatcher
ports:
- containerPort: 1025
- containerPort: 1080
---
apiVersion: v1
kind: Service
metadata:
name: mailcatcher
spec:
selector:
app: mailcatcher
ports:
- name: smtp
protocol: TCP
port: 587
targetPort: 1025
- name: http
protocol: TCP
port: 1080
targetPort: 1080
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: hostpath
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
spec:
serviceName: mysql
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:8.0
ports:
- containerPort: 3306
env:
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "yes"
- name: MYSQL_USER
value: "tower"
- name: MYSQL_PASSWORD
value: "tower"
- name: MYSQL_DATABASE
value: "tower"
volumeMounts:
- name: mysql-storage
mountPath: /var/lib/mysql
readinessProbe:
exec:
command:
- mysqladmin
- ping
- -h
- localhost
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 20
failureThreshold: 10
volumes:
- name: mysql-storage
persistentVolumeClaim:
claimName: mysql-pvc
---
apiVersion: v1
kind: Service
metadata:
name: mysql
labels:
app: mysql
spec:
clusterIP: None
ports:
- port: 3306
selector:
app: mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-data
labels:
app: redis
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: <storage_class>
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
labels:
app: redis
spec:
selector:
matchLabels:
app: redis
serviceName: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- image: cr.seqera.io/public/redis:6.0
name: redis
args:
- --appendonly yes
ports:
- containerPort: 6379
volumeMounts:
- mountPath: "/data"
name: "vol-data"
volumes:
- name: vol-data
persistentVolumeClaim:
claimName: redis-data
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: redis
labels:
app: redis
spec:
ports:
- port: 6379
targetPort: 6379
selector:
app: redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cron
labels:
app: cron
spec:
selector:
matchLabels:
app: cron
template:
metadata:
labels:
app: cron
spec:
imagePullSecrets:
- name: cr.seqera.io
volumes:
- name: config-volume
configMap:
name: tower-yml
initContainers:
- name: migrate-db
image: cr.seqera.io/private/nf-tower-enterprise/migrate-db:v24.1.3
command: ["sh", "-c", "/migrate-db.sh"]
envFrom:
- configMapRef:
name: tower-backend-cfg
volumeMounts:
- name: config-volume
mountPath: /tower.yml
subPath: tower.yml
containers:
- name: backend
image: cr.seqera.io/private/nf-tower-enterprise/backend:v24.1.4
envFrom:
- configMapRef:
name: tower-backend-cfg
volumeMounts:
- name: config-volume
mountPath: /tower.yml
subPath: tower.yml
env:
- name: MICRONAUT_ENVIRONMENTS
value: "prod,redis,cron"
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 3
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
timeoutSeconds: 3
failureThreshold: 10
Loading
Loading