> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superblocks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kubernetes

> Estimated deployment time: 15 minutes

export const Alert = ({type, title, children}) => {
  const getIcon = () => {
    switch (type) {
      case 'info':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      case 'success':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm4.293 6.293L9 11.586 5.707 8.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414l4 4c.391.391 1.024.391 1.414 0l6-6c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%230CC26D'/%3E%3C/svg%3E";
      case 'warning':
        return "data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbDpzcGFjZT0ncHJlc2VydmUnIHdpZHRoPScxMDgwJyBoZWlnaHQ9JzEwODAnPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbGw9J3RyYW5zcGFyZW50Jy8+PHBhdGggZD0nTTEzLjc5NCAxMC43NSA4LjMgMS4yNWExLjUgMS41IDAgMCAwLTIuNiAwbC01LjQ5NCA5LjVBMS40OTQgMS40OTQgMCAwIDAgMS41IDEzaDExYTEuNDkzIDEuNDkzIDAgMCAwIDEuMjk0LTIuMjVNNi41IDUuNWEuNS41IDAgMCAxIDEgMFY4YS41LjUgMCAwIDEtMSAwek03IDExYS43NS43NSAwIDEgMSAwLTEuNS43NS43NSAwIDAgMSAwIDEuNScgc3R5bGU9J3N0cm9rZTpub25lO3N0cm9rZS13aWR0aDoxO3N0cm9rZS1kYXNoYXJyYXk6bm9uZTtzdHJva2UtbGluZWNhcDpidXR0O3N0cm9rZS1kYXNob2Zmc2V0OjA7c3Ryb2tlLWxpbmVqb2luOm1pdGVyO3N0cm9rZS1taXRlcmxpbWl0OjQ7ZmlsbDojZmY5ZjM1O2ZpbGwtcnVsZTpub256ZXJvO29wYWNpdHk6MScgdHJhbnNmb3JtPSd0cmFuc2xhdGUoLjAyIDE5LjMwNSlzY2FsZSg3Ny4xNCknLz48L3N2Zz4=";
      case 'danger':
        return "data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm5.707 4.293L10 9.586 4.293 4.293c-.391-.391-1.024-.391-1.414 0s-.391 1.024 0 1.414L8.586 11l-5.707 5.293c-.391.391-.391 1.024 0 1.414s1.024.391 1.414 0L10 12.414l5.707 5.293c.391.391 1.024.391 1.414 0s.391-1.024 0-1.414L11.414 11l5.707-5.293c.391-.391.391-1.024 0-1.414s-1.024-.391-1.414 0z' fill='%23F45252'/%3E%3C/svg%3E";
      case 'note':
        return "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm0 15c-.552 0-1-.448-1-1s.448-1 1-1 1 .448 1 1-.448 1-1 1zm1-3H9V6h2v6z' fill='%230099FF'/%3E%3C/svg%3E";
      default:
        return "";
    }
  };
  return <div className={`alert alert--${type}`}>
      <div className="alert-icon" style={{
    backgroundImage: `url("${getIcon()}")`,
    backgroundRepeat: 'no-repeat',
    backgroundPosition: 'center center',
    backgroundSize: '20px',
    width: '24px',
    height: '24px',
    position: 'absolute',
    left: '16px',
    top: '16px'
  }} />
      <div className="alert-content">
        {title && <div className="alert-title">{title}</div>}
        <div className="alert-body">{children}</div>
      </div>
    </div>;
};

The Superblocks data plane can be deployed on any Kubernetes cluster with the Superblocks Helm chart. If your organization doesn't use Helm to manage Kubernetes resources, you can still install the [Helm CLI](https://helm.sh/docs/intro/install/) and use it to generate the [manifest templates](https://helm.sh/docs/helm/helm_template/) to deploy directly.

## Installation

### Add the chart repository

```bash theme={null}
helm repo add superblocks https://charts.superblocks.com/superblocks
helm repo update
```

### Configure values file

Create a local `values.yaml` file with the default chart values. You can export the defaults by running `helm show values superblocks/superblocks-agent > values.yaml`. Aside from the default settings, the following settings are required to enable Ingress and allow communication from your users to the agent running in the cluster.

```yaml theme={null}
superblocks:
  agentHostUrl: "https://SUBDOMAIN.DOMAIN.TLD"

  agentRedisPassword: "my-redis-password"
  # Existing agentRedisPassword secret must contain the value:
  # SUPERBLOCKS_AGENT_REDIS_PASSWORD: <my-redis-password>
  # agentRedisPasswordExistingSecret: "my-redis-password-secret", optional. Secret is created for you if not specified.

#(...)
service:
  # Use ClusterIP if your ingress controller routes traffic directly to pods.
  # Otherwise, update the service type based on your ingress controller settings.
  # For example, defaults for native cloud controllers require NodePort.
  type: ClusterIP
  ports:
    grpc: 8081
    http: 8080
    metrics: 9090

ingress:
  enabled: true
  class: "" # nginx
  annotations: {}
    # kubernetes.io/tls-acme: "true"
  
  hosts:
    - host: SUBDOMAIN.DOMAIN.TLD
      paths:
        - path: /
          pathType: Prefix
  tls: []
  # - secretName: chart-example-tls
  #   hosts:
  #     - SUBDOMAIN.DOMAIN.TLD
```

The values for `superblocks.agentHostUrl` and `ingress.hosts[0].host` should be the same DNS entry (CNAME or A record) that points to the [ingress-managed load balancer](https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress) in front of the agent.

<Alert type="info">
  If you use the EU Superblocks instance, also set <code>superblocks.agentDataDomain</code> to <code>eu.superblocks.com</code>.
</Alert>

### Deploy the chart

<Alert type="info">
  Navigate to the <a href="https://app.superblocks.com/opas">Setup Wizard</a> and click on the relevant Kubernetes tab for your platform (EKS, GKE, or AKS).
</Alert>

After making changes to `values.yaml`, save and deploy the chart. Adjust `superblocks.agentTags` as needed depending on your [environment](/enterprise/hybrid-architecture/deployment/multiple_environments).

```bash theme={null}
helm upgrade -i -n superblocks superblocks-agent superblocks/superblocks-agent \
  --create-namespace \
  -f values.yaml \
  --set superblocks.agentKey='<AGENT_KEY>' \
  --set superblocks.agentTags='profile:*' \
  --set superblocks.agentDataDomain="app.superblocks.com"
```

## Billable services

When running the data plane on Kubernetes, it is important to be aware of your container management provider's pricing (i.e. [EKS](https://aws.amazon.com/eks/pricing/), [GKE](https://cloud.google.com/kubernetes-engine/pricing), [AKS](https://azure.microsoft.com/en-us/pricing/details/kubernetes-service/)) and the cost of any associated infrastructure like networking, load balancers, and DNS.
