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

# Credentials

> Keep every credential in your secret manager, or in a Kubernetes Secret, and name it in the Jedify resource.

Your Jedify resource never holds a secret. Each credential it needs is a reference: a model provider's key, its certificate authority or its access key, your identity provider's client secret, and a data source's credentials. A reference takes one of two shapes.

## A secret in your secret manager

```yaml theme={null}
clientSecret:
  externalSecret:
    remoteRef: { key: jedify-okta-client-secret }
```

External Secrets, which the platform installs, reads the secret and keeps a copy in the cluster. Without a `storeRef`, it reads from Secret Manager in your installation's own project, through the platform's store, `gcp-secretmanager`. Nobody makes a Kubernetes Secret by hand.

`remoteRef` also takes:

* `property`: one field of a secret that holds JSON.
* `version`: a version of the secret. The latest by default.

### Another project, or another secret manager

Declare a store for it, and name the store. For Secret Manager in another project:

```yaml theme={null}
apiVersion: external-secrets.io/v1
kind: ClusterSecretStore
metadata:
  name: secrets-project
spec:
  provider:
    gcpsm: { projectID: acme-secrets }
```

```yaml theme={null}
clientSecret:
  externalSecret:
    storeRef: { kind: ClusterSecretStore, name: secrets-project }
    remoteRef: { key: okta-client-secret }
```

A store can read AWS Secrets Manager, HashiCorp Vault, Azure Key Vault, or any other provider External Secrets supports. It holds the provider and how to sign in to it, so the Jedify resource needs to know neither. Grant the identity the store signs in as read access to the secrets.

On a new cluster, apply your store after the operator's first install: its kind exists only once the platform has installed External Secrets. Until then, the credential waits, with the message `there is no ClusterSecretStore <name>`, and the operator tries again every 30 seconds.

## A Kubernetes Secret

```yaml theme={null}
clientSecret: { name: okta, key: client-secret }
```

A key of a Secret you keep yourself. Make it in the namespace the credential is read in:

| Credential | Namespace |
| - | - |
| A model provider's (`spec.models`) | `jedify` |
| The identity provider's client secret (`spec.identity`) | `jedify` |
| A data source's (`spec.dataSources`) | `jedify-be` |

## Rotation

Change the secret: add a version in your secret manager, or change the Secret's key. External Secrets reads every secret again each hour. A new value reaches what uses it on its own: the model gateway restarts, a data source connects again, and the identity provider is updated in the sign-in service.

If a refresh fails after one that worked, the cluster keeps the last value, and it stays in use.

## When a credential waits

Until a secret first reaches the cluster, what needs it waits. A data source shows `Waiting`, and the install shows `Installed` as `False` with the reason `WaitingForCredentials`. Each message carries External Secrets' own reason. To see every one:

```sh theme={null}
kubectl get externalsecrets -A
```

External Secrets keeps a provider's own error, such as a permission denied or a secret that doesn't exist, out of these messages, because it may carry the secret. Its controller's log has it:

```sh theme={null}
kubectl -n jedify logs -l app.kubernetes.io/name=external-secrets --tail=100
```

## Cleaning up

The operator deletes a copy no field names any more. Deleting the Jedify resource leaves them, as it leaves the installation. To remove them all:

```sh theme={null}
kubectl delete externalsecrets -A -l jedify.com/credential-of=jedify
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.