Your Onyxia instance, today
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/aws/deploy.yamlkubectl get services -n ingress-nginxonyxia.my-domain.net CNAME xxx.elb.eu-west-1.amazonaws.com.
*.lab.my-domain.net CNAME xxx.elb.eu-west-1.amazonaws.com. brew install certbot #On Mac, lookup how to install certbot for your OS
#Because we need a wildcard certificate we have to complete the DNS callange.
sudo certbot certonly --manual --preferred-challenges dns
# When asked for the domains you wish to optains a certificate for enter:
# onyxia.my-domain.net *.lab.my-domain.netDOMAIN=my-domain.net
sudo kubectl create secret tls onyxia-tls \
-n ingress-nginx \
--key /etc/letsencrypt/live/onyxia.$DOMAIN/privkey.pem \
--cert /etc/letsencrypt/live/onyxia.$DOMAIN/fullchain.pemkubectl edit deployment ingress-nginx-controller -n ingress-nginx - --default-ssl-certificate=ingress-nginx/onyxia-tlshelm repo add onyxia https://inseefrlab.github.io/onyxia
DOMAIN=my-domain.net
cat << EOF > ./onyxia-values.yaml
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: onyxia.$DOMAIN
api:
regions:
[
{
"id":"demo",
"name":"Demo",
"description":"This is a demo region, feel free to try Onyxia !",
"services":{
"type":"KUBERNETES",
"singleNamespace":true,
"namespacePrefix":"user-",
"usernamePrefix":"oidc-",
"groupNamespacePrefix":"projet-",
"groupPrefix":"oidc-",
"authenticationMode":"serviceAccount",
"expose":{
"domain":"lab.$DOMAIN"
},
"monitoring":{
"URLPattern":"todo"
},
"initScript":"https://inseefrlab.github.io/onyxia/onyxia-init.sh"
}
}
]
EOF
helm install onyxia onyxia/onyxia -f onyxia-values.yamlhelm repo add codecentric https://codecentric.github.io/helm-charts
DOMAIN=my-domain.net
POSTGRESQL_PASSWORD=xxxxx #Replace by a strong password, you will never need it.
# Credentials for logging to https://auth.lab.$DOMAIN/auth
KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=yyyyyy
cat << EOF > ./keycloak-values.yaml
image:
# We use the legacy variant of the image until codecentric update it's helm chart
tag: "19.0.3-legacy"
replicas: 1
extraInitContainers: |
- name: realm-ext-provider
image: curlimages/curl
imagePullPolicy: IfNotPresent
command:
- sh
args:
- -c
- |
# There is a custom theme published alongside every onyxia-web release
# The version of the Keycloak theme and the version of onyxia-web don't need
# to match but you should update the theme from time to time.
# https://github.com/InseeFrLab/onyxia-web/releases
curl -L -f -S -o /extensions/onyxia.jar https://github.com/InseeFrLab/onyxia-web/releases/download/v2.29.4
/keycloak-theme.jar
volumeMounts:
- name: extensions
mountPath: /extensions
extraVolumeMounts: |
- name: extensions
mountPath: /opt/jboss/keycloak/standalone/deployments
extraVolumes: |
- name: extensions
emptyDir: {}
extraEnv: |
- name: KEYCLOAK_USER
value: $KEYCLOAK_USER
- name: KEYCLOAK_PASSWORD
value: $KEYCLOAK_PASSWORD
- name: JGROUPS_DISCOVERY_PROTOCOL
value: kubernetes.KUBE_PING
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: KEYCLOAK_STATISTICS
value: "true"
- name: CACHE_OWNERS_COUNT
value: "2"
- name: CACHE_OWNERS_AUTH_SESSIONS_COUNT
value: "2"
- name: PROXY_ADDRESS_FORWARDING
value: "true"
- name: JAVA_OPTS
value: >-
-Dkeycloak.profile=preview -XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0 -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true
ingress:
enabled: true
servicePort: http
annotations:
kubernetes.io/ingress.class: nginx
## Resolve HTTP 502 error using ingress-nginx:
## See https://www.ibm.com/support/pages/502-error-ingress-keycloak-response
nginx.ingress.kubernetes.io/proxy-buffer-size: 128k
rules:
- host: "auth.lab.$DOMAIN"
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- auth.lab.$DOMAIN
postgresql:
postgresqlPassword: $POSTGRESQL_PASSWORD
EOF
helm install keycloak codecentric/keycloak -f keycloak-values.yaml{
"attributes": [
{
"name": "username",
"displayName": "${username}",
"validations": {
"length": {
"min": 3,
"max": 255
},
+ "pattern": {
+ "error-message": "${alphanumericalCharsOnly}",
+ "pattern": "^[a-zA-Z0-9]*$"
+ },
"username-prohibited-characters": {}
}
},
{
"name": "email",
"displayName": "${email}",
"validations": {
"email": {},
+ "pattern": {
+ "pattern": "^[^@]+@([^.]+\\.)*((gmail\\.com)|(hotmail\\.com))$"
+ },
"length": {
"max": 255
}
}
},
{
"name": "firstName",
"displayName": "${firstName}",
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"validations": {
"length": {
"max": 255
},
"person-name-prohibited-characters": {}
}
},
{
"name": "lastName",
"displayName": "${lastName}",
"required": {
"roles": [
"user"
]
},
"permissions": {
"view": [
"admin",
"user"
],
"edit": [
"admin",
"user"
]
},
"validations": {
"length": {
"max": 255
},
"person-name-prohibited-characters": {}
}
}
]
}+serviceAccount:
+ clusterAdmin: true
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: onyxia.my-domain.net
web:
+ env:
+ TERMS_OF_SERVICES: |
+ {
+ "en": "https://www.sspcloud.fr/tos_en.md",
+ "fr": "https://www.sspcloud.fr/tos_fr.md"
+ }
api:
env:
+ authentication.mode: openidconnect
+ oidc.issuer-uri: "https://auth.lab.my-domain.net/auth/realms/datalab"
+ oidc.clientID: "onyxia"
+ oidc.audience: "onyxia"
regions:
[
{
"id":"demo",
"name":"Demo",
"description":"This is a demo region, feel free to try Onyxia !",
"services":{
"type":"KUBERNETES",
- "singleNamespace": true,
+ "singleNamespace": false,
"namespacePrefix":"user-",
"usernamePrefix":"oidc-",
"groupNamespacePrefix":"projet-",
"groupPrefix":"oidc-",
"authenticationMode":"serviceAccount",
"expose":{
"domain":"lab.my-domain.net"
},
"monitoring":{
"URLPattern":"todo"
},
"initScript":"https://inseefrlab.github.io/onyxia/onyxia-init.sh"
}
}
]helm upgrade onyxia inseefrlab/onyxia -f onyxia-values.yamlhelm repo add minio https://charts.min.io/
DOMAIN=my-domain.net
cat << EOF > ./minio-values.yaml
## replicas: 16
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
path: /
hosts:
- minio.lab.$DOMAIN
tls:
- hosts:
- minio.lab.$DOMAIN
consoleIngress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
paths: /
hosts:
- minio-console.lab.$DOMAIN
tls:
- hosts:
- minio-console.lab.$DOMAIN
environment:
MINIO_BROWSER_REDIRECT_URL: https://minio-console.lab.$DOMAIN
oidc:
enabled: true
configUrl: "https://auth.lab.$DOMAIN/auth/realms/datalab/.well-known/openid-configuration"
clientId: "minio"
claimName: "policy"
scopes: "openid,profile,email"
redirectUri: "https://minio-console.lab.$DOMAIN/oauth_callback"
claimPrefix: ""
comment: ""
clientSecret: COPY_SECRET_FROM_KEYCLOAK_MINIO_CLIENT
policies:
- name: stsonly
statements:
- resources:
- 'arn:aws:s3:::oidc-${jwt:preferred_username}'
- 'arn:aws:s3:::oidc-${jwt:preferred_username}/*'
actions:
- "s3:*"
EOF
helm install minio minio/minio -f minio-values.yamlserviceAccount:
clusterAdmin: true
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: onyxia.my-domain.net
web:
env:
KEYCLOAK_REALM: datalab
KEYCLOAK_URL: https://auth.lab.my-domain.net/auth
TERMS_OF_SERVICES: |
{ "en": "https://www.sspcloud.fr/tos_en.md", "fr": "https://www.sspcloud.fr/tos_fr.md" }
api:
env:
authentication.mode: openidconnect
keycloak.realm: datalab
keycloak.auth-server-url: https://auth.lab.my-domain.net/auth
regions:
[
{
"id":"demo",
"name":"Demo",
"description":"This is a demo region, feel free to try Onyxia !",
"services":{
"type":"KUBERNETES",
"singleNamespace": false,
"namespacePrefix":"user-",
"usernamePrefix":"oidc-",
"groupNamespacePrefix":"projet-",
"groupPrefix":"oidc-",
"authenticationMode":"admin",
"expose":{
"domain":"lab.my-domain.net"
},
"monitoring":{
"URLPattern":"todo"
},
"cloudshell":{
"catalogId":"inseefrlab-helm-charts-datascience",
"packageName":"cloudshell"
},
"initScript":"https://inseefrlab.github.io/onyxia/onyxia-init.sh"
},
"data":{
"S3":{
- "URL":"todo",
+ "type": "minio",
+ "URL": "https://minio.lab.my-domain.net",
+ "region": "us-east-1",
+ "bucketPrefix": "oidc-",
+ "groupBucketPrefix": "projet-",
+ "bucketClaim": "preferred_username",
+ "defaultDurationSeconds": 86400,
+ "keycloakParams":
+ {
+ "URL": "https://auth.lab.my-domain.net/auth",
+ "realm": "datalab",
+ "clientId": "onyxia-minio",
+ },
+ "acceptBucketCreation": true,
"monitoring":{
"URLPattern":"minio"
}
}
},
"auth":{
"type":"openidconnect"
},
"location":{
"lat":48.8164,
"long":2.3174,
"name":"Montrouge (France)"
}
}
]helm upgrade onyxia inseefrlab/onyxia -f onyxia-values.yamlhelm repo add hashicorp https://helm.releases.hashicorp.com
DOMAIN=my-domain.net
cat << EOF > ./vault-values.yaml
server:
dev:
enabled: true
# Set VAULT_DEV_ROOT_TOKEN_ID value
devRootToken: "root"
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: "vault.lab.$DOMAIN"
tls:
- hosts:
- vault.lab.$DOMAIN
EOF
helm install vault hashicorp/vault -f vault-values.yaml

