Code Monkey home page Code Monkey logo

dokku-scheduler-kubernetes's Introduction

dokku-scheduler-kubernetes

If this plugin is missing a feature you need, consider sponsoring development. Pull requests always welcome!

A Dokku plugin to integrate with kubernetes.

Requirements

  • The dokku-registry plugin should be installed and configured for your app
  • A configured kubectl (/home/dokku/.kube/config) that can talk to your cluster
  • Dokku 0.20.4+

Installation

You can install this plugin by issuing the command:

dokku plugin:install https://github.com/dokku/dokku-scheduler-kubernetes

After the plugin has successfully been installed you need to install the plugin's dependencies by running the command:

dokku plugin:install-dependencies

Functionality

The following functionality has been implemented

  • Deployment and Service annotations
  • Domain proxy support via the Nginx Ingress Controller
  • Environment variables
  • Letsencrypt SSL Certificate integration via CertManager
  • Pod Disruption Budgets
  • Resource limits and reservations (reservations == kubernetes requests)
    • If no unit is specified, the values for memory are assumed to be in Mi (Megabytes)
  • Zero-downtime deploys via Deployment healthchecks
  • Traffic to non-web containers (via a configurable list)

Unsupported at this time:

  • Custom docker-options (not applicable)
  • Deployment timeouts (planned: #30)
  • Dockerfile support (planned: #29)
  • Encrypted environment variables (planned: #9)
  • Proxy port integration (planned: #29)
  • Manual SSL Certificates (planned: #28)
  • The following scheduler commands are unimplemented:
    • enter (planned: #12)
    • logs:failed
    • run (planned: #12)

If this plugin is missing a feature you need, consider sponsoring development. Pull requests always welcome!

Notes

  • Each Procfile entry will be turned into a kubernetes Deployment object.
  • Each Procfile entry name must be a valid DNS subdomain.
  • The web process will also create a Service object.
  • Non-web processes can create a Service object via a configurable property.
  • All created Kubernetes objects are tracked to completion via kubedog.
  • All manifest templates are hardcoded in the plugin.

Usage

Set the scheduler to kubernetes. This can be done per-app or globally:

# globally
dokku scheduler:set --global selected kubernetes

# per-app
dokku scheduler:set $APP selected kubernetes

You also need to ensure your kubectl has the correct context specified:

# as the dokku user
kubectl config use-context YOUR_NAME

And configure your registry:

dokku registry:set $APP server gcr.io/dokku/

Assuming your Dokku installation can push to the registry and your kubeconfig is valid, Dokku will deploy the app against the cluster.

The namespace in use for a particular app can be customized using the :set command. This will apply to all future invocations of the plugin, and will not modify any existing resources. If unspecified, the namespace in use is the cluster default namespace. The scheduler-kubernetes will create the namespace via a kubectl apply.

dokku scheduler-kubernetes:set $APP namespace test

If deploying from a private docker registry and the cluster needs does not have open access to the registry, an imagePullSecrets value can be specified. This will be injected into the kubernetes deployment spec at deploy time.

dokku scheduler-kubernetes:set $APP imagePullSecrets registry-credential

See this doc for more details on creating an imagePullSecrets secret file.

Service Ingress

This functionality assumes a helm-installed nginx-ingress controller:

helm install ingress-nginx ingress-nginx/ingress-nginx --set controller.publishService.enabled=true

A Kubernetes Service object is created for each web process. Additionally, if the app has it's proxy-type set to nginx-ingress, then we will also create or update a Kubernetes ingress object within the namespace configured for the app. This can be set as follows:

dokku config:set $APP DOKKU_APP_PROXY_TYPE=nginx-ingress

The ingress object has the following properties:

  • The name of the ingress object will be app-ingress.
  • All kubernetes-deployed apps within the same namespace are added to the ingress object.
  • Configured app domains are respected as unique rules.
  • The configured service port for each rule is hardcoded to 5000.

To modify the manifest before it gets applied to the cluster, use the pre-kubernetes-ingress-apply plugin trigger.

Service objects can also be created for specific process types by configuring the service-process-types property. This is a comma-separated list that is specific to an individual application, and will always implicitly include the web process type.

dokku scheduler-kubernetes:set $APP service-process-types http,worker

The PORT environment variable is hardcoded to 5000. No Ingress object is created for non-web processes.

Automated SSL Integration via CertManager

This functionality assumes a helm-installed cert-manager CRD:

kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm upgrade cert-manager jetstack/cert-manager --namespace cert-manager --version v1.10.0 --set installCRDs=true --install

At this time, the scheduler-kubernetes does not have support for custom SSL certificates. However, domains associated with an app can have a Letsencrypt SSL certificate provisioned automatically via the CertManager Kubernetes add-on.

To start using the CertManager, we will first need to set the issuer email

dokku config:set --global [email protected]

Next, any apps that will require cert-manager integration will need to have that enabled:

dokku scheduler-kubernetes:set $APP cert-manager-enabled true

On the next deploy or domain name change, the CertManager entry will be automatically updated to fetch an SSL certificate for all domains associated with all applications on the same ingress object.

Pod Disruption Budgets

A PodDisruptionBudget object can be created, and will apply to all process types in an app. To configure this, the pod-max-unavailable and pod-min-available properties can be set:

dokku scheduler-kubernetes:set $APP pod-min-available 1

# available in kubernetes 1.7+
dokku scheduler-kubernetes:set $APP pod-max-unavailable 1

Pod Disruption Budgets will be updated on next deploy.

Deployment Autoscaling

This feature requires an installed metric server, uses the autoscaling/v2beta2 api, and will apply immediately. Only resource rules are supported when using the official metric-server, all others require the prometheus-operator and prometheus-adapter.

By default, Kubernetes deployments are not set to autoscale, but a HorizontalPodAutoscaler object can be managed for an app on a per-process type basis - referenced as $PROC_TYPE below. Using the HorizontalPodAutoscaler will disable the normal usage of ps:scale for the specified app/process-type combination, as per Kubernetes best practices.

At a minimum, both a min/max number of replicas must be set.

# set the min number of replicas
dokku scheduler-kubernetes:autoscale-set $APP $PROC_TYPE min-replicas 1

# set the max number of replicas
dokku scheduler-kubernetes:autoscale-set $APP $PROC_TYPE max-replicas 10

You also need to add autoscaling rules. These can be managed via the :autoscale-rule-add command. Adding a rule for a target-name/metric-type combination that already exists will override any existing rules.

Rules can be added for the following metric types:

  • external:
    • format: external:$NAME:$TYPE:$VALUE[:$SELECTOR]
    • fields:
      • $NAME: The name of the external metric to track
      • $TYPE (valid values: [AverageValue, Value]): The type of the target.
      • $VALUE: The value to track.
      • $SELECTOR (optional): The selector to use for filtering to one or more specific metric series.
  • ingress:
    • format: ingress:$NAME:$TYPE:$VALUE[:$INGRESS]
    • fields:
      • $NAME: The name of the ingress metric to track.
      • $TYPE (valid values: [AverageValue, Value]): The type of the target.
      • $VALUE: The value to track.
      • $INGRESS (default: app-ingress): The name of the ingress object to filter on.
  • pods
    • format: pods:$NAME:$TYPE:$VALUE
    • fields:
      • $NAME: The name of the metric from the pod resource to track.
      • $TYPE (valid values: [AverageValue]): The type of the target.
      • $VALUE: The value to track.
  • resource
    • format: resource:$NAME:$TYPE:$VALUE
    • fields:
      • $NAME (valid values: [cpu, memory]): The name of the metric to track.
      • $TYPE (valid values: [AverageValue, Utilization]): The type of the target.
      • $VALUE: The value to track.
# set the cpu average utilization target
dokku scheduler-kubernetes:autoscale-rule-add $APP $PROC_TYPE resource:cpu:Utilization:50

Rules can be listed via the autoscale-rule-list command:

dokku scheduler-kubernetes:autoscale-rule-list $APP $PROC_TYPE

Rules can be removed via the :autoscale-rule-remove command. This command takes the same arguments as the autoscale-rule-add command, though the value is optional. If a rule matching the specified arguments does not exist, the command will still return 0.

# remove the cpu rule
dokku scheduler-kubernetes:autoscale-rule-remove $APP $PROC_TYPE resource:cpu:Utilization:50

# remove the cpu rule by prefix
dokku scheduler-kubernetes:autoscale-rule-remove $APP $PROC_TYPE resource:cpu:Utilization

Autoscaling rules are applied automatically during the next deploy, though may be immediately applied through the :autoscale-apply command:

dokku scheduler-kubernetes:autoscale-apply $APP $PROC_TYPE

Persistent Volume Claims (pvc)

Pods use pvcs as volumes. For volumes that support multiple access modes, the user specifies which mode is desired when using their claim as a volume in a Pod. See supported access modes by providers

# create a pvc
dokku scheduler-kubernetes:add-pvc $NAME $SIZE [--access-mode $MODE][--namespace $NAMESPACE ][--storage-class-name $CLASS]

Fields: - $NAME: The name of the persistent volume claim - $SIZE is a numeric size of claim in MB. - $MODE: Access mode must be either of ReadWriteOnce, ReadOnlyMany or ReadWriteMany. Default is ReadWriteOnce - $NAMESPACE : The namespace for the pvc. Default is "default" - $CLASS: The storage class name. Default is k8s providers default storage class

# list pvcs
dokku scheduler-kubernetes:list-pvc [$NAMESPACE]
# delete pvc
dokku scheduler-kubernetes:remove-pvc $NAME --namespace $NAMESPACE

Mounting a volume using PVC

Pods access storage by using the claim as a volume.

# mounting a volume (requires a re-deploy to take effect)
dokku scheduler-kubernetes:mount $APP_NAME $PVC_NAME $CONTAINER_PATH

Fields: - $APP_NAME: The name of the app - $PVC_NAME: Name of persistent volume claim. Will be used as volume name. Claims must exist in the same namespace as the app.

List mounted volumes for an app:

# list mounted volumes
dokku scheduler-kubernetes:list-mount $APP_NAME

Unmount a volume:

# unmount a volume (requires a re-deploy to take effect)
dokku scheduler-kubernetes:unmount $APP_NAME $PVC_NAME $CONTAINER_PATH

Unmount all volumes:

# unmount all (requires a re-deploy to take effect)
dokku scheduler-kubernetes:unmount-all $APP_NAME

Kubernetes Manifests

Warning: Running this command exposes app environment variables to stdout.

The kubernetes manifest for a deployment or service can be displayed using the :show-manifest command. This manifest can be used to inspect what would be submitted to Kubernetes.

# show the deployment manifest for the `web` process type
dokku scheduler-kubernetes:show-manifest $APP $PROC_TYPE $MANIFEST_TYPE

This command can be used like so:

# show the deployment manifest for the `web` process type
dokku scheduler-kubernetes:show-manifest node-js-sample web


# implicitly specify the deployment manifest
dokku scheduler-kubernetes:show-manifest node-js-sample web deployment

# show the service manifest for the `web` process type
dokku scheduler-kubernetes:show-manifest node-js-sample web service

The command will exit non-zero if the specific manifest for the given app/process type combination is not found.

Annotations

Warning: There is no validation for on annotation keys or values.

Deployment Annotations

These can be managed by the :deployment-annotations-set command.

# command structure
dokku scheduler-kubernetes:deployment-annotations-set $APP $ANNOTATION_NAME $ANNOTATION_VALUE

# set example
dokku scheduler-kubernetes:deployment-annotations-set node-js-sample pod.kubernetes.io/lifetime 86400s

# unset example, leave the value empty
dokku scheduler-kubernetes:deployment-annotations-set node-js-sample pod.kubernetes.io/lifetime

Currently, these apply globally to all processes within a deployed app.

Pod Annotations

These can be managed by the :pod-annotations-set command.

# command structure
dokku scheduler-kubernetes:pod-annotations-set $APP name value

# set example
dokku scheduler-kubernetes:pod-annotations-set node-js-sample pod.kubernetes.io/lifetime 86400s

# unset example, leave the value empty
dokku scheduler-kubernetes:pod-annotations-set node-js-sample pod.kubernetes.io/lifetime

Currently, these apply globally to all processes within a deployed app.

Service Annotations

These can be managed by the :service-annotations-set command.

# command structure
dokku scheduler-kubernetes:service-annotations-set $APP name value

# set example
dokku scheduler-kubernetes:service-annotations-set node-js-sample pod.kubernetes.io/lifetime 86400s

# unset example, leave the value empty
dokku scheduler-kubernetes:service-annotations-set node-js-sample pod.kubernetes.io/lifetime

Currently, they are applied to the web process, which is the only process for which a Kubernetes Service is created.

Ingress Annotations on Namespaces

These can be managed by the :ingress-annotations-set command.

# command structure
dokku scheduler-kubernetes:ingress-annotations-set $NAMESPACE name value

# set example
dokku scheduler-kubernetes:ingress-annotations-set my-namespace nginx.ingress.kubernetes.io/affinity cookie

# unset example, leave the value empty
dokku scheduler-kubernetes:ingress-annotations-set my-namespace nginx.ingress.kubernetes.io/affinity

Currently, these apply to all deployments within an namespace.

Rolling Updates

For deployments that use a rollingUpdate for rollouts, a rollingUpdate may be triggered at a later date via the :rolling-update command.

dokku scheduler-kubernetes:rolling-update $APP

Health Checks

Health checks for the app may be configured in app.json, based on Kubernetes liveness and readiness probes. All Kubernetes options that can occur within a Probe object are supported, though syntax is JSON rather than YAML. The variable $APP may be used to represent the app name.

If a process type is not configured for a given probe type (liveness or readiness), any probe of the same type for the "*" default process type is used instead.

Here (click the triangle to expand) is an example JSON for Kubernetes health checks.

{
	"healthchecks": {
		"web": {
			"readiness": {
				"httpGet": {
					"path": "/{{ $APP }}/readiness_check",
					"port": 5000
				},
				"initialDelaySeconds": 5,
				"periodSeconds": 5
			}
		},
		"*": {
			"liveness": {
				"exec": {
					"command": ["/bin/pidof", "/start"]
				},
				"initialDelaySeconds": 5,
				"periodSeconds": 5
			},
			"readiness": {
				"httpGet": {
					"path": "web processes override this.",
					"port": 5000
				},
				"initialDelaySeconds": 5,
				"periodSeconds": 5
			}
		}
	}
}

Plugin Triggers

The following custom triggers are exposed by the plugin:

post-deploy-kubernetes-apply

  • Description: Allows a user to interact with the deployment manifest after it has been submitted.
  • Invoked by:
  • Arguments: $APP $PROC_TYPE $MANIFEST_FILE $MANIFEST_TYPE
  • Example:
#!/usr/bin/env bash

set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

# TODO

pre-ingress-kubernetes-apply

  • Description: Allows a user to interact with the ingress manifest before it has been submitted.
  • Invoked by: core-post-deploy, post-domains-update, post-proxy-ports-update, and proxy-build-config triggers
  • Arguments: $APP $MANIFEST_FILE
  • Example:
#!/usr/bin/env bash

set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

# TODO

pre-deploy-kubernetes-apply

  • Description: Allows a user to interact with the deployment|service manifest before it has been submitted.
  • Invoked by: scheduler-deploy trigger and :show-manifest
  • Arguments: $APP $PROC_TYPE $MANIFEST_FILE $MANIFEST_TYPE
  • Example:
#!/usr/bin/env bash

set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

# TODO

dokku-scheduler-kubernetes's People

Contributors

babarinde avatar deepstqte avatar grk avatar josegonzalez avatar killjoy1221 avatar scjody avatar taraszka avatar tarzzz avatar weyert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dokku-scheduler-kubernetes's Issues

DOKKU_SCALE file does not exist, breaks deploys

Description of problem

In Dokku 0.30.1 (fresh install), deployment fails when trying to read from the DOKKU_SCALE file, which doesn't exist. Manually creating the file with the contents web=1 will allow it to deploy.

-----> Deploying testapp via the kubernetes scheduler...
=====> Deploying via kubernetes
/var/lib/dokku/plugins/enabled/scheduler-kubernetes/scheduler-deploy: line 8: /home/dokku/testapp/DOKKU_SCALE: No such file or directory
=====> Deploy complete

How reproducible

Every deployment will fail, but report as deployed.

Steps to Reproduce

  1. Deploy an app to kubernetes

Environment Information

dokku report testapp output

-----> uname: Linux 352bf3f0c877 3.10.0-1160.88.1.el7.x86_64 #1 SMP Sat Feb 18 13:27:00 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                     total        used        free      shared  buff/cache   available
       Mem:           3789         559         349          24        2879        2922
       Swap:             0           0           0
-----> docker version:
       Client: Docker Engine - Community
        Version:           23.0.1
        API version:       1.42
        Go version:        go1.19.5
        Git commit:        a5ee5b1
        Built:             Thu Feb  9 19:46:56 2023
        OS/Arch:           linux/amd64
        Context:           default
   Server: Docker Engine - Community
    Engine:
     Version:          23.0.1
     API version:      1.42 (minimum version 1.12)
     Go version:       go1.19.5
     Git commit:       bc3805a
     Built:            Thu Feb  9 19:48:42 2023
     OS/Arch:          linux/amd64
     Experimental:     false
    containerd:
     Version:          1.6.18
     GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
    runc:
     Version:          1.1.4
     GitCommit:        v1.1.4-0-g5fd4c4d
    docker-init:
     Version:          0.19.0
     GitCommit:        de40ad0

-----> docker daemon info:
Client:
Context: default
Debug Mode: true
Plugins:
compose: Docker Compose (Docker Inc.)
Version: v2.16.0
Path: /usr/libexec/docker/cli-plugins/docker-compose

   Server:
    Containers: 4
     Running: 3
     Paused: 0
     Stopped: 1
    Images: 39
    Server Version: 23.0.1
    Storage Driver: overlay2
     Backing Filesystem: xfs
     Supports d_type: true
     Using metacopy: false
     Native Overlay Diff: true
     userxattr: false
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Cgroup Version: 1
    Plugins:
     Volume: local
     Network: bridge host ipvlan macvlan null overlay
     Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
    Swarm: inactive
    Runtimes: io.containerd.runc.v2 runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
    runc version: v1.1.4-0-g5fd4c4d
    init version: de40ad0
    Security Options:
     seccomp
      Profile: builtin
    Kernel Version: 3.10.0-1160.88.1.el7.x86_64
    Operating System: Red Hat Enterprise Linux Server 7.9 (Maipo)
    OSType: linux
    Architecture: x86_64
    CPUs: 2
    Total Memory: 3.7GiB
    Name: snip
    ID: 3LFL:4GSO:N7AX:Q4UF:5RKM:W725:K5QT:CTSB:ZJMV:XKOM:U4GN:SDXY
    Docker Root Dir: /var/lib/docker
    Debug Mode: false
    Registry: https://index.docker.io/v1/
    Experimental: false
    Insecure Registries:
     10.193.196.185:5000
     127.0.0.0/8
    Registry Mirrors:
     snip
    Live Restore Enabled: false

-----> git version: git version 2.25.1
-----> sigil version: 0.9.0build+bc921b7
-----> herokuish version:
herokuish: v0.5.40
buildpacks:
heroku-buildpack-multi v1.2.0
heroku-buildpack-ruby v244
heroku-buildpack-nodejs v202
heroku-buildpack-clojure v90
heroku-buildpack-python v223
heroku-buildpack-java v72
heroku-buildpack-gradle v38
heroku-buildpack-scala v96
heroku-buildpack-play v26
heroku-buildpack-php v227
heroku-buildpack-go v169
heroku-buildpack-nginx v22
buildpack-null v3
-----> dokku version: dokku version 0.30.1
-----> plugn version: plugn: 0.12.0build+3a27594
-----> dokku plugins:
00_dokku-standard 0.30.1 enabled dokku core standard plugin
20_events 0.30.1 enabled dokku core events logging plugin
app-json 0.30.1 enabled dokku core app-json plugin
apps 0.30.1 enabled dokku core apps plugin
builder 0.30.1 enabled dokku core builder plugin
builder-dockerfile 0.30.1 enabled dokku core builder-dockerfile plugin
builder-herokuish 0.30.1 enabled dokku core builder-herokuish plugin
builder-lambda 0.30.1 enabled dokku core builder-lambda plugin
builder-null 0.30.1 enabled dokku core builder-null plugin
builder-pack 0.30.1 enabled dokku core builder-pack plugin
buildpacks 0.30.1 enabled dokku core buildpacks plugin
caddy-vhosts 0.30.1 enabled dokku core caddy-vhosts plugin
certs 0.30.1 enabled dokku core certificate management plugin
checks 0.30.1 enabled dokku core checks plugin
common 0.30.1 enabled dokku core common plugin
config 0.30.1 enabled dokku core config plugin
cron 0.30.1 enabled dokku core cron plugin
docker-options 0.30.1 enabled dokku core docker-options plugin
domains 0.30.1 enabled dokku core domains plugin
enter 0.30.1 enabled dokku core enter plugin
git 0.30.1 enabled dokku core git plugin
haproxy-vhosts 0.30.1 enabled dokku core haproxy-vhosts plugin
logs 0.30.1 enabled dokku core logs plugin
network 0.30.1 enabled dokku core network plugin
nginx-vhosts 0.30.1 enabled dokku core nginx-vhosts plugin
plugin 0.30.1 enabled dokku core plugin plugin
postgres 1.32.0 enabled dokku postgres service plugin
proxy 0.30.1 enabled dokku core proxy plugin
ps 0.30.1 enabled dokku core ps plugin
redis 1.32.0 enabled dokku redis service plugin
registry 0.30.1 enabled dokku core registry plugin
repo 0.30.1 enabled dokku core repo plugin
resource 0.30.1 enabled dokku core resource plugin
run 0.30.1 enabled dokku core run plugin
scheduler 0.30.1 enabled dokku core scheduler plugin
scheduler-docker-local 0.30.1 enabled dokku core scheduler-docker-local plugin
scheduler-kubernetes 0.20.1 enabled dokku scheduler-kubernetes plugin
scheduler-null 0.30.1 enabled dokku core scheduler-null plugin
shell 0.30.1 enabled dokku core shell plugin
ssh-keys 0.30.1 enabled dokku core ssh-keys plugin
storage 0.30.1 enabled dokku core storage plugin
trace 0.30.1 enabled dokku core trace plugin
traefik-vhosts 0.30.1 enabled dokku core traefik-vhosts plugin
=====> testapp app-json information
App json computed selected: app.json
App json global selected: app.json
App json selected:
=====> testapp app information
App created at: 1679059473
App deploy source: testapp
App deploy source metadata: testapp
App dir: /home/dokku/testapp
App locked: false
=====> testapp builder information
Builder build dir:
Builder computed build dir:
Builder computed selected:
Builder global build dir:
Builder global selected:
Builder selected:
=====> testapp builder-dockerfile information
Builder dockerfile computed dockerfile path: Dockerfile
Builder dockerfile global dockerfile path: Dockerfile
Builder dockerfile dockerfile path:
=====> testapp builder-lambda information
Builder lambda computed lambdayml path: lambda.yml
Builder lambda global lambdayml path: lambda.yml
Builder lambda lambdayml path:
=====> testapp builder-pack information
Builder pack computed projecttoml path: project.toml
Builder pack global projecttoml path: project.toml
Builder pack projecttoml path:
=====> testapp buildpacks information
Buildpacks computed stack: gliderlabs/herokuish:latest-20
Buildpacks global stack:
Buildpacks list:
Buildpacks stack:
=====> testapp ssl information
Ssl dir: /home/dokku/testapp/tls
Ssl enabled: false
Ssl hostnames:
Ssl expires at:
Ssl issuer:
Ssl starts at:
Ssl subject:
Ssl verified:
=====> testapp checks information
Checks disabled list: none
Checks skipped list: none
Checks computed wait to retire: 60
Checks global wait to retire: 60
Checks wait to retire:
=====> testapp cron information
Cron task count: 0
=====> testapp docker options information
Docker options build:
Docker options deploy: --restart=on-failure:10
Docker options run:
=====> testapp domains information
Domains app enabled: true
Domains app vhosts: testapp.snip
Domains global enabled: true
Domains global vhosts: snip
=====> testapp git information
Git deploy branch: master
Git global deploy branch: master
Git keep git dir: false
Git rev env var: GIT_REV
Git sha: 18a94a7
Git source image:
Git last updated at: 1679061470
=====> testapp logs information
Logs computed max size: 10m
Logs global max size: 10m
Logs global vector sink:
Logs max size:
Logs vector sink:
=====> testapp network information
Network attach post create:
Network attach post deploy:
Network bind all interfaces: false
Network computed attach post create:
Network computed attach post deploy:
Network computed bind all interfaces: false
Network computed initial network:
Network computed tld:
Network global attach post create:
Network global attach post deploy:
Network global bind all interfaces: false
Network global initial network:
Network global tld:
Network initial network:
Network static web listener:
Network tld:
Network web listeners: 158.26.0.6:5000
=====> testapp nginx information
Nginx access log format:
Nginx access log path: /var/log/nginx/testapp-access.log
Nginx bind address ipv4:
Nginx bind address ipv6: ::
Nginx client max body size:
Nginx disable custom config: false
Nginx error log path: /var/log/nginx/testapp-error.log
Nginx global hsts: true
Nginx computed hsts: true
Nginx hsts:
Nginx hsts include subdomains: true
Nginx hsts max age: 15724800
Nginx hsts preload: false
Nginx computed nginx conf sigil path: nginx.conf.sigil
Nginx global nginx conf sigil path: nginx.conf.sigil
Nginx nginx conf sigil path:
Nginx proxy buffer size: 4096
Nginx proxy buffering: on
Nginx proxy buffers: 8 4096
Nginx proxy busy buffers size: 8192
Nginx proxy read timeout: 60s
Nginx last visited at:
Nginx x forwarded for value: $remote_addr
Nginx x forwarded port value: $server_port
Nginx x forwarded proto value: $scheme
Nginx x forwarded ssl:
=====> testapp proxy information
Proxy enabled: true
Proxy port map: http:80:5000
Proxy type: nginx-ingress
=====> testapp ps information
Deployed: true
Processes: 1
Ps can scale: true
Ps computed procfile path: Procfile
Ps global procfile path: Procfile
Ps procfile path:
Ps restart policy: on-failure:10
Restore: true
Running: true
=====> testapp registry information
Registry computed image repo: dokku/testapp
Registry computed push on release: true
Registry computed server: snip
Registry global push on release: true
Registry global server: snip
Registry image repo:
Registry push on release:
Registry server:
Registry tag version: 6
=====> testapp resource information
=====> testapp scheduler information
Scheduler computed selected: kubernetes
Scheduler global selected: docker-local
Scheduler selected: kubernetes
=====> testapp scheduler-docker-local information
Scheduler docker local disable chown:
Scheduler docker local init process: true
Scheduler docker local parallel schedule count:
=====> testapp scheduler-kubernetes information
Scheduler kubernetes cert manager enabled:
Scheduler kubernetes imagePullSecrets:
Scheduler kubernetes ingress enabled: false
Scheduler kubernetes namespace: testapp
Scheduler kubernetes pod max unavailable:
Scheduler kubernetes pod min available:
Scheduler kubernetes service process types: http
=====> testapp storage information
Storage build mounts:
Storage deploy mounts:
Storage run mounts:

How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

It was installed on a RHEL 7 VM with Docker

#!/usr/bin/env bash

DOKKU_VERSION=0.30.1

docker pull "dokku/dokku:$DOKKU_VERSION"

pathenv=$(docker inspect "dokku/dokku:$DOKKU_VERSION" --format 'json' | jq '.[0].Config.Env | map(index("=") as $ix | {(.[:$ix]) : .[$ix+1:]}) | add')
docker container run \
    --env DOKKU_HOSTNAME=dokku.me \
    --env DOKKU_HOST_ROOT=/var/lib/dokku/home/dokku \
    --env DOKKU_LIB_HOST_ROOT=/var/lib/dokku/var/lib/dokku \
    --env PATH="$pathenv:/var/lib/dokku/data/scheduler-kubernetes" \
    --name dokku \
    --publish 3022:22 \
    --publish 8080:80 \
    --publish 8443:443 \
    --volume /var/lib/dokku:/mnt/dokku \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --rm \
    --detach \
    "dokku/dokku:$DOKKU_VERSION"

Add support for using a specific namespace

At the moment, we use the default namespace, but users may wish to use a single cluster for multiple Dokku installations. Being able to specify a namespace would be one way to cordon off resources.

Add deployment timeouts

This might require a change on kubedog, or even potentially some way to have a background job wait and terminate the kubedog tail after N seconds...

Procfile missing for Dockerfile or Pack image

If you're using Dokku - especially for commercial purposes - consider donating to project development via OpenCollective or Patreon. Funds go to general development, support, and infrastructure costs.

If you'd like to sponsor specific functionality, see the project's Sponsoring document.

If you need support for a version of Dokku over a year old, your issue may be closed without an answer. Please upgrade to a recent version before filing an issue.

Description of problem

The dokku-scheduler-kubernetes fail to deploy an app build by dokku using pack or dockerfile buildpacks when Procfile is missing.

How reproducible

  1. install dokku
  2. add dokku-scheduler-kubernetes
  3. add an app and set the scheduler to kubernetes for an app
  4. install pack from cloudnative buildpacks
  5. set DOKKU_CNB_EXPERIMENTAL=1 for your app
  6. deploy an app without Procfile to dokku; it will fail, saying that No profile is available for your app.

The same behavior is for docker file deployment.

scheduler-deploy: push secrets out via encrypted secrets

Deployments currently use bare environment variables. Although secrets are in plain-text on disk for Dokku, access to the Dokku installation can be fairly locked down, so this isn't a huge issue. However, using plaintext in a scheduler context isn't the most secure thing, as the resource manifests can be inspected by anyone with cluster access. We should instead use encrypted secrets as environment variables.

Creating a secret with every environment variable is a fairly trivial. Here is the json we need to generate and apply to when calling config:set and config:unset:

{
  "apiVersion": "v1",
  "kind": "Secret",
  "metadata": {
    "name": "$APP/environment-variables",
    "labels": {
      "app": "$APP"
    }
 },
  "type": "Opaque",
  "stringData": {
    "$KEY": "$VALUE",
    "$KEY2": "$VALUE2"
  }
}

There is also a limit of 1MB for environment variables, but we can live with this limit for now. If users end up going over this limit, we can revisit this problem, but its fairly unlikely that such a thing happens...

Once we do that, we can switch each env var entry to valueFrom.secretKeyRef as shown here:

{
  "name": "$KEY",
  "valueFrom": {
    "secretKeyRef": {
      "name": "$APP/environment-variables",
      "key": "$KEY"
    }
  }
}

testing: figure out testing harness

We should be able to setup something like minikube or whatever to verify that this plugin actually schedules and interacts with Kubernetes as expected for every change. That will allow us to promote this from an "alpha" plugin to "beta" stability.

Feature Request: Volumes and PV/C support

Description of problem

On the traditional dokku:storage plugin where users can create and mount volumes on the file system, Persistent Volumes and Claims support will provide similar feature on Kubernetes.
In the dokku:storage plugin, volumes created are shared by all app containers and with the right permissions containers can read and write data from such volumes. However access modes across nodes for PVs vary as seen here and some access modes are only available for specific PV types:
Suggested UX could be:

  • First create a PVC: dokku scheduler-kubernetes:add-pvc $APP_NAME --name PVC_NAME --accessModes "RWX|RWO|ROX " --storage "100" --storageClassName "nfs"
    This could create a yml spec

  • Create a volume: dokku scheduler-kubernetes:add-volume $APP_NAME --name VOLUME_NAME --pvc|--claimName PVC_NAME

  • Mount volume:dokku scheduler-kubernetes:mount $APP_NAME VOLUME_NAME:/container/path
    And these two will modify the deployment spec

Problem Tailing Logs

Cannot tail error logs for apps

Able to reproduce consistently

I'm using dokku version 20.4 and dokku-sechedule-kubernetes version 17.2.

Steps to Reproduce

  1. Try running dokku logs <APP_NAME> --tail
  2. Try running shorthand version: dokku logs <APP_NAME> --t

Actual Results

Both options yield the same result. The output is the default non-tail output as if I had run dokku logs <APP_NAME>.

Expected Results

I expected to see a tailed stream of error logs in real-time like they do on my other dokku servers.

Environment Information

dokku report output

-----> uname: Linux c1-primary 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
-----> memory: 
                     total        used        free      shared  buff/cache   available
       Mem:           1993         288         368           0        1336        1597
       Swap:             0           0           0
-----> docker version: 
       Client: Docker Engine - Community
        Version:           19.03.8
        API version:       1.40
        Go version:        go1.12.17
        Git commit:        afacb8b7f0
        Built:             Wed Mar 11 01:25:46 2020
        OS/Arch:           linux/amd64
        Experimental:      false
       
       Server: Docker Engine - Community
        Engine:
         Version:          19.03.8
         API version:      1.40 (minimum version 1.12)
         Go version:       go1.12.17
         Git commit:       afacb8b7f0
         Built:            Wed Mar 11 01:24:19 2020
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.2.13
         GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
        runc:
         Version:          1.0.0-rc10
         GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
        docker-init:
         Version:          0.18.0
         GitCommit:        fec3683
-----> docker daemon info: 
WARNING: No swap limit support
       Client:
        Debug Mode: true
       
       Server:
        Containers: 24
         Running: 0
         Paused: 0
         Stopped: 24
        Images: 29
        Server Version: 19.03.8
        Storage Driver: overlay2
         Backing Filesystem: <unknown>
         Supports d_type: true
         Native Overlay Diff: true
        Logging Driver: json-file
        Cgroup Driver: cgroupfs
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
        Swarm: inactive
        Runtimes: runc
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
        runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
        init version: fec3683
        Security Options:
         apparmor
         seccomp
          Profile: default
        Kernel Version: 4.15.0-66-generic
        Operating System: Ubuntu 18.04.3 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 1
        Total Memory: 1.947GiB
        Name: c1-primary
        ID: YC32:7M7Y:KSRW:DA6S:G73T:ZZ2S:NVZG:QPLI:3WMI:AYBK:HEFI:5VDA
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Registry: https://index.docker.io/v1/
        Labels:
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false
       
-----> sigil version: 0.5.0
-----> herokuish version: 
       herokuish: 0.5.12
       buildpacks:
         heroku-buildpack-multi     v1.0.0
         heroku-buildpack-ruby      v215
         heroku-buildpack-nodejs    v170
         heroku-buildpack-clojure   v84
         heroku-buildpack-python    v169
         heroku-buildpack-java      v66
         heroku-buildpack-gradle    v31
         heroku-buildpack-scala     v87
         heroku-buildpack-play      v26
         heroku-buildpack-php       v173
         heroku-buildpack-go        v141
         buildpack-nginx            v13
-----> dokku version: dokku version 0.20.4
-----> dokku plugins: 
       plugn: 0.3.2
         00_dokku-standard    0.20.4 enabled    dokku core standard plugin
         20_events            0.20.4 enabled    dokku core events logging plugin
         app-json             0.20.4 enabled    dokku core app-json plugin
         apps                 0.20.4 enabled    dokku core apps plugin
         builder-dockerfile   0.20.4 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.20.4 enabled    dokku core builder-herokuish plugin
         buildpacks           0.20.4 enabled    dokku core buildpacks plugin
         certs                0.20.4 enabled    dokku core certificate management plugin
         checks               0.20.4 enabled    dokku core checks plugin
         common               0.20.4 enabled    dokku core common plugin
         config               0.20.4 enabled    dokku core config plugin
         docker-options       0.20.4 enabled    dokku core docker-options plugin
         domains              0.20.4 enabled    dokku core domains plugin
         enter                0.20.4 enabled    dokku core enter plugin
         git                  0.20.4 enabled    dokku core git plugin
         ha-dokku             0.1.0 enabled    ensures all applications are configured for deployment to a remote registry
         logs                 0.20.4 enabled    dokku core logs plugin
         network              0.20.4 enabled    dokku core network plugin
         nginx-vhosts         0.20.4 enabled    dokku core nginx-vhosts plugin
         plugin               0.20.4 enabled    dokku core plugin plugin
         proxy                0.20.4 enabled    dokku core proxy plugin
         ps                   0.20.4 enabled    dokku core ps plugin
         registry             0.5.1 enabled    manages integration with remote docker registries
         repo                 0.20.4 enabled    dokku core repo plugin
         resource             0.20.4 enabled    dokku core resource plugin
         scheduler-docker-local 0.20.4 enabled    dokku core scheduler-docker-local plugin
         scheduler-kubernetes 0.17.2 enabled    dokku scheduler-kubernetes plugin
         shell                0.20.4 enabled    dokku core shell plugin
         ssh-keys             0.20.4 enabled    dokku core ssh-keys plugin
         storage              0.20.4 enabled    dokku core storage plugin
         tags                 0.20.4 enabled    dokku core tags plugin
         tar                  0.20.4 enabled    dokku core tar plugin
         trace                0.20.4 enabled    dokku core trace plugin

How (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Installed on DO via terraform (tf-dokku-do-kubernetes)

Additional information

  • Output of failing Dokku commands after running dokku trace:on
    (BEWARE: trace:on will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXX):
+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest
+ DOKKU_IMAGE=gliderlabs/herokuish:latest
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_SYSTEM_GROUP=dokku
+ DOKKU_SYSTEM_GROUP=dokku
+ export DOKKU_SYSTEM_USER=dokku
+ DOKKU_SYSTEM_USER=dokku
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_PID=6177
+ DOKKU_PID=6177
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export 'DOKKU_GLOBAL_BUILD_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_BUILD_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ export 'DOKKU_GLOBAL_RUN_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_RUN_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args logs XXXXXX --tail
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ local flags
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ logs == \-\-\a\p\p ]]
+ [[ logs =~ ^--.* ]]
+ next_index=2
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ XXXXXX == \-\-\a\p\p ]]
+ [[ XXXXXX =~ ^--.* ]]
+ next_index=3
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ --tail == \-\-\a\p\p ]]
+ [[ --tail =~ ^--.* ]]
+ flags=' --tail'
+ next_index=4
+ [[ -z '' ]]
++ sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
++ echo -e ' --tail'
+ export DOKKU_GLOBAL_FLAGS=--tail
+ DOKKU_GLOBAL_FLAGS=--tail
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ logs =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ LC_ALL=C
++ /usr/bin/tty
+ [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ root != \d\o\k\k\u ]]
+ [[ ! logs =~ plugin:* ]]
+ [[ logs != \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ logs != \s\s\h\-\k\e\y\s\:\r\e\m\o\v\e ]]
++ id -un
+ export SSH_USER=root
+ SSH_USER=root
+ sudo -u dokku -E -H /usr/bin/dokku logs XXXXXX --tail
+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest
+ DOKKU_IMAGE=gliderlabs/herokuish:latest
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_SYSTEM_GROUP=dokku
+ DOKKU_SYSTEM_GROUP=dokku
+ export DOKKU_SYSTEM_USER=dokku
+ DOKKU_SYSTEM_USER=dokku
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_PID=6187
+ DOKKU_PID=6187
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export 'DOKKU_GLOBAL_BUILD_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_BUILD_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ export 'DOKKU_GLOBAL_RUN_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_RUN_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args logs XXXXXX --tail
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=("$@")
+ local args
+ local flags
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ logs == \-\-\a\p\p ]]
+ [[ logs =~ ^--.* ]]
+ next_index=2
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ XXXXXX == \-\-\a\p\p ]]
+ [[ XXXXXX =~ ^--.* ]]
+ next_index=3
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ --tail == \-\-\a\p\p ]]
+ [[ --tail =~ ^--.* ]]
+ flags=' --tail'
+ next_index=4
+ [[ -z --tail ]]
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ logs =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
++ LC_ALL=C
++ /usr/bin/tty
+ [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ logs =~ ^plugin:.* ]]
+ [[ logs == \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ logs == \s\s\h\-\k\e\y\s\:\r\e\m\o\v\e ]]
+ [[ -n '' ]]
+ dokku_auth logs XXXXXX --tail
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=root
+ SSH_USER=root
+ export SSH_NAME=default
+ SSH_NAME=default
++ wc -l
++ find /var/lib/dokku/plugins/enabled/20_events/user-auth
+ [[ 1 == 1 ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd logs XXXXXX --tail
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=logs
+ local PLUGIN_CMD=logs
+ local implemented=0
+ local script
+ argv=("$@")
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/logs
+ [[ /var/lib/dokku/core-plugins/available/logs == *core-plugins* ]]
+ [[ logs == \l\o\g\s ]]
+ shift 1
+ [[ -n '' ]]
+ set -- logs XXXXXX --tail
+ [[ -x /var/lib/dokku/plugins/enabled/logs/subcommands/default ]]
+ /var/lib/dokku/plugins/enabled/logs/subcommands/default logs XXXXXX --tail
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/logs/internal-functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ cmd-logs-default logs XXXXXX --tail
+ declare 'desc=display recent log output'
+ declare cmd=logs
+ [[ logs == \l\o\g\s ]]
+ shift 1
+ declare APP=XXXXXX
+ [[ -z XXXXXX ]]
+ verify_app_name XXXXXX
+ declare 'desc=verify app name format and app existence'
+ local APP=XXXXXX
+ is_valid_app_name XXXXXX
+ declare 'desc=verify app name format'
+ local APP=XXXXXX
+ [[ -z XXXXXX ]]
+ [[ XXXXXX =~ ^[a-z].* ]]
+ [[ ! XXXXXX =~ [A-Z] ]]
+ [[ ! XXXXXX =~ [:] ]]
+ return 0
+ [[ ! -d /home/dokku/XXXXXX ]]
+ return 0
+ is_deployed XXXXXX
+ declare 'desc=return 0 if given app has a running container'
+ local APP=XXXXXX
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ get_app_scheduler XXXXXX
++ declare 'desc=fetch the scheduler for a given application'
++ declare APP=XXXXXX
++ local DOKKU_APP_SCHEDULER DOKKU_GLOBAL_SCHEDULER DOKKU_SCHEDULER
++ [[ XXXXXX == \-\-\g\l\o\b\a\l ]]
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ [[ -n XXXXXX ]]
+++ config_get XXXXXX DOKKU_SCHEDULER
+++ declare 'desc=get value of given config var'
+++ config_sub get XXXXXX DOKKU_SCHEDULER
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/subcommands/get config:get XXXXXX DOKKU_SCHEDULER
+++ true
++ DOKKU_APP_SCHEDULER=
+++ config_get --global DOKKU_SCHEDULER
+++ declare 'desc=get value of given config var'
+++ config_sub get --global DOKKU_SCHEDULER
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/subcommands/get config:get --global DOKKU_SCHEDULER
++ DOKKU_GLOBAL_SCHEDULER=kubernetes
++ DOKKU_SCHEDULER=kubernetes
++ [[ -z kubernetes ]]
++ echo kubernetes
+ local DOKKU_SCHEDULER=kubernetes
+ plugn trigger scheduler-is-deployed kubernetes XXXXXX
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ trigger-scheduler-docker-local-scheduler-is-deployed kubernetes XXXXXX
+ declare 'desc=checks if an app is deployed'
+ declare trigger=scheduler-is-deployed
+ declare DOKKU_SCHEDULER=kubernetes APP=XXXXXX
+ [[ kubernetes != \d\o\c\k\e\r\-\l\o\c\a\l ]]
+ return
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/core-plugins/available/common/property-functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/scheduler-kubernetes/internal-functions
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/core-plugins/available/common/property-functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/domains/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ scheduler-kubernetes-scheduler-is-deployed kubernetes XXXXXX
+ declare 'desc=scheduler-kubernetes scheduler-is-deployed plugin trigger'
+ declare 'trigger=scheduler-kubernetes scheduler-is-deployed'
+ declare DOKKU_SCHEDULER=kubernetes APP=XXXXXX
+ local KUBE_OUTPUT
+ [[ kubernetes != \k\u\b\e\r\n\e\t\e\s ]]
+ export KUBECONFIG=/home/dokku/.kube/config
+ KUBECONFIG=/home/dokku/.kube/config
+ export KUBEDOG_KUBE_CONFIG=/home/dokku/.kube/config
+ KUBEDOG_KUBE_CONFIG=/home/dokku/.kube/config
+ KUBE_ARGS=()
++ fn-plugin-property-get scheduler-kubernetes XXXXXX namespace ''
++ declare 'desc=returns the value for a given property'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=
++ fn-plugin-property-get-default scheduler-kubernetes XXXXXX namespace ''
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default scheduler-kubernetes XXXXXX namespace ''
+ NAMESPACE=
++ fn-plugin-property-get scheduler-kubernetes XXXXXX namespace default
++ declare 'desc=returns the value for a given property'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=default
++ fn-plugin-property-get-default scheduler-kubernetes XXXXXX namespace default
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=default
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default scheduler-kubernetes XXXXXX namespace default
+ NAMESPACE=default
+ KUBE_ARGS+=("--namespace=$NAMESPACE")
+ fn-scheduler-kubernetes-ensure-namespace default
+ declare NAMESPACE=default
+ [[ default = \d\e\f\a\u\l\t ]]
+ return
++ /var/lib/dokku/data/scheduler-kubernetes/kubectl --namespace=default get pods --selector app=XXXXXX -o name
+ KUBE_OUTPUT='pod/XXXXXX-web-85759c6c55-9hpkj
pod/XXXXXX-web-85759c6c55-d6797
pod/XXXXXX-web-85759c6c55-pwmc8'
+ [[ -n pod/XXXXXX-web-85759c6c55-9hpkj
pod/XXXXXX-web-85759c6c55-d6797
pod/XXXXXX-web-85759c6c55-pwmc8 ]]
+ return 0
+ shift 1
++ getopt -o htqn:p: --long help,tail,quiet,num:,ps: -n 'dokku logs' -- --tail
+ local 'TEMP= --tail --'
+ local EXIT_CODE=0
+ [[ 0 != 0 ]]
+ eval set -- ' --tail --'
++ set -- --tail --
+ local NUM=100
+ true
+ case "$1" in
+ local TAIL=true
+ shift
+ true
+ case "$1" in
+ shift
+ break
++ get_app_scheduler XXXXXX
++ declare 'desc=fetch the scheduler for a given application'
++ declare APP=XXXXXX
++ local DOKKU_APP_SCHEDULER DOKKU_GLOBAL_SCHEDULER DOKKU_SCHEDULER
++ [[ XXXXXX == \-\-\g\l\o\b\a\l ]]
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ [[ -n XXXXXX ]]
+++ config_get XXXXXX DOKKU_SCHEDULER
+++ declare 'desc=get value of given config var'
+++ config_sub get XXXXXX DOKKU_SCHEDULER
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/subcommands/get config:get XXXXXX DOKKU_SCHEDULER
+++ true
++ DOKKU_APP_SCHEDULER=
+++ config_get --global DOKKU_SCHEDULER
+++ declare 'desc=get value of given config var'
+++ config_sub get --global DOKKU_SCHEDULER
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/subcommands/get config:get --global DOKKU_SCHEDULER
++ DOKKU_GLOBAL_SCHEDULER=kubernetes
++ DOKKU_SCHEDULER=kubernetes
++ [[ -z kubernetes ]]
++ echo kubernetes
+ DOKKU_SCHEDULER=kubernetes
+ plugn trigger scheduler-logs kubernetes XXXXXX '' true '' 100
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ trigger-scheduler-docker-local-scheduler-logs kubernetes XXXXXX '' true '' 100
+ declare 'desc=scheduler-docker-local scheduler-logs plugin trigger'
+ declare trigger=scheduler-logs
+ declare DOKKU_SCHEDULER=kubernetes APP=XXXXXX PROCESS_TYPE= TAIL=true PRETTY_PRINT= NUM=100
+ local DOKKU_LOGS_ARGS=
+ [[ kubernetes != \d\o\c\k\e\r\-\l\o\c\a\l ]]
+ return
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/core-plugins/available/common/property-functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/scheduler-kubernetes/internal-functions
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/core-plugins/available/common/property-functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/domains/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ scheduler-kubernetes-scheduler-logs kubernetes XXXXXX '' true '' 100
+ declare 'desc=scheduler-kubernetes scheduler-logs plugin trigger'
+ declare 'trigger=scheduler-kubernetes scheduler-logs'
+ declare DOKKU_SCHEDULER=kubernetes APP=XXXXXX PROCESS_TYPE= TAIL=true PRETTY_PRINT= NUM=100
+ local KUBE_ARGS NAMESPACE
+ [[ kubernetes != \k\u\b\e\r\n\e\t\e\s ]]
+ local LABEL=app=XXXXXX
+ [[ -n '' ]]
+ export KUBECONFIG=/home/dokku/.kube/config
+ KUBECONFIG=/home/dokku/.kube/config
+ export KUBEDOG_KUBE_CONFIG=/home/dokku/.kube/config
+ KUBEDOG_KUBE_CONFIG=/home/dokku/.kube/config
+ KUBE_ARGS=()
++ fn-plugin-property-get scheduler-kubernetes XXXXXX namespace default
++ declare 'desc=returns the value for a given property'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=default
++ fn-plugin-property-get-default scheduler-kubernetes XXXXXX namespace default
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=scheduler-kubernetes APP=XXXXXX KEY=namespace DEFAULT=default
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default scheduler-kubernetes XXXXXX namespace default
+ NAMESPACE=default
+ KUBE_ARGS+=("--namespace=$NAMESPACE")
+ fn-scheduler-kubernetes-ensure-namespace default
+ declare NAMESPACE=default
+ [[ default = \d\e\f\a\u\l\t ]]
+ return
+ local 'LOGS_ARGS=--tail 100'
+ [[ true == \t\r\u\e ]]
+ LOGS_ARG+=' --follow '
+ /var/lib/dokku/data/scheduler-kubernetes/kubectl --namespace=default logs -l app=XXXXXX
    at /app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:314:20)
    at SendStream.EventEmitter.emit (domain.js:483:12)
    at SendStream.error (/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/app/node_modules/send/index.js:421:12)
    at next (/app/node_modules/send/index.js:736:16)
    at onstat (/app/node_modules/send/index.js:725:14)
    at /app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:314:20)
    at SendStream.EventEmitter.emit (domain.js:483:12)
    at SendStream.error (/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/app/node_modules/send/index.js:421:12)
    at next (/app/node_modules/send/index.js:736:16)
    at onstat (/app/node_modules/send/index.js:725:14)
    at /app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at SendStream.error (/app/node_modules/serve-static/index.js:121:7)
    at SendStream.emit (events.js:314:20)
    at SendStream.EventEmitter.emit (domain.js:483:12)
    at SendStream.error (/app/node_modules/send/index.js:270:17)
    at SendStream.onStatError (/app/node_modules/send/index.js:421:12)
    at next (/app/node_modules/send/index.js:736:16)
    at onstat (/app/node_modules/send/index.js:725:14)
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]
+ exit 0

