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

# Manifests

> Use Kubernetes manifests to customize and automate your cluster setup in Ankra.

<Note>
  Manifests are the foundation for customizing your Kubernetes clusters in Ankra. They allow you to define, automate, and standardize resources and configurations across all your environments.
</Note>

## What is a Manifest?

A **manifest** is a YAML file that describes Kubernetes resources such as namespaces, ConfigMaps, CRDs, RBAC rules, deployments, and more. Manifests are declarative: you specify the desired state, and Kubernetes makes sure your cluster matches it.

***

## Why Use Manifests in Ankra?

<CardGroup cols={2}>
  <Card title="Automate Cluster Setup" icon="bolt">
    Automatically create all the resources you need (namespaces, roles, CRDs, and more) as part of cluster setup or stack deployment.
  </Card>

  <Card title="Ensure Consistency" icon="check">
    Use the same manifest on multiple clusters to make sure every environment is set up the same way.
  </Card>

  <Card title="Prepare for Add-ons" icon="puzzle-piece">
    Use manifests to set up things like CRDs or service accounts before installing add-ons, so everything works smoothly.
  </Card>

  <Card title="Version Control" icon="box">
    Keep manifests in your repository to track changes, roll back if needed, and support GitOps workflows.
  </Card>
</CardGroup>

***

## Creating Manifests

Manifests in Ankra are created within **Stacks**. This ensures your manifests are bundled with related add-ons and can be deployed as a cohesive unit.

<Steps>
  <Step title="Navigate to Stacks">
    Go to the **Stacks** section in your cluster and click **Create Stack** (or edit an existing stack).
  </Step>

  <Step title="Add a Manifest">
    In the Stack Builder, click **Add** and select **Manifest**. You can:

    <ul>
      <li>Write your manifest YAML directly in the editor</li>
      <li>Use the AI Assistant (`⌘+J`) to get manifest recommendations by describing what you need</li>
    </ul>
  </Step>

  <Step title="Configure Dependencies">
    Arrange the order of resources if some depend on others. For example, ensure namespaces are created before deployments that use them.
  </Step>

  <Step title="Save and Deploy">
    Save your stack and deploy it to apply the manifests to your cluster. Monitor the deployment in the **Operations** section.
  </Step>
</Steps>

<Tip>
  Use the AI Assistant to get recommendations for common manifests like namespaces, RBAC rules, ConfigMaps, and Secrets. Just press `⌘+J` and describe what you need, then copy the suggested YAML into your manifest.
</Tip>

***

## Example Manifest

```yaml theme={null}
apiVersion: v1
kind: Namespace
metadata:
  name: monitoring
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: monitoring
  name: monitoring-reader
rules:
  - apiGroups: [""]
    resources: ["pods", "services"]
    verbs: ["get", "list"]
```

***

## Encrypting Secrets with SOPS

When your manifests contain sensitive data like passwords, API keys, or credentials, use **SOPS** to encrypt them before storing in your GitOps repository.

<Steps>
  <Step title="Open the Manifest Editor">
    Edit a manifest within your stack by clicking on it in the Stack Builder.
  </Step>

  <Step title="Click the SOPS Button">
    In the manifest edit view, click the **SOPS** button in the toolbar to enable encryption for this manifest.
  </Step>

  <Step title="Select Fields to Encrypt">
    SOPS will encrypt the sensitive values (like `data` fields in Secrets) while keeping keys readable for easier Git diffs.
  </Step>

  <Step title="Save">
    Save your manifest. The encrypted values will be stored safely in your GitOps repository and decrypted automatically when deployed.
  </Step>
</Steps>

<Tip>
  SOPS encryption requires initial setup. See [SOPS Encryption](/guides/sops) for configuration instructions.
</Tip>

***

Manifests are a powerful way to automate, standardize, and scale your Kubernetes operations with Ankra.

[Learn more about Stacks →](/concepts/stacks)

***

## Explore the Manifests API

Want to automate manifest management or integrate with your CI/CD workflows?
Check out the [API Reference](/api-reference/introduction) for endpoints to create, update, and apply manifests programmatically.
