Skip to content

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. Workers can be used to:

  1. Run custom functions, invoked by naming the worker on a request, Trigger or Invocation
  2. Serve as an identity a GitOps tool pulls a Target's Releases as, by granting the worker's bot user View and ViewChildren on the Target (--is-server-worker needs no process to run)

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)"

  # Create a server-hosted worker and let it pull from a Target
  cub worker create --space infra --is-server-worker argo
  bot=$(cub worker get --space infra argo -o jq=.BridgeWorker.UserID)
  cub target update --space infra prod --permission View:$bot --permission ViewChildren:$bot
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 JSON from file, URL (https://), or stdin (-); mutually exclusive with --from-stdin
      --from-stdin             Read the ConfigHub entity JSON (e.g., retrieved with cub <entity> get --quiet --json) from stdin; merged with command arguments on create, and merged with command arguments and existing entity on update
  -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, member, 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 (e.g., Manage:user@example.com, can be repeated)
      --quiet                  No default output.
      --verbose                Detailed output, additive with default output

Options inherited from parent commands

      --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>

SEE ALSO