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

# Set Up Local Resolver Sidecar

> Learn how to deploy the local resolver sidecar container to resolve flags locally in your network.

export const HowToSchema = ({name, description, steps = []}) => {
  const schema = {
    "@context": "https://schema.org",
    "@type": "HowTo",
    name,
    description
  };
  if (steps.length > 0) {
    schema.step = steps.map((s, i) => ({
      "@type": "HowToStep",
      position: i + 1,
      name: typeof s === "string" ? s : s.name,
      text: typeof s === "string" ? s : s.text || s.name
    }));
  }
  return <script type="application/ld+json" dangerouslySetInnerHTML={{
    __html: JSON.stringify(schema)
  }} />;
};

<HowToSchema
  name="Set Up Local Resolver Sidecar"
  description="Learn how to deploy the local resolver sidecar container to resolve flags locally in your network."
  steps={[
"Go to Confidence",
{
  name: "Select Admin > API Clients",
  text: "On the bottom of the left sidebar, select Admin > API Clients.",
},
"Click Create",
{
  name: "Give the API client a name",
  text: 'For example, "local resolver."',
},
{
  name: "Select Admin > Policies",
  text: "On the bottom of the left sidebar, select Admin > Policies.",
},
"Click Create",
{
  name: "Add the role Flags Resolver Sidecar",
  text: 'Add the role Flags Resolver Sidecar to the principal with the name you just created, "local resolver".',
},
"Click Create",
]}
/>

The local resolver [sidecar](../flags/local-resolver#sidecar-resolver) is a container that resolves flags locally in your network. For an alternative approach using OpenFeature SDK providers, see [Local Resolver](../flags/local-resolver).

## Create API Client and Credentials

<Steps>
  <Step title="Go to Confidence" />

  <Step title="Select Admin > API Clients">
    On the bottom of the left sidebar, select **Admin > API Clients**.
  </Step>

  <Step title="Click Create" />

  <Step title="Give the API client a name">
    For example, "local resolver."
  </Step>

  <Step title="Select Admin > Policies">
    On the bottom of the left sidebar, select **Admin > Policies**.
  </Step>

  <Step title="Click Create" />

  <Step title="Add the role Flags Resolver Sidecar">
    Add the role **Flags Resolver Sidecar** to the principal with the name you just created, "local resolver".
  </Step>

  <Step title="Click Create" />
</Steps>

Make note of the Client ID and client secret.

## Run with Docker

Set the following environment variables:

* `CONFIDENCE_REGION` - Your account region (`EU` or `US`)
* `CONFIDENCE_CLIENT_ID` - The client ID of the API client you created
* `CONFIDENCE_CLIENT_SECRET` - The client secret of the API client you created

Run the local resolver:

```bash theme={null}
docker run -it --rm \
  -p 8090:8090 \
  -e CONFIDENCE_REGION="$CONFIDENCE_REGION" \
  -e CONFIDENCE_CLIENT_ID="$CONFIDENCE_CLIENT_ID" \
  -e CONFIDENCE_CLIENT_SECRET="$CONFIDENCE_CLIENT_SECRET" \
  europe-docker.pkg.dev/spotify-confidence/public/flags-resolver-sidecar:latest
```

The local resolver is available at `http://localhost:8090`.

## Deploy in Kubernetes

Add the sidecar container configuration to your Kubernetes pod spec:

```yaml theme={null}
spec:
  containers:
  - name: my-service
    image: gcr.io/my-service/image:latest
    # whatever you already had configured

  # add this sidecar container to your pod
  - name: confidence-resolver-sidecar
    image: europe-docker.pkg.dev/spotify-confidence/public/flags-resolver-sidecar:latest
    env:
      - name: CONFIDENCE_REGION
        value: "<your-account-region>"
      - name: CONFIDENCE_CLIENT_ID
        value: "<your-api-client-id>"
      - name: CONFIDENCE_CLIENT_SECRET
        value: "<your-api-client-secret>"
    ports:
      - name: http
        containerPort: 8090
    readinessProbe:
      exec:
        command: ["/bin/grpc_health_probe", "-addr=:5990"]
      initialDelaySeconds: 5
    livenessProbe:
      exec:
        command: ["/bin/grpc_health_probe", "-addr=:5990"]
      initialDelaySeconds: 10
    resources:
      requests:
        cpu: 1
        memory: 256M
      limits:
        cpu: 2
        memory: 512M
```

## Related Resources

<CardGroup cols={2}>
  <Card title="Local Resolver Reference" href="/docs/flags/local-resolver">
    Deep dive into local resolver configuration
  </Card>

  <Card title="Data Transfer" href="/docs/flags/data-transfer">
    Understand flag resolution options
  </Card>

  <Card title="Manage Clients" href="/docs/how-to-guides/manage-clients">
    Configure API clients and credentials
  </Card>

  <Card title="SDKs Reference" href="/docs/sdks/introduction">
    Learn about SDK integrations
  </Card>
</CardGroup>
