Skip to main content

1. Custom OIDC Configuration

To integrate SambaStack with your organization’s identity provider, configure custom OIDC authentication.

Step 1: Create Kubernetes Secret

Create a secret with your OIDC provider details:
apiVersion: v1
kind: Secret
metadata:
  name: oidc-auth
  namespace: sambastack
stringData:
  OIDC_CLIENT_ID: "<client-id>"
  OIDC_CLIENT_SECRET: "<client-secret>"
  OIDC_ISSUER_URL: "https://auth.example.com/"
  OIDC_REDIRECT_URI: "https://ui.<yourdomain>/web/auth/callback"
  JWT_SECRET_KEY: "<random-string>"
Replace the placeholders with your actual values (all base64 encoded):
  • <client-id>: Your OIDC client ID
  • <client-secret>: Your OIDC client secret
  • <yourdomain>: Your organization’s domain
  • <random-string>: A securely generated random string for JWT signing

Step 2: Apply the Secret

kubectl apply -f oidc-auth.yaml

Step 3: Update sambastack.yaml

Add the OIDC configuration to your sambastack.yaml:
gateway:
  replicas: 3
  auth:
    enabled: true
    secretName: oidc-auth     # Must match the secret name created above

Step 4: Apply the Configuration

Update your Helm deployment:
helm upgrade sambastack \
  -f sambastack.yaml \
  --namespace sambastack \
  oci://<REGISTRY_URL>/sambastack/sambastack
SambaNova provides the full registry URL and version number during handover. Contact your SambaNova representative for access credentials.
Ensure the OIDC_REDIRECT_URI matches your UI domain’s callback endpoint: https://ui.<yourdomain>/web/auth/callback

2. Custom PostgreSQL Database

To use an external PostgreSQL database instead of the in-cluster deployment, you can create the secret using either base64-encoded values or literal values.

Step 1: Create the Secret

Option A: Base64-encoded Values

First, encode your database credentials:
echo -n "<db-host>" | base64
echo -n "<db-name>" | base64
echo -n "<db-user>" | base64
echo -n "<db-password>" | base64
Create a Kubernetes secret with base64-encoded values:
apiVersion: v1
kind: Secret
metadata:
  name: pg-credentials
  namespace: sambastack
type: Opaque
data:
  DB_HOST: <Base64 encoded DB_HOST>
  DB_DATABASE: <Base64 encoded DB_DATABASE>
  DB_USER: <Base64 encoded DB_USER>
  DB_PASSWD: <Base64 encoded DB_PASSWD>
Apply the secret:
kubectl apply -f pg-credentials.yaml

Option B: Using kubectl with Literal Values

Instead of manually encoding, you can create the secret with literal values:
kubectl create secret generic pg-credentials \
  --from-literal=DB_HOST=<host> \
  --from-literal=DB_DATABASE=<database> \
  --from-literal=DB_USER=<user> \
  --from-literal=DB_PASSWD=<password> \
  --namespace sambastack

Step 2: Update sambastack.yaml

Configure your sambastack.yaml to use the external database:
auth-and-billing:
  pgSecretName: pg-credentials

cloudnative-pg:
  enabled: false
  • auth-and-billing.pgSecretName: References the Kubernetes secret containing database credentials
  • cloudnative-pg.enabled: false: Disables the in-cluster PostgreSQL deployment

Step 3: Apply the Configuration

Update your Helm deployment:
helm upgrade sambastack \
  -f sambastack.yaml \
  --namespace sambastack \
  oci://<REGISTRY_URL>/sambastack/sambastack
SambaNova provides the full registry URL and version number during handover. Contact your SambaNova representative for access credentials.
Ensure your external PostgreSQL database is accessible from the Kubernetes cluster and that network policies allow the connection.

3. Rate Limiting

Rate limiting controls the number of API or UI requests accepted per minute to protect the cluster from overload and abuse.In SambaStack on-prem, rate limiting can be applied at two layers:
LayerDescriptionConfiguration SourceStatus
Ingress Layer (NGINX)Enforces limits at the Kubernetes ingress controller using NGINX annotationsNGINX ingress controller configurationOptional (Recommended)
Application Layer (Service Tiers)Enforces limits at the gateway level using Helm chart parameterssambastack.yaml (serviceTiers section)Required. See Service tier management
Application layer rate limits are mandatory and configured via service tiers. See Service tier management for details.

