convoy docs
Search

Cluster

A target Kubernetes cluster, how convoy connects to it, and metadata for templates.

A Cluster is a target for Releases. It holds the connection data, the credentials and free-form metadata that mutations and hooks can read.

API groupcore.convoy.kumodo.io/v1alpha1
ScopeNamespaced
Subresources/status
ConditionsReady

Example#

clusters/cluster-auth-agentless.yaml
apiVersion: core.convoy.kumodo.io/v1alpha1
kind: Cluster
metadata:
  name: convoy-managed
  namespace: default
spec:
  connectionMode: agentless
  agentless:
    server: https://convoy-managed-control-plane:6443
    auth:
      type: kubeconfig
      kubeconfig:
        secretRef:
          name: convoy-managed-kubeconfig
          key: kubeconfig
  metadata:
    type: kind
    role: managed

Connection modes#

spec.connectionMode is required. It has no default.

ModeImplementedHow convoy connects
inClusterYesWith the credentials of the convoy pod. Use it for the cluster where convoy runs.
agentlessYes, with kubeconfig auth onlyWith the credentials in spec.agentless.auth.
agentNoReady=False, reason Unsupported.

The block that matches the mode (agentless or agent) must be set. The other block must not be set.

Auth types for agentless mode#

auth.typeImplemented
kubeconfigYes. kubeconfig.secretRef points to a Secret key that holds a full kubeconfig.
token, clientCert, execPlugin, oidcNo. Ready=False, reason Unsupported.

With kubeconfig auth, the kubeconfig sets the server and the CA. convoy does not use agentless.server or agentless.caPublicCertRef to connect. convoy copies agentless.server into status.lastAttempted.resolvedCluster of each Release.

Metadata#

spec.metadata is a map of strings. Mutations and lifecycle hooks read it as cluster.<key>. cluster.name is the name of the Cluster. Credentials are never in this context.

yaml
spec:
  metadata:
    region: eu-west-1
    tier: production

Deletion#

convoy adds the finalizer cluster.core.convoy.kumodo.io/prune-releases to each Cluster.

  • deletionPolicy.pruneReleases: false (the default): the Cluster is deleted. Its Releases stay, and fail with reason ClusterNotReady.
  • deletionPolicy.pruneReleases: true: convoy deletes each Release in the same namespace that references the Cluster. The Cluster is deleted after all those Releases are gone. Each Release runs its own deletion policy.

Fields#

FieldTypeDescription
specClusterSpecClusterSpec defines the desired state of the Cluster.
spec.agentobjectAgent is the configuration of the agent connection mode.
spec.agentlessClusterAgentlessModeSpecAgentless is the configuration of the agentless connection mode.
spec.agentless.auth requiredClusterAuthSpecAuth is the authentication configuration for the agentless connection mode.
spec.agentless.auth.clientCertClientCertAuthSpecClientCert is the authentication mode using a client certificate.
spec.agentless.auth.clientCert.certRef requiredSecretKeySelectorCertRef is the name and the key of the Secret containing the client certificate.
spec.agentless.auth.clientCert.keyRef requiredSecretKeySelectorKeyRef is the name and the key of the Secret containing the client certificate key.
spec.agentless.auth.execPluginExecPluginAuthSpecExecPlugin is the authentication mode using an exec plugin.
spec.agentless.auth.execPlugin.args[]stringlist type: atomicArgs are the arguments to pass to the command.
spec.agentless.auth.execPlugin.command requiredstringCommand is the command to execute.
spec.agentless.auth.execPlugin.credentialsRef requiredSecretReferenceCredentialsRef is the optional reference to credentials the plugin needs (e.g., AWS IAM role). Defined by the reference to the Secret and the key of the Secret containing the credentials.
spec.agentless.auth.execPlugin.env[]EnvVarlist type: map, keys: nameEnv are the environment variables to pass to the command.
spec.agentless.auth.kubeconfigKubeconfigAuthSpecKubeconfig is the authentication mode using a kubeconfig file.
spec.agentless.auth.kubeconfig.secretRef requiredSecretKeySelectorSecretRef is the name and the key of the Secret containing the kubeconfig file.
spec.agentless.auth.oidcOIDAuthSpecOIDC is the authentication mode using OIDC client credentials.
spec.agentless.auth.oidc.audiencestringAudience is the OIDC audience.
spec.agentless.auth.oidc.clientAuth requiredOIDCClientAuthSpecClientAuth is the OIDC authentication method used for authentication.
spec.agentless.auth.oidc.clientAuth.clientSecretOIDCAuthClientSecretSpecClientSecret is the reference to the Secret and the key of the Secret containing the OIDC client secret.
spec.agentless.auth.oidc.clientAuth.clientSecret.clientSecretRef requiredSecretKeySelectorClientSecretRef is the name and the key of the Secret containing the OIDC client secret.
spec.agentless.auth.oidc.clientAuth.privateKeyJWTOIDCAuthPrivateKeyJWTSpecPrivateKeyJWT is the reference to the Secret and the key of the Secret containing the OIDC private key JWT.
spec.agentless.auth.oidc.clientAuth.privateKeyJWT.privateKeyRef requiredSecretKeySelectorPrivateKeyRef is the name and the key of the Secret containing the OIDC private key JWT.
spec.agentless.auth.oidc.clientAuth.tlsClientAuthOIDCAuthTLSClientAuthSpecTLSClientAuth is the reference to the Secrets and the keys of the Secret(s) containing the OIDC client certificate and key.
spec.agentless.auth.oidc.clientAuth.tlsClientAuth.certRef requiredSecretKeySelectorCertRef is the name and the key of the Secret containing the OIDC client certificate.
spec.agentless.auth.oidc.clientAuth.tlsClientAuth.keyRef requiredSecretKeySelectorKeyRef is the name and the key of the Secret containing the OIDC client certificate key.
spec.agentless.auth.oidc.clientAuth.type requiredstringType is the OIDC authentication method type used for authentication.
  • clientSecret is the OIDC authentication method using a client secret.
  • privateKeyJWT is the OIDC authentication method using a private key JWT.
  • tlsClientAuth is the OIDC authentication method using TLS client authentication.
