OC-SECRETS-LINK(1)

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

Okay so real quick β€” this is oc secrets link, straight out of the OC SECRETS(1) manual, and it's from June 2016 if you were wondering how vintage we're going πŸŽ€. Buckle up, we're linking secrets to service accounts and it's gonna be iconic.


✨ NAME ✨

oc secrets link β€” link secrets to a service account 🫢


✨ SYNOPSIS ✨

oc secrets link [OPTIONS]

🌸 DESCRIPTION 🌸

So like. You're linking secrets to a service account. That's the whole thing, no cap.

Why do you care? Because linking a secret enables a service account to automatically use that secret for some forms of authentication πŸ’…. Basically you're handing the service account a little key and going "here bestie, use this." The way that works is lowkey magical but it's literally just one command, we love that for us ✨.


πŸ¦‹ OPTIONS πŸ¦‹

  • --for=[mount] β€” this is the type of secret you're linking, and your choices are mount or pull. That's it, those are the two πŸ’œ. Default is mount if you don't say anything, which, fair.

πŸ‘‘ OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

These aren't even ours, they're inherited, like a cute hand-me-down but for flags 🌈. Still gotta know them though, so here we go:

  • --as="" β€” username to impersonate for the operation. And like, the user could be a regular user or a service account in a namespace β€” either one, no judgement πŸ’–.
  • --as-group=[] β€” group to impersonate for the operation. Plot twist: this flag can be repeated to specify multiple groups πŸ”₯. Repeat away.
  • --as-uid="" β€” the UID to impersonate for the operation.
  • --as-user-extra=[] β€” user extras to impersonate for the operation. This flag can also be repeated to specify multiple values for the same key ✨.
  • --cache-dir="/homeless-shelter/.kube/cache" β€” the default cache directory. Yes, that's the actual path, I'm not making it up 😭.
  • --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 β€” if true, opt-out of response compression for all requests to the server.
  • --insecure-skip-tls-verify=false β€” if true, the server's certificate will not be checked for validity ⚠️. This will make your HTTPS connections insecure. Like, actually insecure. Be careful bestie πŸ™ˆ.
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests.
  • --kuberc="" β€” path to the kuberc file to use for preferences. You can disable this by exporting the KUBECTL_KUBERC=false feature gate, or by turning off the feature with KUBERC=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. Gotta be 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. Zero = infinite patience, main character energy honestly.
  • -s, --server="" β€” the address and port of the Kubernetes API server.
  • --tls-server-name="" β€” server name to use for server certificate validation. If it's 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 πŸ’€. Dramatic, but honestly valid.

πŸ”₯ EXAMPLE πŸ”₯

Okay here's where it gets good, copy these exactly, they're literally perfect πŸ“:

# Add an image pull secret to a service account to automatically use it for pulling pod images
oc secrets link serviceaccount-name pull-secret --for=pull

# Add an image pull secret to a service account to automatically use it for both pulling and pushing build images
oc secrets link builder builder-image-secret --for=pull,mount

See that second one? --for=pull,mount β€” both at once. Ate, no crumbs πŸ‘‘.


🧚 SEE ALSO 🧚

(iykyk, go read it, it's giving related content ✨)


🌺 HISTORY 🌺

June 2016, Ported from the Kubernetes man-doc generator β€” yes, this lore is from 2016, we stan an OG πŸ’œ.


Heads up bestie: this whole thing is from the Openshift CLI User Manuals, and the page itself is dated June 2016. Oof, vintage. But like, still slaps πŸ’…βœ¨

🌸 ok that's the whole page, you're basically an expert now, go link some secrets fr fr πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from