oc-adm-create-master-certs man page

oc adm create-master-certs -


oc adm create-master-certs [Options]


Create keys and certificates for a master

This command creates keys and certs necessary to run a secure master. It also creates keys, certificates, and configuration necessary for most related infrastructure components that are clients to the master. See the related "create-node-config" command for generating per-node config.

All files are expected or created in standard locations under the cert-dir.


Note that the certificate authority (CA aka "signer") generated automatically is self-signed. In production usage, administrators are more likely to want to generate signed certificates separately rather than rely on a generated CA. Alternatively, start with an existing signed CA and have this command use it to generate valid certificates.

This command would usually only be used once at installation. If you need to regenerate the master server cert, DO NOT use --overwrite as this would recreate ALL certs including the CA cert, invalidating any existing infrastructure or client configuration. Instead, delete/rename the existing server cert and run the command to fill it in:

mv openshift.local.config/master/master.server.crt{,.old}
 oc adm create-master-certs --cert-dir=... \
         --master= ⟨https://internal.master.fqdn:8443⟩ \
         --public-master= ⟨https://external.master.fqdn:8443⟩ \

Alternatively, use the related "ca create-server-cert" command to explicitly create a certificate.

Regardless of --overwrite, the master server key/cert will be updated if --hostnames does not match the current certificate. Regardless of --overwrite, .kubeconfig files will be updated every time this command is run, so always specify --master (and if needed, --public-master). This is designed to match the behavior of "start" which rewrites certs/confs for certain configuration changes.



The certificate data directory.


Optional files containing signing authorities to use (in addition to the generated signer) to verify the API server's serving certificate.


Validity of the certificates in days (defaults to 2 years). WARNING: extending this above default value is highly discouraged.


Every hostname or IP that server certs should be valid for (comma-delimited list)

--master=" ⟨https://localhost:8443"⟩

The API server's URL.


Overwrite all existing cert/key/config files (WARNING: includes signer/CA)


The API public facing server's URL (if applicable).


Validity of the CA certificate in days (defaults to 5 years). WARNING: extending this above default value is highly discouraged.


The name to use for the generated signer.

Options Inherited from Parent Commands


Username to impersonate for the operation


Group to impersonate for the operation, this flag can be repeated to specify multiple groups.


Path to the file container Azure container registry configuration information.


Default HTTP cache directory


Path to a client certificate file for TLS


Path to a client key file for TLS


The name of the kubeconfig cluster to use


Path to the config file to use for CLI requests.


The name of the kubeconfig context to use


The Google Cloud Platform Service Account JSON Key to use for authentication.


If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure


Require server version to match client version

-n, --namespace=""

If present, the namespace scope for this CLI request


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.


The address and port of the Kubernetes API server


Bearer token for authentication to the API server


The name of the kubeconfig user to use


Print version information and quit

See Also



June 2016, Ported from the Kubernetes man-doc generator

Referenced By


Openshift CLI User Manuals June 2016