@when('kube-control.gpu.available')
@when('kubernetes-master.components.started')
@when_not('kubernetes-master.gpu.enabled')
def on_gpu_available(kube_control):
    'The remote side (kubernetes-worker) is gpu-enabled.\n\n    We need to run in privileged mode.\n\n    '
    config = hookenv.config()
    if (config['allow-privileged'] == 'false'):
        hookenv.status_set('active', 'GPUs available. Set allow-privileged="auto" to enable.')
        return
    remove_state('kubernetes-master.components.started')
    set_state('kubernetes-master.gpu.enabled')
The remote side (kubernetes-worker) is gpu-enabled.

We need to run in privileged mode.
@when('kube-control.gpu.available')
@when('kubernetes-master.components.started')
@when_not('kubernetes-master.gpu.enabled')
def on_gpu_available(kube_control):
    'The remote side (kubernetes-worker) is gpu-enabled.\n\n    We need to run in privileged mode.\n\n    '
    config = hookenv.config()
    if (config['allow-privileged'] == 'false'):
        hookenv.status_set('active', 'GPUs available. Set allow-privileged="auto" to enable.')
        return
    remove_state('kubernetes-master.components.started')
    set_state('kubernetes-master.gpu.enabled')