Kubernetes Connection
Stores information and configuration for the access to a Kubernetes cluster.
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster using a Bearer Token
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = token {
token = "credentialsJSON:fa92592e-ec16-4543-add0-1cdd4de87e5e"
}
}
Content copied to clipboard }
}
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster using a username and password
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = usernameAndPassword {
username = "username"
password = "credentialsJSON:aaef5e7e-5a51-427c-b0ea-3af364cacedd"
}
}
Content copied to clipboard }
}
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster using the OpenID Connect (OIDC) protocol
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = openId {
idpIssuerUrl = "idpurl"
clientId = "clientId"
clientSecret = "credentialsJSON:612f3414-2b25-41ec-9520-12c9669d1f85"
refreshToken = "credentialsJSON:0bb3f85a-7ff4-474e-9c14-8da47099595a"
}
}
Content copied to clipboard }
}
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster using a Client Certificate and Key
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = clientCertificateAndKey {
clientKey = "credentialsJSON:43b46ece-15a7-4621-a271-7d2b33e9e356"
clientCertificate = "credentialsJSON:87a6537c-cb8f-4684-b44d-e0ea183e9fa1"
}
}
Content copied to clipboard }
}
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster in AWS EKS using an access key and secret key
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = eks {
accessId = "accessId"
secretKey = "credentialsJSON:3507800f-ae64-49f1-bbb5-0a4deec5c7b3"
clusterName = "cluster-name"
}
}
Content copied to clipboard }
}
Example. Adds a new Connection that allows TeamCity to store and manage a Kubernetes Cluster.
project {
// Other Project settings ...
features {
// Other Project Features ...
kubernetesConnection {
id = "PROJECT_EXT_3"
name = "Connection"
apiServerUrl = "http://cluster.com"
caCertificate = "credentialsJSON:c77bc0a7-f461-4ca8-959b-ef5c8f6359b2"
namespace = "namespace"
authStrategy = unauthorized()
}
Content copied to clipboard }
}
See also
Properties
Functions
Connecting to a Kubernetes cluster using a client certificate and key
Copies parameters of this object to the specified target
Creates an instance of this project feature via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.
Connecting to an AWS EKS (Elastic Kubernetes Service)
Connecting to a Kubernetes cluster using the OpenID Connect (OIDC) protocol
Uses the Kubernetes credentials provided in the TeamCity Instance. Should be available under /var/run/secrets/kubernetes.io/serviceaccount/token
Connecting to a Kubernetes cluster using a Bearer Token
Use unauthorized access to the Kubernetes API server
Connecting to a Kubernetes cluster using a username and password
Validates this object and reports found errors to the provided consumer