0Pricing
LLM Apps in Production (RAG + Vector DB + Caching) · 강의

배포 환경의 구성 및 비밀 정보 관리

환경 변수, 구성 맵, 비밀 관리자 등을 사용하여 구성을 외부화하고 API 키 같은 비밀 정보를 배포된 LLM 애플리케이션에 안전하게 주입하는 방법을 배웁니다.

배포 환경의 구성 및 비밀 정보 관리은(는) CoddyKit의 무료 LLM Apps in Production (RAG + Vector DB + Caching) 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 LLM Apps in Production (RAG + Vector DB + Caching) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. LLM Apps in Production (RAG + Vector DB + Caching) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Config Belongs Outside Code

The same LLM app image runs in dev, staging, and production. The only difference should be configuration, not the code. Hard-coding endpoints or keys forces a rebuild for every environment.

This is the core idea of config externalization.

Config vs Secrets

Two related but distinct concepts:

  • Config — non-sensitive settings: model name, temperature, log level
  • Secrets — sensitive values: API keys, DB passwords, tokens

Secrets need stricter handling and must never be logged.

Environment Variables

The simplest portable mechanism is environment variables.

import os

model = os.environ.get('LLM_MODEL', 'gpt-mini')
temp = float(os.environ.get('LLM_TEMPERATURE', '0.2'))
print('Using', model, 'at temp', temp)

The Twelve-Factor Approach

The twelve-factor methodology says store config in the environment. This keeps the build artifact identical across environments and avoids accidentally committing secrets into version control.

Kubernetes ConfigMaps

In Kubernetes, non-sensitive config lives in a ConfigMap and is injected as env vars or files.

apiVersion: v1
kind: ConfigMap
metadata:
  name: llm-config
data:
  LLM_MODEL: 'gpt-mini'
  LLM_TEMPERATURE: '0.2'

Kubernetes Secrets

Sensitive values go in a Secret object, kept separate from ConfigMaps and mounted with tighter access controls. Base64 encoding is not encryption, so enable encryption at rest.

apiVersion: v1
kind: Secret
metadata:
  name: llm-secrets
type: Opaque
stringData:
  OPENAI_API_KEY: 'set-via-pipeline'

Dedicated Secret Managers

For production, use a dedicated secret manager:

  • HashiCorp Vault
  • AWS Secrets Manager
  • GCP Secret Manager

They offer rotation, audit logs, and fine-grained access far beyond plain env vars.

Fetching Secrets at Runtime

Apps can pull secrets at startup from a manager instead of baking them in. This centralizes rotation.

def load_secret(name):
    store = {'OPENAI_API_KEY': 'sk-demo'}
    if name not in store:
        raise KeyError('missing secret: ' + name)
    return store[name]

print(load_secret('OPENAI_API_KEY')[:7])

Validating Config at Startup

Fail fast: validate that all required config and secrets are present when the app boots, not when the first request arrives. A clear startup error beats a confusing 500 in production.

Avoiding Secret Leaks

Common leak vectors to guard against:

  • Logging full request objects that include keys
  • Echoing env vars in debug endpoints
  • Committing .env files
  • Exposing secrets in error stack traces

Rotation and Per-Environment Keys

Use separate keys per environment and rotate them on a schedule. With a secret manager, rotation updates one place and all instances pick it up without a redeploy.

Quick Check

Test your understanding of Kubernetes config.

Recap

You learned to externalize config from code and separate it from secrets. Use environment variables and ConfigMaps for settings, Secrets and dedicated managers for sensitive values, validate everything at startup, and rotate keys per environment without leaking them in logs.

자주 묻는 질문

“배포 환경의 구성 및 비밀 정보 관리” 강의는 무료인가요?

네 — “배포 환경의 구성 및 비밀 정보 관리” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 LLM Apps in Production (RAG + Vector DB + Caching) 강의 전체를 잠금 해제할 수 있습니다. LLM Apps in Production (RAG + Vector DB + Caching) 강의에는 총 4개의 강의가 포함되어 있습니다.

“배포 환경의 구성 및 비밀 정보 관리”에서 뭘 배우나요?

환경 변수, 구성 맵, 비밀 관리자 등을 사용하여 구성을 외부화하고 API 키 같은 비밀 정보를 배포된 LLM 애플리케이션에 안전하게 주입하는 방법을 배웁니다. 브라우저에서 직접 실행하는 실습 코드로 LLM Apps in Production (RAG + Vector DB + Caching)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

LLM Apps in Production (RAG + Vector DB + Caching)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 LLM Apps in Production (RAG + Vector DB + Caching)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.

“배포 환경의 구성 및 비밀 정보 관리” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 LLM Apps in Production (RAG + Vector DB + Caching) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 LLM Apps in Production (RAG + Vector DB + Caching) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. Docker로 LLM 애플리케이션 컨테이너화하기
  2. 확장성을 위한 Kubernetes 오케스트레이션
  3. LLM 애플리케이션 배포를 위한 CI/CD
  4. 배포 환경의 구성 및 비밀 정보 관리
← LLM Apps in Production (RAG + Vector DB + Caching)(으)로 돌아가기