Doc: specify required nginx-ingress installation settings for popular k8s cloud providers

If you're using Dokku - especially for commercial purposes - consider donating to project development via OpenCollective or Patreon. Funds go to general development, support, and infrastructure costs.

If you'd like to sponsor specific functionality, see the project's Sponsoring document.

If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version before filing an issue.

Description of problem

In AKS, the nginx ingress controller requires service annotations defined as in https://learn.microsoft.com/en-us/azure/aks/ingress-basic?tabs=azure-cli#basic-configuration AWS and other perhaps have theirs as well

How reproducible

Install ingress without the service annotations on AKS

Steps to Reproduce

Actual Results

Expected Results

Environment Information

dokku report APP_NAME output

This is required! Issues missing this information may be closed.

For problems affecting all applications, the report output for a broken application is useful for our debugging.
In these cases, you may run dokku report without any arguments to display the top-level reporting information.

How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Additional information

  • App container inspect output (if applicable) via dokku ps:inspect APP_NAME
  • The nginx configuration (if applicable) via dokku nginx:show-config APP_NAME
  • Link to the exact repository being deployed (if possible/applicable):
  • Output of failing Dokku commands after running dokku trace:on
    (BEWARE: trace:on will print environment variables for some commands, be sure you're not exposing any sensitive information when posting issues. You may replace these values with XXXXXX):

Supporting different ingress controllers

Description of problem

I have a k3s cluster running on a couple of raspberry pis - this ships with a traeffik ingress controller (which works nicely for me) - I was wondering if the project would be open to a contribution that adds support for using an "external" (already provisioned) ingress controller to support such use cases.

If so I'd gladly chime in and see if I can make it work.

Thanks for keeping up the great work with dokku and making it scale more! ❤️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.