Reference documentation and code samples for the Google Cloud Container V1 Client class MasterAuth.
The authentication information for accessing the master endpoint.
Authentication can be done using HTTP basic auth or using client
certificates.
Generated from protobuf messagegoogle.container.v1.MasterAuth
Namespace
Google \ Cloud \ Container \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ username
string
The username to use for HTTP basic authentication to the master endpoint. For clusters v1.6.0 and later, basic authentication can be disabled by leaving username unspecified (or setting it to the empty string). Warning: basic authentication is deprecated, and will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
↳ password
string
The password to use for HTTP basic authentication to the master endpoint. Because the master endpoint is open to the Internet, you should create a strong password. If a password is provided for cluster creation, username must be non-empty. Warning: basic authentication is deprecated, and will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
Configuration for client certificate authentication on the cluster. For clusters before v1.12, if no configuration is specified, a client certificate is issued.
↳ cluster_ca_certificate
string
Output only. Base64-encoded public certificate that is the root of trust for the cluster.
↳ client_certificate
string
Output only. Base64-encoded public certificate used by clients to authenticate to the cluster endpoint. Issued only if client_certificate_config is set.
↳ client_key
string
Output only. Base64-encoded private key used by clients to authenticate to the cluster endpoint.
getUsername
The username to use for HTTP basic authentication to the master endpoint.
For clusters v1.6.0 and later, basic authentication can be disabled by
leaving username unspecified (or setting it to the empty string).
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
Returns
Type
Description
string
setUsername
The username to use for HTTP basic authentication to the master endpoint.
For clusters v1.6.0 and later, basic authentication can be disabled by
leaving username unspecified (or setting it to the empty string).
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPassword
The password to use for HTTP basic authentication to the master endpoint.
Because the master endpoint is open to the Internet, you should create a
strong password. If a password is provided for cluster creation, username
must be non-empty.
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
Returns
Type
Description
string
setPassword
The password to use for HTTP basic authentication to the master endpoint.
Because the master endpoint is open to the Internet, you should create a
strong password. If a password is provided for cluster creation, username
must be non-empty.
Warning: basic authentication is deprecated, and will be removed in GKE
control plane versions 1.19 and newer. For a list of recommended
authentication methods, see:https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getClientCertificateConfig
Configuration for client certificate authentication on the cluster. For
clusters before v1.12, if no configuration is specified, a client
certificate is issued.
Configuration for client certificate authentication on the cluster. For
clusters before v1.12, if no configuration is specified, a client
certificate is issued.
Output only. Base64-encoded public certificate that is the root of
trust for the cluster.
Returns
Type
Description
string
setClusterCaCertificate
Output only. Base64-encoded public certificate that is the root of
trust for the cluster.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getClientCertificate
Output only. Base64-encoded public certificate used by clients to
authenticate to the cluster endpoint. Issued only if
client_certificate_config is set.
Returns
Type
Description
string
setClientCertificate
Output only. Base64-encoded public certificate used by clients to
authenticate to the cluster endpoint. Issued only if
client_certificate_config is set.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getClientKey
Output only. Base64-encoded private key used by clients to authenticate
to the cluster endpoint.
Returns
Type
Description
string
setClientKey
Output only. Base64-encoded private key used by clients to authenticate
to the cluster endpoint.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Container V1 Client - Class MasterAuth (2.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.5.0 (latest)](/php/docs/reference/cloud-container/latest/V1.MasterAuth)\n- [2.4.0](/php/docs/reference/cloud-container/2.4.0/V1.MasterAuth)\n- [2.3.4](/php/docs/reference/cloud-container/2.3.4/V1.MasterAuth)\n- [2.2.1](/php/docs/reference/cloud-container/2.2.1/V1.MasterAuth)\n- [2.1.0](/php/docs/reference/cloud-container/2.1.0/V1.MasterAuth)\n- [2.0.0](/php/docs/reference/cloud-container/2.0.0/V1.MasterAuth)\n- [1.33.0](/php/docs/reference/cloud-container/1.33.0/V1.MasterAuth)\n- [1.32.0](/php/docs/reference/cloud-container/1.32.0/V1.MasterAuth)\n- [1.31.0](/php/docs/reference/cloud-container/1.31.0/V1.MasterAuth)\n- [1.30.3](/php/docs/reference/cloud-container/1.30.3/V1.MasterAuth)\n- [1.24.0](/php/docs/reference/cloud-container/1.24.0/V1.MasterAuth)\n- [1.23.0](/php/docs/reference/cloud-container/1.23.0/V1.MasterAuth)\n- [1.22.0](/php/docs/reference/cloud-container/1.22.0/V1.MasterAuth)\n- [1.21.1](/php/docs/reference/cloud-container/1.21.1/V1.MasterAuth)\n- [1.20.0](/php/docs/reference/cloud-container/1.20.0/V1.MasterAuth)\n- [1.19.0](/php/docs/reference/cloud-container/1.19.0/V1.MasterAuth)\n- [1.18.0](/php/docs/reference/cloud-container/1.18.0/V1.MasterAuth)\n- [1.17.1](/php/docs/reference/cloud-container/1.17.1/V1.MasterAuth)\n- [1.16.0](/php/docs/reference/cloud-container/1.16.0/V1.MasterAuth)\n- [1.15.0](/php/docs/reference/cloud-container/1.15.0/V1.MasterAuth)\n- [1.14.0](/php/docs/reference/cloud-container/1.14.0/V1.MasterAuth)\n- [1.13.1](/php/docs/reference/cloud-container/1.13.1/V1.MasterAuth)\n- [1.12.1](/php/docs/reference/cloud-container/1.12.1/V1.MasterAuth)\n- [1.10.3](/php/docs/reference/cloud-container/1.10.3/V1.MasterAuth)\n- [1.9.1](/php/docs/reference/cloud-container/1.9.1/V1.MasterAuth) \nReference documentation and code samples for the Google Cloud Container V1 Client class MasterAuth.\n\nThe authentication information for accessing the master endpoint.\n\nAuthentication can be done using HTTP basic auth or using client\ncertificates.\n\nGenerated from protobuf message `google.container.v1.MasterAuth`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Container \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getUsername\n\nThe username to use for HTTP basic authentication to the master endpoint.\n\nFor clusters v1.6.0 and later, basic authentication can be disabled by\nleaving username unspecified (or setting it to the empty string).\nWarning: basic authentication is deprecated, and will be removed in GKE\ncontrol plane versions 1.19 and newer. For a list of recommended\nauthentication methods, see:\n\u003chttps://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication\u003e\n\n### setUsername\n\nThe username to use for HTTP basic authentication to the master endpoint.\n\nFor clusters v1.6.0 and later, basic authentication can be disabled by\nleaving username unspecified (or setting it to the empty string).\nWarning: basic authentication is deprecated, and will be removed in GKE\ncontrol plane versions 1.19 and newer. For a list of recommended\nauthentication methods, see:\n\u003chttps://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication\u003e\n\n### getPassword\n\nThe password to use for HTTP basic authentication to the master endpoint.\n\nBecause the master endpoint is open to the Internet, you should create a\nstrong password. If a password is provided for cluster creation, username\nmust be non-empty.\nWarning: basic authentication is deprecated, and will be removed in GKE\ncontrol plane versions 1.19 and newer. For a list of recommended\nauthentication methods, see:\n\u003chttps://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication\u003e\n\n### setPassword\n\nThe password to use for HTTP basic authentication to the master endpoint.\n\nBecause the master endpoint is open to the Internet, you should create a\nstrong password. If a password is provided for cluster creation, username\nmust be non-empty.\nWarning: basic authentication is deprecated, and will be removed in GKE\ncontrol plane versions 1.19 and newer. For a list of recommended\nauthentication methods, see:\n\u003chttps://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication\u003e\n\n### getClientCertificateConfig\n\nConfiguration for client certificate authentication on the cluster. For\nclusters before v1.12, if no configuration is specified, a client\ncertificate is issued.\n\n### hasClientCertificateConfig\n\n### clearClientCertificateConfig\n\n### setClientCertificateConfig\n\nConfiguration for client certificate authentication on the cluster. For\nclusters before v1.12, if no configuration is specified, a client\ncertificate is issued.\n\n### getClusterCaCertificate\n\nOutput only. Base64-encoded public certificate that is the root of\ntrust for the cluster.\n\n### setClusterCaCertificate\n\nOutput only. Base64-encoded public certificate that is the root of\ntrust for the cluster.\n\n### getClientCertificate\n\nOutput only. Base64-encoded public certificate used by clients to\nauthenticate to the cluster endpoint. Issued only if\nclient_certificate_config is set.\n\n### setClientCertificate\n\nOutput only. Base64-encoded public certificate used by clients to\nauthenticate to the cluster endpoint. Issued only if\nclient_certificate_config is set.\n\n### getClientKey\n\nOutput only. Base64-encoded private key used by clients to authenticate\nto the cluster endpoint.\n\n### setClientKey\n\nOutput only. Base64-encoded private key used by clients to authenticate\nto the cluster endpoint."]]