Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions config/docopts.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ Configure OpenServerless
Usage:
config (enable|disable) [--all] [--redis] [--mongodb] [--minio] [--cron] [--static] [--postgres] [--prometheus] [--slack] [--mail] [--affinity] [--tolerations] [--quota] [--milvus] [--registry] [--seaweedfs]
config apihost (<apihost>|auto) [--tls=<email>] [--protocol=<http/https>|auto]
config sso keycloak --enable --issuer-url=<issuer-url> --jwks-url=<jwks-url> (--audience=<audience>|--client-id=<client-id>) --required-group=<group> [--client-secret=<client-secret>] [--username-claim=<claim>] [--groups-claim=<claim>] [--namespace=<namespace>] [--configmap=<name>] [--secret=<name>] [--statefulset=<name>] [--container=<name>] [--no-rollout]
config sso show
config sso disable [--namespace=<namespace>] [--configmap=<name>] [--secret=<name>] [--statefulset=<name>] [--container=<name>] [--no-rollout]
config sso
config runtimes [<runtimesjson>]
config slack [--apiurl=<slackapiurl>] [--channel=<slackchannel>]
config mail [--mailuser=<mailuser>] [--mailpwd=<mailpwd>] [--mailfrom=<mailfrom>] [--mailto=<mailto>]
Expand Down
79 changes: 79 additions & 0 deletions config/sso/docopts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->

# Tasks `ops config sso`

Configure OpenServerless SSO/OIDC integration for admin-api.

## Synopsis

```text
Usage:
sso keycloak --enable --issuer-url=<issuer-url> --jwks-url=<jwks-url> (--audience=<audience>|--client-id=<client-id>) --required-group=<group> [--client-secret=<client-secret>] [--username-claim=<claim>] [--groups-claim=<claim>] [--namespace=<namespace>] [--configmap=<name>] [--secret=<name>] [--statefulset=<name>] [--container=<name>] [--no-rollout]
sso show
sso disable [--namespace=<namespace>] [--configmap=<name>] [--secret=<name>] [--statefulset=<name>] [--container=<name>] [--no-rollout]
```

## Managed resources

The task owns a dedicated ConfigMap, named
`openserverless-sso-config` by default, with these keys:

- `OIDC_ISSUER_URL`
- `OIDC_JWKS_URL`
- `OIDC_AUDIENCE`
- `OIDC_CLIENT_ID`
- `OIDC_REQUIRED_GROUP`
- `OIDC_USERNAME_CLAIM`
- `OIDC_GROUPS_CLAIM`
- `SSO_AUTOPROVISION_ON_LOGIN`
- `SSO_AUTOPROVISION_TIMEOUT_SECONDS`
- `SSO_AUTOPROVISION_POLL_SECONDS`
- `SSO_AUTOPROVISION_DEFAULT_SERVICES`
- `SSO_NAMESPACE_PRESERVE_VALID`
- `SSO_NAMESPACE_HASH_LENGTH`
- `SSO_NAMESPACE_MAX_LENGTH`

With `--client-secret`, the task also owns a dedicated Secret, named
`openserverless-sso-secret` by default, containing only
`OIDC_CLIENT_SECRET`.

The selected admin-api container receives exact, prefix-free `envFrom`
references to those resources. The task does not manage direct `env` entries,
other `envFrom` references, volumes, volume mounts, or annotations.

`disable` removes only the managed references and dedicated resources. Missing
resources are not errors. Repeated disable is a no-op for the StatefulSet.
Kubernetes automatically rolls out a changed pod template; `--no-rollout`
skips waiting for it and never issues an additional restart.

## Options

```text
--username-claim=<claim> OIDC username claim [default: preferred_username]
--groups-claim=<claim> OIDC groups claim [default: groups]
--client-id=<client-id> OIDC client id; defaults to audience
--client-secret=<secret> confidential client secret stored only in Kubernetes
--namespace=<namespace> Kubernetes namespace [default: nuvolaris]
--configmap=<name> ConfigMap name [default: openserverless-sso-config]
--secret=<name> Secret name [default: openserverless-sso-secret]
--statefulset=<name> admin-api StatefulSet [default: nuvolaris-system-api]
--container=<name> admin-api container [default: nuvolaris-system-api]
--no-rollout do not restart or wait for admin-api rollout
```
60 changes: 60 additions & 0 deletions config/sso/opsfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: "3"

tasks:
keycloak:
desc: enable Keycloak OIDC for admin-api
silent: true
env:
OPS_SSO_ENABLE: '{{.__enable}}'
OPS_SSO_ISSUER_URL: '{{.__issuer_url}}'
OPS_SSO_JWKS_URL: '{{.__jwks_url}}'
OPS_SSO_AUDIENCE: '{{.__audience}}'
OPS_SSO_CLIENT_ID: '{{.__client_id}}'
OPS_SSO_CLIENT_SECRET: '{{.__client_secret}}'
OPS_SSO_REQUIRED_GROUP: '{{.__required_group}}'
OPS_SSO_USERNAME_CLAIM: '{{.__username_claim}}'
OPS_SSO_GROUPS_CLAIM: '{{.__groups_claim}}'
OPS_SSO_NAMESPACE: '{{.__namespace}}'
OPS_SSO_CONFIGMAP: '{{.__configmap}}'
OPS_SSO_SECRET: '{{.__secret}}'
OPS_SSO_STATEFULSET: '{{.__statefulset}}'
OPS_SSO_CONTAINER: '{{.__container}}'
OPS_SSO_NO_ROLLOUT: '{{.__no_rollout}}'
cmds:
- bun sso.ts keycloak

show:
desc: show local SSO configuration
silent: true
cmds:
- bun sso.ts show

disable:
desc: disable SSO/OIDC for admin-api
silent: true
env:
OPS_SSO_NAMESPACE: '{{.__namespace}}'
OPS_SSO_CONFIGMAP: '{{.__configmap}}'
OPS_SSO_SECRET: '{{.__secret}}'
OPS_SSO_STATEFULSET: '{{.__statefulset}}'
OPS_SSO_CONTAINER: '{{.__container}}'
OPS_SSO_NO_ROLLOUT: '{{.__no_rollout}}'
cmds:
- bun sso.ts disable
Loading