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

# イングレス構成とログイン

## DNSレコード登録

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/04_21.png" />
</Frame>

> Route53ダッシュボードの設定対象ドメインページで`Create record`をクリックし、次の値のレコードを生成してください。

* **Record name**: \*
* **Record type**: A
* **value**: EC2インスタンスのPublic IPアドレス

<Info>
  この手順で、エールでデプロイしたサービスに登録されたルートドメインがプレビューURLとして付与されます。
</Info>

<Note>
  次のコマンドでネームサーバにレコードが反映されたか確認できます。
</Note>

```bash theme={null}
dig "<レコードに登録したドメイン>"
```

## Cert Managerのインストール

> 次のコマンドを実行し、**Cert Manager**をインストールしてください。

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

```bash theme={null}
helm install \
      cert-manager jetstack/cert-manager \
      --namespace cert-manager \
      --create-namespace \
      --version v1.15.3 \
      --set crds.enabled=true
```

## ClusterIssuer設定とTLS証明書発行

> 次のコマンドでClusterIssuerとTLS証明書を作成してください。

```bash theme={null}
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Secret
metadata:
  name: aws-secret-access-key
  namespace: cert-manager
type: Opaque
stringData:
  aws-secret-access-key: $AWS_SECRET_ACCESS_KEY
---
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: ale-issuer
  namespace: cert-manager
spec:
  acme:
    email: $ACME_EMAIL
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: ale-issuer
    solvers:
      - http01:
          ingress:
            class: nginx
      - dns01:
          route53:
            region: $AWS_REGION
            hostedZoneID: $AWS_HOSTED_ZONE_ID
            accessKeyID: $AWS_ACCESS_KEY_ID
            secretAccessKeySecretRef:
              name: aws-secret-access-key
              key: aws-secret-access-key
        selector:
          dnsZones:
            - $AWS_DOMAIN
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: ale-app-tls
  namespace: cert-manager
spec:
  dnsNames:
    - "*.$AWS_DOMAIN"
  issuerRef:
    kind: ClusterIssuer
    name: ale-issuer
  secretName: ale-app-tls
EOF
```

## エールでIngress設定

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/en/04_22.png" />
</Frame>

> `https://app.[ドメイン]`にアクセスして、エールで管理者を生成し、インストールを完了してください。

<Note>
  プレビュードメインフィールドには接続したルートドメインを入力します。
</Note>

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/ja/04_23.png" />
</Frame>

> 左サイドバーのクラスターページ設定タブで、ネットワークセクションに以下の値を入力し、`適用`をクリックします。

* **プレビュードメイン**: 接続したルートドメイン
* **HTTPS使用**
  * **チェック**: インターネット環境
  * **チェック解除**: イントラネット/閉鎖網環境
* **証明書シークレット名**: ale-app-tls
* **証明書シークレットネームスペース**: cert-manager
* **証明書発行者**: ale-issuer
* **イングレスクラス**: nginx
* **ロードバランサータイプ**: NodePort

<Info>
  ダッシュボードの左上にあるスペース名をクリックすると、運用システムにアクセスできます。

  <Frame>
    <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/ja/04_24.png" />
  </Frame>
</Info>

<Note>
  運用システムメニューは、運用システムへのアクセス権限を持つアカウントにのみ表示されます。
</Note>

## エール利用開始

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/setup/ec2/images/ja/04_25.png" />
</Frame>

> 運用システム左上の`Back`をクリックするか、`https://app.[ドメイン]`にアクセスしてエールに接続し、登録完了プロセスを経ると開発者ダッシュボードを使用できます。

<Tip>
  [ビルドされたイメージの保存先として、AWS ECRなどのマネージドコンテナレジストリを使用できます。](/ja/registry/aws-ecr)コンテナレジストリが接続されていない場合、ローカル環境で稼働中のDockerエンジンでイメージを管理します。
</Tip>

<Info>
  運用システムおよび開発者ダッシュボードの使用法は以下のカードをご参照ください。
</Info>

<CardGroup cols={2}>
  <Card title="運用システムガイド" icon="gear" href="/ja/operations/user-management" horizontal />

  <Card title="開発者ガイド" icon="code" href="/ja/developers/deploy" horizontal />
</CardGroup>
