Skip to content

Latest commit

 

History

History
115 lines (87 loc) · 3.81 KB

streamnative_cloud_connection.md

File metadata and controls

115 lines (87 loc) · 3.81 KB

StreamNativeCloudConnection

Overview

The StreamNativeCloudConnection resource defines a connection to the StreamNative Cloud API server. It allows you to configure authentication and connection details for interacting with StreamNative Cloud services.

Specifications

Field Description Required
server The URL of the API server Yes
auth.credentialsRef Reference to the service account credentials secret Yes
logs.serviceUrl URL of the logging service. Required if logs configuration is specified. No*
organization The organization to use in the API server. If not specified, the connection name will be used No

*Note: If logs configuration is specified, serviceUrl becomes required.

Status

Field Description
conditions List of status conditions for the connection
observedGeneration The last observed generation of the resource
lastConnectedTime Timestamp of the last successful connection to the API server

Service Account Credentials Structure

The service account credentials secret should contain a credentials.json file with the following structure:

{
  "type": "sn_service_account",
  "client_id": "<client-id>",
  "client_secret": "<client-secret>",
  "client_email": "<client-email>",
  "issuer_url": "<issuer-url>"
}

Example

  1. Create a service account credentials secret:
apiVersion: v1
kind: Secret
metadata:
  name: test-credentials
  namespace: default
type: Opaque
data:
  credentials.json: |
    {
      "type": "sn_service_account",
      "client_secret": "client_secret",
      "client_email": "client-email",
      "issuer_url": "issuer_url",
      "client_id": "client-id"
    }
  1. Create a StreamNativeCloudConnection resource:
apiVersion: resource.streamnative.io/v1alpha1
kind: StreamNativeCloudConnection
metadata:
  name: test-connection
  namespace: default
spec:
  server: https://api.streamnative.dev
  auth:
    credentialsRef:
      name: test-credentials
  organization: org
  1. Apply the YAML files:
kubectl apply -f credentials.yaml
kubectl apply -f connection.yaml
  1. Check the connection status:
kubectl get streamnativecloudconnection test-connection

The connection is ready when the Ready condition is True:

NAME             READY   AGE
test-connection  True    1m

Update Connection

You can update the connection by modifying the YAML file and reapplying it. Most fields can be updated, including:

  • Server URL
  • Organization
  • Credentials reference

After applying changes, verify the status to ensure the connection is working properly.

Delete Connection

To delete a StreamNativeCloudConnection resource:

kubectl delete streamnativecloudconnection test-connection

Note that deleting the connection will affect any resources that depend on it, such as ComputeWorkspaces or ComputeFlinkDeployments.