Merge pull request #8262 from dokku/7257-import-certificate-into-k8s-app
Use certificates imported by certs plugin when deploying via scheduler-k3s
This commit is contained in:
@@ -307,6 +307,36 @@ The server can also be disabled globally, and then conditionally enabled on a pe
|
||||
dokku scheduler-k3s:set --global letsencrypt-server false
|
||||
```
|
||||
|
||||
#### Using imported SSL certificates
|
||||
|
||||
SSL certificates imported via the `certs` plugin can be used with the k3s scheduler. When a certificate is imported, it is automatically synced to Kubernetes as a TLS secret and will be used for the app's ingress configuration.
|
||||
|
||||
To import a certificate:
|
||||
|
||||
```shell
|
||||
dokku certs:add node-js-app server.crt server.key
|
||||
```
|
||||
|
||||
When a certificate is imported:
|
||||
|
||||
- A Kubernetes TLS secret named `tls-<app-name>` is created in the app's namespace
|
||||
- The ingress configuration is updated to use the imported certificate
|
||||
- Automatic Let's Encrypt certificate generation is disabled for the app
|
||||
|
||||
Imported certificates take precedence over Let's Encrypt certificates. If you have both an imported certificate and Let's Encrypt configured, the imported certificate will be used.
|
||||
|
||||
To remove an imported certificate:
|
||||
|
||||
```shell
|
||||
dokku certs:remove node-js-app
|
||||
```
|
||||
|
||||
When a certificate is removed:
|
||||
|
||||
- The TLS secret is deleted from Kubernetes
|
||||
- The app is automatically redeployed to update the ingress configuration
|
||||
- If Let's Encrypt is configured, automatic certificate generation will resume
|
||||
|
||||
### Customizing Annotations and Labels
|
||||
|
||||
> [!NOTE]
|
||||
|
||||
@@ -387,6 +387,30 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `certs-get`
|
||||
|
||||
- Description: Returns the certificate or key content for an app
|
||||
- Invoked by: `scheduler-k3s`
|
||||
- Arguments: `$APP $KEY_TYPE`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
# Returns the certificate or key content for an app
|
||||
# KEY_TYPE should be "crt" or "key"
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
APP="$1"; KEY_TYPE="$2"
|
||||
APP_SSL_PATH="$DOKKU_ROOT/$APP/tls"
|
||||
|
||||
if [[ "$KEY_TYPE" == "crt" ]]; then
|
||||
cat "$APP_SSL_PATH/server.crt"
|
||||
elif [[ "$KEY_TYPE" == "key" ]]; then
|
||||
cat "$APP_SSL_PATH/server.key"
|
||||
fi
|
||||
```
|
||||
|
||||
### `check-deploy`
|
||||
|
||||
- Description: Allows you to run checks on a deploy before Dokku allows the container to handle requests.
|
||||
|
||||
Reference in New Issue
Block a user