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

# カスタムドメインと TLS 証明書の設定

SambaStack デプロイメントでカスタムドメインを TLS と併用するには、以下の手順に従います。

<Warning>
  本ガイドは、SambaStack Hosted デプロイメント専用です。
</Warning>

### ステップ 1: TLS 証明書の取得

信頼できる認証局 (CA) から、対象ドメインの TLS 証明書および秘密鍵を取得します。

### ステップ 2: Kubernetes TLS シークレットの作成

公式の [Kubernetes documentation](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_create/kubectl_create_secret_tls/) に従って、TLS 証明書と鍵用の Kubernetes シークレットを作成します。

コマンド例:

```bash theme={}
kubectl create secret tls <name-for-tls> \
  --cert=path/to/cert.crt \
  --key=path/to/key.key
```

### ステップ 3: DNS レコードの設定

以下のように、カスタムドメインを SambaStack サーバーにマッピングする DNS レコードを作成します。

| ドメイン | レコードタイプ | 値 |
| :- | :- | :- |
| `api.example.com` | CNAME | `api.sambanova.ai` |
| `api.example.com` | TXT | `<From installer log>` |
| `ui.example.com` | CNAME | `cloud.sambanova.ai` |
| `ui.example.com` | TXT | `<From installer log>` |

<Note>
  必要に応じて、SambaNova のサポート窓口に連絡し、使用すべきリージョンエンドポイントをご確認ください。
</Note>

### ステップ 4: sambastack.yaml の更新

`sambastack.yaml` 設定ファイルの `data → sambastack.yaml` の下に、ドメイン名と TLS シークレットの情報を正しいインデントで追記します。

```yaml theme={}
data:
  sambastack.yaml: |
    gateway:
      ingress:
        hosts:
          - host: api.example.com
            tlsSecretName: <name-for-tls>
    cloud-ui:
      ingress:
        hosts:
        - host: ui.example.com
          tlsSecretName: <name-for-tls>
```

<Note>
  完全な例については、[SambaStack.yaml リファレンス](/docs/ja/v2.2.3/sambastack/resources/sambastack-yaml) をご覧ください。
</Note>

### ステップ 5: 設定の適用

変更を適用します。

```bash theme={}
kubectl apply -f sambastack.yaml
```

### ステップ 6: 動作確認

TLS 証明書の処理とドメイン検証が正常に行われているかどうか、インストーラーログで確認します。

```bash theme={}
kubectl -n sambastack-installer logs -l sambanova.ai/app=sambastack-installer -f
```

これらの手順を完了すると、SambaStack デプロイメントは指定したカスタムドメインと TLS 証明書を使用するようになります。