onyxia.my-domain.net A <YOUR_IP>
*.lab.my-domain.net A <YOUR_IP>brew install certbot #On Mac, lookup how to install certbot for your OS
# Because we need a wildcard certificate we have to complete the DNS callange.
sudo certbot certonly --manual --preferred-challenges dns
# When asked for the domains you wish to optains a certificate for enter:
# onyxia.my-domain.net *.lab.my-domain.netkubectl create namespace ingress-nginx
DOMAIN=my-domain.net
sudo kubectl create secret tls onyxia-tls \
-n ingress-nginx \
--key /etc/letsencrypt/live/onyxia.$DOMAIN/privkey.pem \
--cert /etc/letsencrypt/live/onyxia.$DOMAIN/fullchain.pemcat << EOF > ./ingress-nginx-values.yaml
controller:
extraArgs:
default-ssl-certificate: "ingress-nginx/onyxia-tls"
EOF
helm install ingress-nginx ingress-nginx \
--repo https://kubernetes.github.io/ingress-nginx \
--namespace ingress-nginx \
-f ./ingress-nginx-values.yaml web:
env:
# Available env are documented here: https://github.com/InseeFrLab/onyxia-web/blob/main/.env
KEYCLOAK_URL: https://auth.lab.my-domain.net/auth
KEYCLOAK_CLIENT_ID: onyxia
KEYCLOAK_REALM: datalab
JWT_EMAIL_CLAIM: email
JWT_FAMILY_NAME_CLAIM: family_name
JWT_FIRST_NAME_CLAIM: given_name
JWT_USERNAME_CLAIM: preferred_username
JWT_LOCALE_CLAIM: localeonyxia.my-domain.net CNAME jhon-doe-home.ddns.net.
*.lab.my-domain.net CNAME jhon-doe-home.ddnc.net.
