OC-ADM-MIGRATE-TEMPLATE-INSTANCES(1)
π oc adm migrate template-instances β bestie edition
okay so real talk, this page lives in the Openshift CLI User Manuals and it's dated June 2016 β vintage, honestly, but still iconic. Let's get into it β¨
πΈ NAME
oc adm migrate template-instances β the glow-up command that updates your template instances so they point at the latest group-version-kinds π«Ά
π¦ SYNOPSIS
oc adm migrate template-instances [OPTIONS]
β¨ DESCRIPTION
So basically: migrate your template instances so they refer to the new API groups. It's giving "out with the old, in with the new" π
Here's the whole vibe β this command locates and updates every single template instance that refers to one particular group-version-kind, and makes it refer to some other, equivalent group-version-kind instead.
It's literally a matchmaking service for GVKs, no cap π
The following transformations will occur (these are exact, don't @ me):
.Build-->build.openshift.io/v1.Build.BuildConfig-->build.openshift.io/v1.BuildConfig.DeploymentConfig-->apps.openshift.io/v1.DeploymentConfig.Route-->route.openshift.io/v1.Routev1.Build-->build.openshift.io/v1.Buildv1.BuildConfig-->build.openshift.io/v1.BuildConfigv1.DeploymentConfig-->apps.openshift.io/v1.DeploymentConfigv1.Route-->route.openshift.io/v1.Route
π OPTIONS
-A,--all-namespaces=trueβ migrate objects in all namespaces, every single one of them. Defaults totrue. she's thorough π--allow-missing-template-keys=trueβ iftrue, just ignore any errors in templates when a field or map key is missing from the template. ngl this only applies togolangandjsonpathoutput formats, iykyk.--confirm=falseβ iftrue, all requested objects will be migrated. Defaults tofalse. yes bestie, nothing actually happens until you say confirm π-f,--filename=[]β filename, directory, or URL todocker-compose.ymlfile to use--from-key=""β if specified, only migrate items with a key (namespace/nameorname) greater than or equal to this value--include=[templateinstance]β resource types to migrate. heads up: passing--filenamewill override this flag π-o,--output=""β output format. one of: (json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file)--show-managed-fields=falseβ iftrue, keep themanagedFieldswhen printing objects in JSON or YAML format. keep the receipts, honestly π--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β© ] π--to-key=""β if specified, only migrate items with a key (namespace/nameorname) less than this value
π§ OPTIONS INHERITED FROM PARENT COMMANDS
these are the hand-me-downs from the parent command, and yes they're all still cute:
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace.--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups π--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory--certificate-authority=""β path to a cert file for the certificate authority--client-certificate=""β path to a client certificate file for TLS--client-key=""β path to a client key file for TLS--cluster=""β the name of the kubeconfig cluster to use--context=""β the name of the kubeconfig context to use--disable-compression=falseβ iftrue, opt-out of response compression for all requests to the server--insecure-skip-tls-verify=falseβ iftrue, the server's certificate will not be checked for validity. β οΈ this will make your HTTPS connections insecure β like, actually, be careful bestie.--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version-n,--namespace=""β if present, the namespace scope for this CLI request--profile="none"β name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex)--profile-output="profile.pprof"β name of the file to write the profile to--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. she waits forever, loyal queen π«Ά-s,--server=""β the address and port of the Kubernetes API server--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--token=""β bearer token for authentication to the API server--user=""β the name of the kubeconfig user to use--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code π₯
π EXAMPLE
ok so first, a dry-run of updating all objects β literally just vibe-checking what would happen, no commitment:
# Perform a dry-run of updating all objects
oc adm migrate template-instances
then to actually perform the update, the confirm flag must be appended. main character move π:
# To actually perform the update, the confirm flag must be appended
oc adm migrate template-instances --confirm
β οΈ reminder from your girl: without --confirm, it's a dry-run. she will not touch anything. it's giving "look but don't touch" π
π SEE ALSO
π HISTORY
June 2016 β Ported from the Kubernetes man-doc generator. old money, honestly. vintage. archival. we respect her πΈ
π that's the whole page bestie π
and shoutout to the source: this one comes from Openshift β the Openshift CLI User Manuals β dated June 2016. mwah, go migrate some template instances, ilysm π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms