Skip to content

๐Ÿš€ Feat: enhance Kubernetes CI/CD pipeline with comprehensive Azure AKโ€ฆ#17

Merged
7SH7 merged 2 commits intomainfrom
feat/8/deploy
Aug 12, 2025
Merged

๐Ÿš€ Feat: enhance Kubernetes CI/CD pipeline with comprehensive Azure AKโ€ฆ#17
7SH7 merged 2 commits intomainfrom
feat/8/deploy

Conversation

@7SH7
Copy link
Member

@7SH7 7SH7 commented Aug 12, 2025

  • Add complete Kubernetes manifests (service, ingress, hpa, configmap, namespace, pvc)
  • Update CI/CD workflow with detailed Korean comments and comprehensive deployment steps
  • Add Azure Container Registry integration and AKS deployment automation
  • Create comprehensive GitHub Secrets documentation for production deployment
  • Support AWS RDS MySQL database integration with proper connection handling
  • Add auto-scaling, health checks, and production-ready security configurations
  • Include automated PR review system with detailed test and security reporting

Summary by CodeRabbit

  • ์Šคํƒ€์ผ

    • ์ฝ”๋“œ์˜ ๋ถˆํ•„์š”ํ•œ ๊ณต๋ฐฑ์„ ์ •๋ฆฌํ•ด ๊ฐ€๋…์„ฑ๊ณผ ์ผ๊ด€์„ฑ์„ ๊ฐœ์„ ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ๋Šฅ ๋™์ž‘์—๋Š” ๋ณ€ํ™”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.
  • ์ž‘์—…(Chores)

    • ๋ฐฑ์—”๋“œ ๊ตฌ์„ฑ(๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—ฐ๊ฒฐ ๊ด€๋ จ) ์„ค์ • ๊ฐ’์ด ๊ฐฑ์‹ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค, ์„ฑ๋Šฅ, ๋ณด์•ˆ ๋™์ž‘์—๋Š” ์˜ํ–ฅ์ด ์—†์œผ๋‚˜ ๋ฐฐํฌ/์„ค์ • ์‹œ ๊ด€๋ จ ์ž๊ฒฉ์ •๋ณด๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

โ€ฆS deployment

- Add complete Kubernetes manifests (service, ingress, hpa, configmap, namespace, pvc)
- Update CI/CD workflow with detailed Korean comments and comprehensive deployment steps
- Add Azure Container Registry integration and AKS deployment automation
- Create comprehensive GitHub Secrets documentation for production deployment
- Support AWS RDS MySQL database integration with proper connection handling
- Add auto-scaling, health checks, and production-ready security configurations
- Include automated PR review system with detailed test and security reporting

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Aug 12, 2025

Walkthrough

utils/database.py์—์„œ import ๋ฌธ๊ณผ DatabaseManager ํด๋ž˜์Šค ์„ ์–ธ ์‚ฌ์ด์˜ ๋ถˆํ•„์š”ํ•œ ๋นˆ ์ค„์„ ์ œ๊ฑฐํ–ˆ๊ณ , k8s/configmap.yaml์˜ ConfigMap ๋ฐ์ดํ„ฐ์—์„œ MYSQL_DATABASE ๊ฐ’์„ "multichat"์—์„œ "chatbot"์œผ๋กœ, MYSQL_USER ๊ฐ’์„ "root"์—์„œ "agriculMan"์œผ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ณต๊ฐœ API ์‹œ๊ทธ๋‹ˆ์ฒ˜ ๋ณ€๊ฒฝ์€ ์—†์Šต๋‹ˆ๋‹ค.

Changes

Cohort / File(s) Change Summary
์Šคํƒ€์ผ/ํฌ๋งคํŒ… ์ •๋ฆฌ
utils/database.py
import ๋ฌธ๊ณผ DatabaseManager ํด๋ž˜์Šค ์„ ์–ธ ์‚ฌ์ด์˜ ๋ถˆํ•„์š”ํ•œ ๋นˆ ์ค„ ์ œ๊ฑฐ; ๊ธฐ๋Šฅ์  ๋ณ€ํ™” ์—†์Œ
Kubernetes ์„ค์ • ์—…๋ฐ์ดํŠธ
k8s/configmap.yaml
ConfigMap smart-factory-config์˜ ๋ฐ์ดํ„ฐ ์—…๋ฐ์ดํŠธ: MYSQL_DATABASE "multichat" โ†’ "chatbot", MYSQL_USER "root" โ†’ "agriculMan"

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~8 minutes

Poem

๋‹น๊ทผ ํ•œ ํ† ๋ง‰, ๊นƒ์— ํ†กโ€”
ํ•œ ์ค„ ๋น„์šฐ๊ณ  ๋‚˜๋‹ˆ ์ฝ”๋“œ๋Š” ์ฝง๋…ธ๋ž˜,
์„ค์ • ๋ฐ”๊ฟ” ์ƒˆ ์ด๋ฆ„ ๋ถˆ๋Ÿฌ์ฃผ๊ณ ,
ํ† ๋ผ ๋ฐœ์ž๊ตญ์œผ๋กœ ์ปค๋ฐ‹ ์ฐ์—ˆ๋„ค ๐Ÿ‡
์ž‘์ง€๋งŒ ๋ฐ˜์ง, ๋ ˆํฌ๋Š” ํ™˜ํ•ด์กŒ์–ด.

โœจ Finishing Touches
๐Ÿงช Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/8/deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share
๐Ÿชง Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link

github-actions bot commented Aug 12, 2025

๐Ÿค– Multi-Agent Smart Factory Code Review (Kubernetes Ready)

๐Ÿ“Š Overall Test Results:

โš ๏ธ Some issues found - Please review before deployment

๐Ÿงช Test Results:

โŒ Quality checks failed

  • No tests found
  • Lint check: Passed โœ…

๐Ÿ”’ Security Scan Results:

  • No security issues found โœ…

๐Ÿš€ Kubernetes Deployment Info:

  • โš ๏ธ Checks failed - Fix issues before AKS deployment
    • ๐Ÿงช Code quality issues need resolution

โ˜ธ๏ธ Kubernetes Features:

  • Auto-scaling: HPA configured for dynamic scaling
  • Health checks: Liveness and readiness probes
  • Secrets management: Secure API key injection
  • Service discovery: Internal service networking
  • Ingress: External access configuration

๐Ÿ” Latest Updates:

  • PRESS_HOLE_DETECTION: New hole detection system
  • Bounding Box Analysis: Statistical analysis based on 6,697 samples
  • Issue Codes: PRESS-HOLE-{SEVERITY}-{HOLE_CLASS}-MISSING-{DATETIME}
  • Multi-hole Detection: PRESS-HOLE-{SEVERITY}-MULTI-MISSING-{DATETIME}

๐Ÿค– This review was automatically generated by GitHub Actions.
๐Ÿ“‹ Check detailed logs in Actions tab.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

๐Ÿงน Nitpick comments (2)
k8s/configmap.yaml (2)

19-19: YAMLLint: ๋ ๊ณต๋ฐฑ(trailing space) ์ œ๊ฑฐ ํ•„์š”

์ •์  ๋ถ„์„ ํžŒํŠธ์— ๋‚˜์˜จ ๋Œ€๋กœ Line 19 ๋์˜ ๊ณต๋ฐฑ์œผ๋กœ ์ธํ•ด ๋ฆฐํŠธ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ์ œ๊ฑฐํ•ด ์ฃผ์„ธ์š”.

-  # Database Configuration (non-sensitive) 
+  # Database Configuration (non-sensitive)

16-18: CORS ์™€์ผ๋“œ์นด๋“œ(*)๋Š” ์šด์˜ ๋ณด์•ˆ์— ๊ณผ๋„ํ•จ โ€” ํ—ˆ์šฉ ๋„๋ฉ”์ธ์œผ๋กœ ์ œํ•œ ๊ถŒ์žฅ

PR ๋ชฉํ‘œ๊ฐ€ โ€œ์šด์˜ ๋ณด์•ˆ ๊ตฌ์„ฑโ€ ๊ฐ•ํ™”์ธ ๋งŒํผ, ์šด์˜์—์„œ๋Š” ALLOWED_ORIGINS์˜ ์™€์ผ๋“œ์นด๋“œ ์‚ฌ์šฉ์„ ์ง€์–‘ํ•˜๊ณ  ๊ตฌ์ฒด ๋„๋ฉ”์ธ(๋“ค)๋กœ ์ œํ•œํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. CI์—์„œ ํ™˜๊ฒฝ๋ณ„๋กœ ์ฃผ์ž… ๊ฐ€๋Šฅํ•˜๋ฉด ๋” ์ข‹์Šต๋‹ˆ๋‹ค.