Overview

  • Ingress-layer rate limits are optional but recommended for customers using the NGINX ingress controller.
  • The Helm chart does not ship with default rate-limit annotations; customers can enable them manually.
  • Application layer rate limits remain mandatory and are configured in the serviceTiers block of sambastack.yaml.
  • If you bring your own Kubernetes cluster and ingress controller, you can use equivalent annotations or omit ingress-level limits entirely.
If your cluster uses RKE2’s built-in NGINX ingress controller, you can define global rate-limit zones at the cluster level and reference them in the API and UI ingress annotations.

Step 1: Define Global Rate-Limit Zones

Apply the following HelmChartConfig to configure global rate-limit zones for the ingress controller.Save the below as rke2-ingress-nginx.yaml:
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-ingress-nginx
  namespace: kube-system
spec:
  valuesContent: |-
    controller:
      config:
        limit-req-status-code: "429"
        allow-snippet-annotations: "true"
        http-snippet: |
          limit_req_zone $binary_remote_addr zone=240_req_min_ip:50m rate=240r/m;
          limit_req_zone $http_authorization zone=240_req_min_header:50m rate=240r/m;
Apply it:
kubectl apply -f rke2-ingress-nginx.yaml
Zone Definitions:
  • _req_min_ip zones are used for the UI (IP-based limits)
  • _req_min_header zones are used for the API/Gateway (Authorization header-based limits)
Rate limit values should scale with cluster size. For larger deployments (e.g., 10-node clusters), consider higher limits such as 5000 or 8000 requests per minute.

Step 2: Apply Ingress Annotations in sambastack.yaml

Once zones are defined, reference them in your sambastack.yaml under the cloud-ui.ingress and gateway.ingress sections:
cloud-ui:
  ingress:
    annotations:
      nginx.ingress.kubernetes.io/backend-protocol: HTTP
      nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
      nginx.ingress.kubernetes.io/proxy-body-size: 21m
      nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_set_header Authorization $http_authorization;
        limit_req zone=120_req_min_ip burst=240 nodelay;
        limit_req_status 429;

gateway:
  ingress:
    annotations:
      nginx.ingress.kubernetes.io/backend-protocol: HTTP
      nginx.ingress.kubernetes.io/force-ssl-redirect: 'true'
      nginx.ingress.kubernetes.io/proxy-read-timeout: '600'
      nginx.ingress.kubernetes.io/proxy-body-size: 25m
      nginx.ingress.kubernetes.io/enable-cors: 'true'
      nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_set_header Authorization $http_authorization;
        limit_req zone=240_req_min_header burst=360 nodelay;
        limit_req_status 429;
Configuration Details:
  • These snippets tell NGINX which rate-limit zone to apply
  • You can adjust the burst and rate values as needed
  • Ingress-based rate limiting is per ingress-controller pod, not cluster-wide
  • Total effective rate = configured rate × number of ingress pods

Step 3: Apply the Updated Configuration

helm upgrade sambastack \
  -f sambastack.yaml \
  --namespace sambastack \
  oci://<REGISTRY_URL>/sambastack/sambastack
SambaNova provides the full registry URL and version number during handover. Contact your SambaNova representative for access credentials.

Key Recommendations

  • Use ingress-layer limits for infrastructure-level protection (e.g., DDoS or abusive burst prevention)
  • Use service-tier limits for application-level throttling and user-specific rate control
  • Ingress configuration is optional, but SambaNova recommends enabling it when using RKE2’s built-in NGINX ingress controller
  • For customers using other ingress controllers (e.g., Istio, AWS ALB, or NGINX Plus), equivalent configurations can be applied at their discretion
  • Default Helm chart values will not include any rate-limit annotations; these can be overridden by customers at deployment time
Always configure application-layer rate limits via service tiers. Ingress-layer rate limiting alone is insufficient for proper request management.