CmdID / kubectl / kubectl set
kubectl set env
Update environment variables on a pod template kubectl reference
21 options Its page in the kubectl reference
Options
--allIf true, select all resources in the namespace of the specified resource types--allow-missing-template-keysIf true, ignore any errors in templates when a field or map key is missing in the template.--containers, -cThe names of containers in the selected pod templates to change - may use wildcards--dry-runMust be "none", "server", or "client".--env, -eSpecify a key-value pair for an environment variable to set into each container.--field-managerName of the manager used to track field ownership.--filename, -fFilename, directory, or URL to files the resource to update the env--fromThe name of a resource from which to inject environment variables--help, -hhelp for env--keysComma-separated list of keys to import from specified resource--kustomize, -kProcess the kustomization directory.--listIf true, display the environment and any changes in the standard format.--localIf true, set env will NOT contact api-server but run locally.--output, -oOutput format.--overwriteIf true, allow environment to be overwritten, otherwise reject updates that overwrite existing environment.--prefixPrefix to append to variable names--recursive, -RProcess the directory used in -f, --filename recursively.--resolveIf true, show secret or configmap references when listing variables--selector, -lSelector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)).--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.--templateTemplate string or path to template file to use when -o=go-template, -o=go-template-file.