spec.agentless.auth.oidc.clientID requiredstringClientID is the OIDC client ID.
spec.agentless.auth.oidc.issuerURL requiredstringIssuerURL is the URL of the OIDC issuer.
spec.agentless.auth.oidc.scopes[]stringlist type: atomicScopes are the OIDC scopes.
spec.agentless.auth.oidc.tlsTLSSpecTLS is the issuer TLS configuration.
spec.agentless.auth.oidc.tls.caPublicCertRef requiredConfigMapKeySelectorCAPublicCertRef is the name and the key of the ConfigMap containing the CA public certificate. The CA certificate is used to verify the IdP server's certificate.
spec.agentless.auth.oidc.tls.insecureSkipVerify requiredbooleanInsecureSkipVerify is a flag to skip the certificate verification.
spec.agentless.auth.tokenTokenAuthSpecToken is the authentication mode using a token.
spec.agentless.auth.token.tokenRef requiredSecretKeySelectorTokenRef is the name and the key of the Secret containing the token.
spec.agentless.auth.type requiredstringType is the authentication mode used to connect to the target cluster. The workload identity authentication mode does not require specific configuration as it uses the identity of the controller's pod.
  • clientCert is the authentication method using a client certificate.
  • execPlugin is the authentication method using an exec plugin.
  • kubeconfig is the authentication method using a kubeconfig file.
  • oidc is the authentication method using OIDC.
  • token is the authentication method using a token.
spec.agentless.caPublicCertRef required accepted, not usedConfigMapKeySelectorCAPublicCertRef is the name and the key of the ConfigMap containing the CA public certificate. The CA certificate is used to verify the Kubernetes API server's certificate.
spec.agentless.connectionParameters required accepted, not usedClusterConnectionParametersSpecClusterConnectionParametersSpec defines the connection parameters of the cluster.
spec.agentless.connectionParameters.burst requiredintegerBurst is the maximum number of burst queries per second (QPS) to the Kubernetes API server.
spec.agentless.connectionParameters.qps requiredintegerQPS is the maximum number of queries per second (QPS) to the Kubernetes API server.
spec.agentless.connectionParameters.timeout requiredDurationTimeout is the timeout for the Kubernetes API server connection.
spec.agentless.server requiredstringServer is the address of the Kubernetes API server.
spec.capabilities accepted, not usedClusterCapabilitiesSpecCapabilities is the capabilities of the cluster.
spec.capabilities.apiVersions[]stringlist type: atomicAPIVersions is the list of specific API versions the renderer can rely on.
spec.capabilities.serverSideApply requiredboolean
spec.connectionMode requiredstringConnectionMode is the connection mode between the control plane and the target cluster. Possible values are: - agentless - agent
  • agent defines the connection mode when the agent is running on the target cluster, pulls the workload manifests and applies them locally.
  • agentless defines the connection mode when the control plane pushes the workload manifests to the cluster connecting to the target cluster's API server.
  • inCluster defines the connection mode when the control plane is running in the same cluster as the target cluster.
spec.deletionPolicyClusterDeletionPolicyDeletionPolicy is the deletion policy of the cluster.
spec.deletionPolicy.pruneReleases requiredbooleanPruneReleases is the deletion policy for the Release objects in case of the cluster deletion.
spec.metadatamap[string]stringMetadata is the metadata of the cluster that is used for the templating of the workload manifests defined in the corresponding Release objects.
FieldTypeDescription
statusClusterStatusClusterStatus reflects the observed state of the Cluster.
status.agentStatusClusterAgentStatusAgentStatus is the status of the agent running on the cluster. Applicable only if the cluster connection mode is agent.
status.agentStatus.agentVersion requiredstringAgentVersion is the version of the agent running on the cluster.
status.agentStatus.lastHeartbeatTimeLastHeartbeat is the time when the agent last sent a heartbeat.
status.agentStatus.registeredAt requiredTimeRegisteredAt is the time when the agent was registered with the cluster.
status.conditions[]Conditionlist type: map, keys: typeConditions is the list of conditions related to the cluster.
status.discoveredAPIVersions[]stringlist type: atomicDiscoveredAPIVersions is the list of discovered API versions of the cluster.
status.discoveredVersionstringDiscoveredVersion is the discovered Kubernetes version of the cluster.
status.lastSeenTimeLastSeen is the last time the cluster was seen by the controller.
status.observedGenerationintegerObservedGeneration is the last generation that was observed by the controller.
status.reachable requiredbooleanReachable is a flag indicating whether the cluster is reachable.
status.releaseCountintegerReleaseCount is the number of Release objects in the cluster.

status.discoveredAPIVersions is informational. The Helm renderer does not use it. status.releaseCount and status.agentStatus are not set.

Conditions#

Ready · written by convoy-controller-manager

ReasonStatusMeaning
ReachableTrueconvoy connected to the cluster and read its Kubernetes version.
UnsupportedFalseThe connection mode or the auth type is not implemented. Only inCluster, and agentless with kubeconfig auth, are implemented. convoy does not retry with backoff. The periodic resync checks the Cluster again.
ProbeFailedFalseconvoy could not connect to the cluster or read its version. convoy retries.

In the code

convoy v0.9.0