⎈ k8s knowledge compiler

kubectl create secret tls [page]deterministic

Create a TLS secret

referencesecurity

##

Create a TLS secret from the given public/private key pair.

The public/private key pair must exist beforehand. The public key certificate must be .PEM encoded and match the given private key.

``` kubectl create secret tls NAME --cert=path/to/cert/file --key=path/to/key/file [--dry-run=server|client|none] ```

##

``` # Create a new TLS secret named tls-secret with the given key pair kubectl create secret tls tls-secret --cert=path/to/tls.crt --key=path/to/tls.key ```

##

<table style="width: 100%; table-layout: fixed;"> <colgroup> <col span="1" style="width: 10px;" /> <col span="1" /> </colgroup> <tbody>

<tr> <td colspan="2">--allow-missing-template-keys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: true</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>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.</p></td> </tr>

<tr> <td colspan="2">--append-hash</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Append a hash of the secret to its name.</p></td> </tr>

<tr> <td colspan="2">--cert string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Path to PEM encoded public key certificate.</p></td> </tr>

<tr> <td colspan="2">--dry-run string[="unchanged"]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "none"</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Must be &quot;none&quot;, &quot;server&quot;, or &quot;client&quot;. If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource.</p></td> </tr>

<tr> <td colspan="2">--field-manager string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "kubectl-create"</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Name of the manager used to track field ownership.</p></td> </tr>

<tr> <td colspan="2">-h, --help</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>help for tls</p></td> </tr>

<tr> <td colspan="2">--key string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Path to private key associated with given certificate.</p></td> </tr>

<tr> <td colspan="2">-o, --output string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file).</p></td> </tr>

<tr> <td colspan="2">--save-config</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.</p></td> </tr>

<tr> <td colspan="2">--show-managed-fields</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>If true, keep the managedFields when printing objects in JSON or YAML format.</p></td> </tr>

<tr> <td colspan="2">--template string</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>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].</p></td> </tr>

<tr> <td colspan="2">--validate string[="strict"]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "strict"</td> </tr> <tr> <td></td><td style="line-height: 130%; word-wrap: break-word;"><p>Must be one of: strict (or true), warn, ignore (or false). &quot;true&quot; or &quot;strict&quot; will use a schema to validate the input and fail the request if invalid. It will perform server side validation if ServerSideFieldValidation is enabled on the api-server, but will fall back to less reliable client-side validat …(trimmed)

Sources

reference/kubectl/generated/kubectl_create/kubectl_create_secret_tls.md · dockubectl create secret tls

Related (6)

part_of {{% heading "synopsis" %}}describes conf=1
part_of {{% heading "examples" %}}describes conf=1
part_of {{% heading "options" %}}describes conf=1
part_of {{% heading "parentoptions" %}}describes conf=1
part_of {{% heading "seealso" %}}describes conf=1
api_for Secretdocuments API object conf=1

← all Docs