-  ALLOWED_ORIGINS: "*"
+  # ์‰ผํ‘œ ๊ตฌ๋ถ„์œผ๋กœ ์—ฌ๋Ÿฌ ๋„๋ฉ”์ธ ์ง€์›(์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํŒŒ์„œ๊ฐ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š”์ง€ ๊ฒ€์ฆ ํ•„์š”)
+  ALLOWED_ORIGINS: "https://your-prod-domain.com,https://www.your-prod-domain.com"
๐Ÿ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between b7bae8c and bcc757e.

๐Ÿ“’ Files selected for processing (1)
  • k8s/configmap.yaml (1 hunks)
๐Ÿงฐ Additional context used
๐Ÿช› YAMLlint (1.37.1)
k8s/configmap.yaml

[error] 19-19: trailing spaces

(trailing-spaces)

Comment on lines +20 to +21
MYSQL_DATABASE: "chatbot"
MYSQL_USER: "agriculMan"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿ’ก Verification agent

๐Ÿงฉ Analysis chain

DB ์Šคํ‚ค๋งˆ/์‚ฌ์šฉ์ž ๊ฐ’ ๋ณ€๊ฒฝ์— ๋”ฐ๋ฅธ ํ˜ธํ™˜์„ฑยท๊ถŒํ•œ ๊ฒ€์ฆ ํ•„์š”

MYSQL_DATABASE๋ฅผ chatbot์œผ๋กœ, MYSQL_USER๋ฅผ agriculMan์œผ๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ํ•ญ๋ชฉ์„ ๋ฐ˜๋“œ์‹œ ํ™•์ธํ•ด ์ฃผ์„ธ์š”.

  • ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ฝ”๋“œ์—์„œ ํ•ด๋‹น ENV ๊ฐ’์œผ๋กœ ์ ‘์†ํ•˜๋Š”์ง€(os.getenv ๋“ฑ) ์ผ์น˜ ์—ฌ๋ถ€
  • AKS ๋ฐฐํฌ ๋งค๋‹ˆํŽ˜์ŠคํŠธ(Deployment ๋“ฑ)๊ฐ€ ์ด ConfigMap์„ ์ฐธ์กฐํ•˜๊ณ  ์žˆ๋Š”์ง€
  • RDS MySQL์— chatbot ์Šคํ‚ค๋งˆ๊ฐ€ ์กด์žฌํ•˜๊ณ , agriculMan ์‚ฌ์šฉ์ž์—๊ฒŒ ์ตœ์†Œ ํ•„์š”ํ•œ ๊ถŒํ•œ์ด ๋ถ€์—ฌ๋๋Š”์ง€
  • ๊ด€๋ จ Secret์— MYSQL_PASSWORD๊ฐ€ agriculMan ๊ธฐ์ค€์œผ๋กœ ์กด์žฌ/๋งคํ•‘๋˜๋Š”์ง€

ํ•„์š” ์‹œ ์ ๊ฒ€์„ ์ž๋™ํ™”ํ•  ์ˆ˜ ์žˆ๋„๋ก ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ฒจ๋ถ€ํ•ฉ๋‹ˆ๋‹ค.

์ฐธ๊ณ ๋กœ RDS์— ์Šคํ‚ค๋งˆ/์‚ฌ์šฉ์ž ์ƒ์„ฑ๊ณผ ๊ถŒํ•œ ๋ถ€์—ฌ๊ฐ€ ํ•„์š”ํ•˜๋‹ค๋ฉด(์šด์˜ ํ™˜๊ฒฝ์—์„œ ์‹คํ–‰ ์ฃผ์˜):

CREATE DATABASE IF NOT EXISTS chatbot DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'agriculMan'@'%' IDENTIFIED BY '<<STRONG_PASSWORD>>';
GRANT ALL PRIVILEGES ON chatbot.* TO 'agriculMan'@'%';
FLUSH PRIVILEGES;

๐Ÿ Script executed:

#!/bin/bash
set -euo pipefail

echo "== grep ENV ์‚ฌ์šฉ์ฒ˜ ์ ๊ฒ€ =="
rg -n -S $'MYSQL_(DATABASE|USER)' -A 2 -B 2 || true

echo -e "\n== K8s ๋งค๋‹ˆํŽ˜์ŠคํŠธ์—์„œ ConfigMap/ENV ์ฐธ์กฐ ์ ๊ฒ€ =="
rg -n -S $'smart-factory-config|envFrom:|configMapRef:' -A 3 -B 3 k8s || true

echo -e "\n== Secret์—์„œ MYSQL_PASSWORD ์กด์žฌ ํ™•์ธ =="
fd -a -i -t f 'secret.*\.ya?ml' k8s 2>/dev/null | xargs -I{} sh -c 'echo "--- {} ---"; rg -n -S "MYSQL_PASSWORD|mysql.*password" {} || true'

