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
How to utilize GKE for QA environment
Search
Kenichi Masuda
June 18, 2018
Technology
1.4k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to utilize GKE for QA environment
Kenichi Masuda
June 18, 2018
More Decks by Kenichi Masuda
See All by Kenichi Masuda
2022-09-05 「明日から新規事業を作ってみよう(実践編)」トヨタ車体株式会社様ウェビナー
masudak
0
790
2022-08-10「明日から新規事業を作ってみよう」トヨタ車体株式会社様向けウェビナー
masudak
1
610
2022-09-05 「明日から新規事業を作ってみよう(実践編)」トヨタ車体株式会社様ウェビナー
masudak
0
70
2022-06-09「新規事業担当に必要な要素とは」ヤマトシステム開発株式会社様向けウェビナー
masudak
0
870
Development/QA environments and the Go tools in it
masudak
0
7.3k
Introduction of mercari SET team
masudak
0
13k
Recommendation for using your own tools
masudak
1
5.6k
Other Decks in Technology
See All in Technology
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
290
AI for Science時代を切り開く、政府の次世代HPC戦略の展望
gpuunite_official
0
130
ハーレムエンジニアリング
kazuma777777
0
190
AIで変わるエンジニアの働き方(仮)
naoinaoi
0
230
8bit CPU 2026
koba789
1
360
20260817_生成AIの動向と中学校・高等学校での活用を考える_v1.00_公開用
doradora09
PRO
0
140
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
290
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
240
【CEDEC2026】Creative Approaches to Localizing the Dialects and Unique Speech of Umamusume: Pretty Derby Characters in English
cygames
PRO
4
26k
My broken English still works: speaking at global OSS events
naruoga
0
120
AI画像認識を活用したゲーム内決済処理検証の自動化
gree_tech
PRO
0
100
国家プロジェクトを支える「さくらONE」 大規模LLM開発におけるGPU障害を乗り越えるクラスター運用戦略
gpuunite_official
0
170
Featured
See All Featured
Faster Mobile Websites
deanohume
310
32k
Embracing the Ebb and Flow
colly
88
5.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
480
The Invisible Side of Design
smashingmag
301
52k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
480
Balancing Empowerment & Direction
lara
6
1.2k
Are puppies a ranking factor?
jonoalderson
2
3.8k
A designer walks into a library…
pauljervisheath
211
24k
エンジニアに許された特別な時間の終わり
watany
108
250k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Designing for Timeless Needs
cassininazir
1
450
Transcript
How to utilize GKE for QA environment @masudak GCPUG Tokyo
June 2018
About me • @masudak ますだっくと呼ばれてます • 2016年4月入社 • SET(Software Engineer
in Test) • 最近感動したもの: ルンバ(自動化素晴らし い)
SET (Software Engineer in Test)
About SET • 2011年にGoogleが設立 • 「開発生産性とプロダクト品質の向上」がテー マ • SDET, SWETなど色々な名称ある
• メルカリSETは2016年10月設立 • 2017年春に出るUKアプリがトリガー • 当時作ったもの ◦ ローカル開発環境 ◦ QA環境 ◦ UIテスト自動化
開発フロー
開発フロー • PMが仕様をJIRAでFIX • エンジニア・デザイナーが「ローカル開発環 境」で実装 • PRを他のメンバーにレビューしてもらう • LGTM
• 「QA環境」でQAエンジニアがマニュアルQA • PMがリリース承認 • エンジニアがリリース
QA環境
QA環境 • QAエンジニアやエンジニアがQAするところ • 共通のDBや検索データを持つ • API, Frontend, Admin, Webなどが動く
• 他の人に影響を受けない独立した環境 • 独立したエンドポイント • トピックをデプロイ
QA環境要件 • 自分専用の環境 • 共通のWebUIからデプロイ • スケールしやすい • 可能な限り本番の構成を反映
2017年春
2017年春 • USアプリの刷新をすることに • PHP -> Go • Monolithic ->
Microservices • Kubernetes on GCP • 「いい感じ」でアプリをデプロイしたい
2017年前半 • CircleCIのビルド中にデプロイ • 新しい環境が自動的に • HTTPヘッダを見て、プロキシ
CircleCI • テストだけでなくreviewdogとかカバレッジと か • gcloud SDKやDockerのインストール • 古いpods削除 •
マニフェストファイルのテンプレートを書き換 え $ kubectl get pods --no-headers --selector='app=XXXX-api' | cut -f1 -d' ' | xargs kubectl delete pod そのあと $ make setup-branch-k8s
書き換え setup-branch-k8s: $(eval PR_NUMBER := $(shell basename ${CIRCLE_PULL_REQUEST})) sed -ie
"s/{{ PR_NUMBER }}/$(PR_NUMBER)/gi" ./tools/kubernetes/XXX-branch.tmpl.yml sed -ie "s/{{ BUILD_NUMBER }}/$(CIRCLE_BUILD_NUM)/gi" ./tools/kubernetes/XXX-branch.tmpl.yml /google-cloud-sdk/bin/kubectl apply -f ./tools/kubernetes/
Go reverse proxy director := func(req *http.Request) { xPrNumber :=
req.Header.Get("X-FOOBAR-PR") apisPort := 4000 req.URL.Scheme = "http" if xPrNumber != "" { req.URL.Host = fmt.Sprintf("foobar-api-%s:%d", xPrNumber, apisPort) } else { req.URL.Host = fmt.Sprintf("foobar-api:%d", apisPort) }
2017年後半
Spinnaker • CircleCIからはGCRにイメージをプッシュするだけ • それをトリガーにSpinnakerからデプロイ • オレオレyamlテンプレートがなくなる • とは言え、まだWebUI中心 •
PR podsに対応できてない
2017年後半 • reconciliation loop ◦ In Kubernetes, a controller is
a control loop that watches the shared state of the cluster through the apiserver and makes changes attempting to move the current state towards the desired state. deeeet氏: PRのstateをdesired stateとしよう!
K8s Controller for PR • ループしながら、PRの状況をチェック • Openだったら、既存のRSを複製 • 環境変数などを書き換え
• desired stateを変更 • k8sがそのdesiredに近づけていく • PR用のRS完成 • 必要に応じて、external-dnsでドメイン付与 もしかしたら、kustomizeに置き換わる運命???
終わりに • 開発生産性も品質もまだまだ追求できる • 開発環境だから、QA環境だからで終わらせない • 開発速度を上げるのはすごく大事 • たった一つのVMの時代から2年でここまで来た •
parityなどを考えるとまだまだ課題は多い • 是非情報交換していきましょう
We are hiring!! • ソフトウェアエンジニア(SET: Software Engineer in Test) •
ソフトウェアエンジニア(SET iOS: Software Engineer in Test iOS)
ご清聴 ありがとうございました