OC(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

✨ NAME ✨

hey bestie! πŸ’– so you're looking at the OC(1) manpage from June 2016, and we're about to dive into oc rollback β€” the command that literally rewinds part of your application back to a previous deployment. it's giving time machine energy, no cap. πŸ•°οΈ

oc rollback β€” revert part of an application back to a previous deployment. periodt. πŸ’…


🌸 SYNOPSIS 🌸

oc rollback [OPTIONS]

πŸ’… DESCRIPTION πŸ’…

okay so when you run this command, your deployment configuration gets updated to match a previous deployment. literally rewind. by default, only the pod and container configuration will be changed β€” scaling or trigger settings are left as-is. so the main character vibes change, but the side characters stay put. 🎭

⚠️ important tea: environment variables and volumes are included in rollbacks, so if you've recently updated security credentials in your environment, your previous deployment may not have the correct values. it's like rewinding a group chat and realizing you left the old messages on read. πŸ™ˆ

any image triggers present in the rolled back configuration will be disabled with a warning. this is to help prevent your rolled back deployment from being replaced by a triggered deployment soon after your rollback. basically, the triggers get benched so your rollback can have its moment. to re-enable the triggers, use the set triggers command. ✨

if you want to review the outcome of the rollback, pass --dry-run to print a human-readable representation of the updated deployment configuration instead of executing the rollback. this is useful if you're not sure what the outcome will be. it's like a preview before you post. πŸ‘€


πŸŽ€ OPTIONS πŸŽ€

  • --allow-missing-template-keys=true β€” if true, ignore any errors in templates when a field or map key is missing in the template. only applies to golang and jsonpath output formats. so if your template is a little messy, this lets it slide. πŸ’…
  • --change-scaling-settings=false β€” if true, include the previous deployment's replicationController replica count and selector in the rollback. so you're bringing back the old scaling vibes too. πŸ¦‹
  • --change-strategy=false β€” if true, include the previous deployment's strategy in the rollback. strategy = the plot twist of your deployment, and you can rewind it. πŸ”„
  • --change-triggers=false β€” if true, include the previous deployment's triggers in the rollback. triggers = what makes new deployments happen, so this lets you bring back the old triggers (but remember, they might be disabled by default β€” see description above!). ⚠️
  • -d, --dry-run=false β€” instead of performing the rollback, describe what the rollback will look like in human-readable form. literally just a preview, no cap. πŸ‘€
  • -o, --output="" β€” output format. one of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). pick your fave. πŸ’–
  • --show-managed-fields=false β€” if true, keep the managedFields when printing objects in JSON or YAML format. managedFields = the metadata tea, so this keeps it. 🍡
  • --template="" β€” template string or path to template file to use when -o=go-template, -o=go-template-file. the template format is golang templates [⟨http://golang.org/pkg/text/template/#pkg-overview⟩]. so if you're fancy with templates, this is your moment. ✨
  • --to-version=0 β€” a config version to rollback to. specifying version 0 is the same as omitting a version (the version will be auto-detected). this option is ignored when specifying a deployment. so you can pick a specific version, but 0 means auto-magic. πŸͺ„

πŸ¦‹ OPTIONS INHERITED FROM PARENT COMMANDS πŸ¦‹

  • --as="" β€” username to impersonate for the operation. user could be a regular user or a service account in a namespace. so you can be like "i'm someone else" for this operation. 🎭
  • --as-group=[] β€” group to impersonate for the operation, this flag can be repeated to specify multiple groups. you can stack these like friendship bracelets. πŸ“Ώ
  • --as-uid="" β€” UID to impersonate for the operation. that's the user ID, not the vibe. πŸ’³
  • --as-user-extra=[] β€” user extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. extra extra, read all about it. πŸ“°
  • --cache-dir="/homeless-shelter/.kube/cache" β€” default cache directory. it's literally where the cache lives, no cap. πŸ—‚οΈ
  • --certificate-authority="" β€” path to a cert file for the certificate authority. CA = the trust anchor, so this is important for security. πŸ”’
  • --client-certificate="" β€” path to a client certificate file for TLS. TLS = the secure handshake, and this is your client's ID. πŸ’³
  • --client-key="" β€” path to a client key file for TLS. the key to your client cert, keep it secret. 🀫
  • --cluster="" β€” the name of the kubeconfig cluster to use. pick your cluster like you pick a filter. 🌸
  • --context="" β€” the name of the kubeconfig context to use. context = the whole vibe of cluster+user+namespace, so this is a big deal. πŸ’…
  • --disable-compression=false β€” if true, opt-out of response compression for all requests to the server. so no zipping, just raw data. πŸ“¦
  • --insecure-skip-tls-verify=false β€” if true, the server's certificate will not be checked for validity. this will make your HTTPS connections insecure. > ⚠️ WARNING: this is literally insecure, so only do it if you know what you're doing! no cap, this is a security risk. 🚨
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests. kubeconfig = the config file that knows your clusters, so point it where you need. πŸ“
  • --kuberc="" β€” path to the kuberc file to use for preferences. this can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off. kuberc = your preferences file, and you can turn it off two ways. πŸŽ›οΈ
  • --match-server-version=false β€” require server version to match client version. so if true, the server and client must be twinning exactly. πŸ‘―
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request. namespaces = the rooms in your cluster, so this picks which room. πŸšͺ
  • --profile="none" β€” name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex). profiling = performance tea, and you can pick which one. 🍡
  • --profile-output="profile.pprof" β€” name of the file to write the profile to. where the profiling data goes, default is profile.pprof. πŸ“
  • --request-timeout="0" β€” the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). a value of zero means don't timeout requests. so 0 = wait forever, no cap. ⏳
  • -s, --server="" β€” the address and port of the Kubernetes API server. the server = where the magic happens, so point it there. 🌐
  • --tls-server-name="" β€” server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used. so this overrides the name for cert checks. 🎯
  • --token="" β€” bearer token for authentication to the API server. token = your key to the kingdom, keep it secret. πŸ—οΈ
  • --user="" β€” the name of the kubeconfig user to use. pick the user like you pick a username. πŸ‘€
  • --warnings-as-errors=false β€” treat warnings received from the server as errors and exit with a non-zero exit code. so warnings become dealbreakers, and the command will fail. πŸ’€

🌈 EXAMPLE 🌈

okay bestie, here are some real examples to slay your rollback game:

# Perform a rollback to the last successfully completed deployment for a deployment config
oc rollback frontend

# See what a rollback to version 3 will look like, but do not perform the rollback
oc rollback frontend --to-version=3 --dry-run

# Perform a rollback to a specific deployment
oc rollback frontend-2

# Perform the rollback manually by piping the JSON of the new config back to oc
oc rollback frontend -o json | oc replace dc/frontend -f -

# Print the updated deployment configuration in JSON format instead of performing the rollback
oc rollback frontend -o json

πŸ”₯ SEE ALSO πŸ”₯

also check out oc(1) for the whole OpenShift CLI fam. πŸ’–


πŸ“œ HISTORY πŸ“œ

fun fact: this manpage is from June 2016, and it's ported from the Kubernetes man-doc generator. iconic. πŸ“œ


this page is part of the Openshift CLI User Manuals, version Openshift, dated June 2016. made with πŸ’– by your favorite Unix bestie. stay slaying! πŸ‘‘βœ¨

πŸ“¦ where this page comes from