echo -e "\n== ์ฝ”๋“œ์—์„œ DB ENV ํ‚ค ์‚ฌ์šฉ ์ ๊ฒ€ (utils/database.py ๋“ฑ) =="
rg -n -S $'MYSQL_(DATABASE|USER|PASSWORD)|DB_NAME|DB_USER' -A 2 -B 2 || true

Length of output: 8481


DB ENV ํ‚ค ์ •ํ•ฉ์„ฑ ๋ฐ ๊ถŒํ•œ ๊ฒ€์ฆ ํ•„์š”

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„ค์ •(config/settings.py ๋“ฑ)์€ DB_NAME/DB_USERNAME ํ™˜๊ฒฝ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์ง€๋งŒ, ํ˜„์žฌ ConfigMap์—๋Š” MYSQL_DATABASE/MYSQL_USER๋งŒ ์ •์˜๋˜์–ด ์žˆ์–ด ๋ณ€๊ฒฝํ•œ ๊ฐ’์ด ์‹ค์ œ ์ฝ”๋“œ์— ๋ฐ˜์˜๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋ฐ˜๋“œ์‹œ ์•„๋ž˜ ํ•ญ๋ชฉ์„ ํ™•์ธยท์ˆ˜์ •ํ•ด ์ฃผ์„ธ์š”.

  • k8s/configmap.yaml
    โ€ข ๊ธฐ์กด
    MYSQL_DATABASE: "chatbot"
    MYSQL_USER:     "agriculMan"
    โ€ข ์ˆ˜์ • ์˜ˆ์‹œ (DB_* ํ‚ค๋กœ ์ผ์น˜์‹œํ‚ค๊ฑฐ๋‚˜, ์ฝ”๋“œ์—์„œ MYSQL_* ๋ฅผ ์‚ฌ์šฉํ•˜๋„๋ก ๋ณ€๊ฒฝ)
    DB_NAME:     "chatbot"
    DB_USERNAME: "agriculMan"
  • k8s/deployment.yaml
    โ€ข envFrom: configMapRef: smart-factory-config๋ฅผ ํ†ตํ•ด ์˜ฌ๋ฐ”๋ฅธ ํ‚ค(DB_NAME, DB_USERNAME ๋˜๋Š” MYSQL_*)๊ฐ€ ์ฃผ์ž…๋˜๋Š”์ง€ ๊ฒ€์ฆ
  • RDS MySQL
    โ€ข chatbot ์Šคํ‚ค๋งˆ๊ฐ€ ์ƒ์„ฑ๋˜์–ด ์žˆ๋Š”์ง€
    โ€ข agriculMan ์‚ฌ์šฉ์ž์—๊ฒŒ ํ•„์š”ํ•œ ์ตœ์†Œ ๊ถŒํ•œ(SELECT, INSERT, UPDATE ๋“ฑ)์ด ๋ถ€์—ฌ๋๋Š”์ง€ ํ™•์ธ
  • k8s Secret (smart-factory-secrets)
    โ€ข agriculMan ๊ณ„์ • ์ ‘์†์šฉ MYSQL_PASSWORD (๋˜๋Š” DB_PASSWORD) ํ‚ค๊ฐ€ ์กด์žฌํ•˜๊ณ  ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋งคํ•‘๋๋Š”์ง€ ๊ฒ€์ฆ

ํ•„์š” ์‹œ ์•„๋ž˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ฐธ๊ณ ํ•ด ์ž๋™ํ™” ๊ฒ€์ฆ์„ ์ถ”๊ฐ€ํ•˜์„ธ์š”.

๐Ÿค– Prompt for AI Agents
In k8s/configmap.yaml around lines 20-21, the ConfigMap keys (MYSQL_DATABASE,
MYSQL_USER) donโ€™t match the applicationโ€™s expected env vars (DB_NAME,
DB_USERNAME), causing settings to be ignored; update the keys in
k8s/configmap.yaml to DB_NAME and DB_USERNAME (or change app to read MYSQL_*),
then verify k8s/deployment.yaml uses envFrom: configMapRef: smart-factory-config
so the correct keys are injected, ensure k8s/secret smart-factory-secrets
contains the corresponding DB_PASSWORD or MYSQL_PASSWORD key, and confirm the
RDS has the chatbot schema and agriculMan user has required privileges.

@7SH7 7SH7 merged commit 6f025f9 into main Aug 12, 2025
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments