エールを使用するには、Node.js 20以上が必要です。


クラスターのセットアップ

エールのインストールと実行

1

以下のコマンドを入力してale-runパッケージをインストールします。

mkdir ale-run
cd ale-run
npm i @ale-run/runtime@latest
2

以下のコマンドを入力してNginx Ingress Controllerをインストールしてください。

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.11.2/deploy/static/provider/cloud/deploy.yaml
kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission
kubectl patch ingressclass nginx --type='merge' -p '{"metadata": {"annotations": {"ingressclass.kubernetes.io/is-default-class": "true"}}}'
3

以下のコマンドを入力してMetrics Serverをインストールしてください。

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
4

以下のコマンドを入力してエールを開発モードで実行します。

npx aled dev
5

エールを使用してアプリケーションをデプロイするクラスターを選択します。クラスターの一覧は`~/.kube/config`に登録されたコンテキストを通じて表示されます。

? Select the k8s cluster to use. › Select the k8s cluster to use.
    No Cluster
    orbstack
❯   docker-desktop

以下のようにログが表示されたら、実行が完了したことになります。

...
[INFO] [plugin:cloudtype-apps] plugin @cloudtype/apps is installed {}
[INFO] [plugin:cloudtype-apps] plugin @cloudtype/apps is activate {}
[INFO] [pde:init] plugin "@cloudtype/apps" loaded! 
[INFO] [k8s] KubernetesClusterType initialized with agent {"connection":{"context":"docker-desktop","namespace":"ale-pde"},"stat":{"db":{"url":"mongodb://127.0.0.1:64000/","dbName":"ale-pde"}}}
[INFO] [k8s] ConfigContext initialized with {"connection":{"context":"docker-desktop","namespace":"ale-pde"},"stat":{"db":{"url":"mongodb://127.0.0.1:64000/","dbName":"ale-pde"}}}
[INFO] [k8s] connect k8s to "docker-desktop" 
[INFO] [k8s] [agent] cluster agent initialized 
[WARN] [k8s] ConfigMap.get ale-pde agent-config 
[INFO] [pde:agent] Ale Agent is initialized with config  
[INFO] [pde:init] Ale Agent httpsd is listening at 127.0.0.1:9801 
[INFO] [k8s] config loaded from cluster from "ale-pde/agent-config" 
[INFO] [stat] stat controller init {"collector":{"prefix":"ale"},"db":{"url":"mongodb://127.0.0.1:64000/","dbName":"ale-pde"},"connection":{"context":"docker-desktop","namespace":"ale-pde"}}
[INFO] [stat] connect k8s to "docker-desktop" 
[INFO] [stat] stat watcher started 

実行中にデータベース競合が発生した場合、以下のコマンドで既存のエールデータを削除し、再実行してください。

rm -r ~/.ale-dev  

ローカル環境とGitHubを連携し、GitHubリポジトリのソースコードをデプロイできます。

ダッシュボードにアクセス

ブラウザのアドレスバーにhttp://localhost:9001を入力すると、エールダッシュボードにアクセスできます。初回アクセス時は、デフォルトで作成される@devスペースに接続されます。

デプロイ

ダッシュボードのまたは⌘ + Kで生成されるデプロイモーダルからHTTPBinを選択します。

設定を変更せずに、画面下部のデプロイをクリックします。

サービスの起動が完了すると、画面に表示される状態が稼働中に変更されます。アクセスをクリックすると、起動したサービスに接続できます。

ローカル環境とGitHubを連携してGitHubリポジトリをデプロイしたり、SSH認証を使用してプライベートリポジトリをデプロイすることができます。一般的なデプロイについてのガイドはエールでデプロイページをご参照ください。