cub worker create
cub worker create
Create a worker
Synopsis
Create a worker in your environment.
The worker-slug must be unique within a space. A worker serves external functions, which are invoked by naming the worker on a request, Trigger or Invocation.
Workers are otherwise deprecated. The identity a GitOps tool pulls a Target's Releases as is a service account (cub serviceaccount create) granted View and ViewChildren on the Target. Existing server workers (--is-server-worker) that pull Releases keep working.
Examples:
# Create a worker in a space
cub worker create --space my-space k8s-worker-1
# Create a worker and fetch the credentials a worker process authenticates with
cub worker create --space my-space worker-1
eval "$(cub worker get-envs --space my-space worker-1)"
# The identity a GitOps tool pulls a Target's Releases as is a service account, not a worker
cub serviceaccount create argo
cub target update --space infra prod --permission View:serviceaccount:argo --permission ViewChildren:serviceaccount:argo
cub serviceaccount token create argo
cub worker create <worker-slug> [flags]
Options
--allow-exists Allow creation of resources that already exist
--annotation strings annotations in key=value format; can separate by commas and/or use multiple instances of the flag
--delete-gate strings delete gates in key[=true] format; can separate by commas and/or use multiple instances of the flag
--display-name string friendly name for the entity, which need not be unique or URL-safe; an entity without one is shown by its slug
--dry-run report what the command would write, and write nothing
--filename string Read the ConfigHub entity's fields, as YAML or JSON, from file, URL (https://), or stdin (-), as --from-stdin does; mutually exclusive with --from-stdin
--from-stdin Read the ConfigHub entity's fields, as YAML or JSON, from stdin; merged with command arguments on create, and merged with command arguments and existing entity on update. A field the entity does not have, or one only the server sets, is refused; cub <entity> explain lists the fields
-h, --help help for create
--hidden-reason string hide the entity, giving the reason as a name such as Archived: lists and bulk operations leave it out unless --include-hidden names the reason (use '-' to clear, which shows the entity again)
--is-server-worker mark this worker as a server-hosted worker
--label strings labels in key=value format; can separate by commas and/or use multiple instances of the flag
--org-role string organization-level role for the worker (admin, manager, editor, user, viewer, creator, or none); the default is none, which leaves the worker with only the permissions granted to its bot user
-o, --output string Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
--permission strings permission in format Action:UserIDOrUsername, Action:group:GroupSlugOrID for a group you belong to, or Action:serviceaccount:ServiceAccountSlugOrID (e.g., Manage:user@example.com, View:group:platform, View:serviceaccount:deploy-bot, can be repeated)
--quiet No default output.
--verbose Detailed output, additive with default output
Options inherited from parent commands
--component string the Component of --variant, when that names the variant alone; --variant <component>/<variant> says the same in one flag
--context string The context to use for this command
--debug Debug output
--space string space to operate in, by slug or UUID. Omitted, a list or bulk operation spans the organization and a single entity is named as <space>/<slug>; "*" means the same as omitting it
--variant string variant to operate in, as <component>/<variant>, or as <variant> with --component: the space naming that Component whose Variant label is <variant>. The same scope as --space, named by what it is rather than by the space's slug; the two cannot be combined
SEE ALSO
- cub worker - Manage workers