Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
さくらのクラウド AppRun と GitHub Actions でお手軽サーバレス構築
Search
cyokozai
October 27, 2025
Technology
1
84
さくらのクラウド AppRun と GitHub Actions でお手軽サーバレス構築
さくらのクラウドの新しいアプリケーション実行基盤である「AppRun(ベータ版)」を使用して、サーバレスアプリケーションを構築する方法を解説する
cyokozai
October 27, 2025
Tweet
Share
More Decks by cyokozai
See All by cyokozai
塩漬けになったVM それ、Kubernetesで動かせますよ
yusuke427
1
180
KubeVirt の Live Migration をやってみる | Try KubeVirt's Live Migration on Nekko Cloud
yusuke427
1
490
学生プライベートクラウドはKubeVirt の夢を見るか?
yusuke427
1
91
SREについて学ぶスリーシェイクのインターン
yusuke427
1
76
学生サークルで開発するVMプロビジョニングツール
yusuke427
1
82
Juliaを書いていて「便利だな〜」と 思ってたらスライド出来上がってた
yusuke427
1
57
あした話したくなるSREとPlatform Engineering
yusuke427
2
130
Terraform × cloud-init で VM のセットアップをいい感じにする話
yusuke427
1
2.2k
Other Decks in Technology
See All in Technology
HonoとJSXを使って管理画面をサクッと型安全に作ろう
diggymo
0
180
AIエージェント入門 〜基礎からMCP・A2Aまで〜
shukob
1
170
Okta Identity Governanceで実現する最小権限の原則 / Implementing the Principle of Least Privilege with Okta Identity Governance
tatsumin39
0
170
IBC 2025 動画技術関連レポート / IBC 2025 Report
cyberagentdevelopers
PRO
2
120
初めてのDatabricks Apps開発
taka_aki
1
370
Wasmの気になる最新情報
askua
0
190
プレイドのユニークな技術とインターンのリアル
plaidtech
PRO
1
340
SQLAlchemy の select(User).where(User.id =="123") を理解してみる/sqlalchemy deep dive
3l4l5
3
340
Databricks AI/BI Genie の「値ディクショナリー」をAmazonの奥地(S3)まで見に行く
kameitomohiro
1
400
Dify on AWS 環境構築手順
yosse95ai
0
120
オブザーバビリティと育てた ID管理・認証認可基盤の歩み / The Journey of an ID Management, Authentication, and Authorization Platform Nurtured with Observability
kaminashi
1
610
OTEPsで知るOpenTelemetryの未来 / Observability Conference Tokyo 2025
arthur1
0
190
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4k
Build your cross-platform service in a week with App Engine
jlugia
233
18k
Become a Pro
speakerdeck
PRO
29
5.6k
Producing Creativity
orderedlist
PRO
347
40k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Optimizing for Happiness
mojombo
379
70k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Embracing the Ebb and Flow
colly
88
4.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
890
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Building an army of robots
kneath
305
46k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
Transcript
さくらのクラウド AppRun と GitHub Actions で お手軽サーバレス構築 井上 裕介
井上 裕介 a.k.a cyokozai 千葉工業大学大学院 情報科学研究科 情報工学専攻 修士1年 ❏ ネットワークコンテンツ研究会
Nekko Cloud Team ❏ 株式会社スリーシェイク sreake事業部 学生インターン
1. さくらのクラウド AppRun 2. 手動でサーバレスへデプロイ 3. GitHub Actions による継続デプロイ 4.
感想 アジェンダ
さくらのクラウド AppRun
AppRun β https://cloud.sakura.ad.jp/lp/apprun/ • Scale to Zero • マネージドサービス •
カナリアリリース
手動でサーバレスへ デプロイ
今回デプロイしたアプリケーション https://github.com/yannh/kubeconform Kubeconform • マニフェストのバリデーション を行ってくれるCLIツール • 各CRDに対応可能 • Kubernetesのスキーマ情報を
元に型チェックなどを行う
• YAMLを貼り付け/選択 • 「判定を実行」でPOST • 結果判定を表示 ◦ true ◦ error
手動デプロイの手順 1. コンテナレジストリ作成 2. 使用するイメージをCRへ Push 3. アプリを作成 (GUI操作) 4.
デプロイ完了
ログイン → AppRun β
新たにコンテナレジストリを作成
None
各種設定とユーザ登録
コンテナレジストリにイメージをプッシュ # CRにログイン docker login kubeconformserver.sakuracr.jp # イメージをbuildする docker build
-f Dockerfile -t kubeconformserver.sakuracr.jp/kubeconformserver:latest . # sakuracr.jpにpushする docker push kubeconformserver.sakuracr.jp/kubeconformserver:latest
Q. DockerHubを直接使いたいんだけど....? • AppRun βで利用できるコンテナレジストリはさくらのクラウドが 提供しているコンテナレジストリ (OCI準拠) のみ • DockerHubやGitHub
Container Registoryのイメージを使用する場合は、 一度ローカルにPullした上でさくらのクラウドにPushする必要がある
アプリケーションの作成
各種設定 https://manual.sakura.ad.jp/cloud/apprun/glossary.html
各種設定 さくらのコンテナ レジストリからPull 認証情報の設定 vCPU使用量の上限 (0.1~1 コア) メモリー使用量の上限 (256MiB~2GiB) アプリケーション名
ポート番号 ヘルスチェックの設定 (10秒ごとの監視) 環境変数の定義 インスタンス数の 自動調整範囲 同時リクエスト数 リクエストタイムアウト https://manual.sakura.ad.jp/cloud/apprun/glossary.html
デプロイ完了🙌
• ログ • メトリクス ◦ 平均リクエスト数 ◦ CPU ◦ メモリ
簡単な監視も可能
もっとCloud Nativeで ラクしたい!🥺
GitHub Actions による 継続デプロイ
• GoアプリケーションをさくらのAppRunにデプロイする フローを自動化するためのComposite Actions → Dockerfileがなくてもデプロイ可能 • 登録されたオブジェクトストレージのバケットに SQLite レプリカの作成
→ データ永続化 GitHub Actions: sacloud_apprun_actions
自動デプロイの処理の流れ
ワークフロー name: Kubeconformserver - Sacloud AppRun Actions on: push: branches:
- main workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deployment id: deploy uses: ippanpeople/
[email protected]
with: use-repository-dockerfile: true app-dir: ./src sakura-api-key: ${{ secrets.SAKURA_API_KEY }} sakura-api-secret: ${{ secrets.SAKURA_API_SECRET }} container-registry: ${{ secrets.REGISTRY }} container-registry-user: ${{ secrets.REGISTRY_USER }} container-registry-password: ${{ secrets.REGISTRY_PASSWORD }} port: '8080'
Name Value REGISTRY コンテナレジストリの URL REGISTRY_USER コンテナレジストリのユーザー名 REGISTRY_PASSWORD コンテナレジストリのパスワード SAKURA_API_KEY
さくらの API キー SAKURA_API_SECRET さくらの API シークレット STORAGE_BUCKET_NAME オブジェクトストレージのバケット名 STORAGE_ACCESS_KEY オブジェクトストレージのアクセスキー STORAGE_SECRET_KEY KEY オブジェクトストレージのシークレットキー GitHubにシークレットを登録 リポジトリのSettings > Secrets and variablesから各種設定を入力
デプロイ完了 (2回目) 🙌
バージョンごとに荷重ルーティングが可能
実践 (30秒くらい時間使う)
感想
良かった点 • シンプルな設定項目 • GitHub Actionsを使用したCI/CDの構築 • Terraform使用可能 • FaaSとして簡易的なジョブを投げるのにはちょうど良い
改善してほしい点 • さくらのコンテナレジストリ (sakuracr.jp) 以外は不可 • 非httpエンドポイント, 複数ポート非対応 • 監視項目をカスタム
• Web UI の細かな修正
Thank you for yourkind attention! kubeconfirmserver リポジトリ公開中 ⇨ kubeconfirmserver 公開中
⇨