microservices-demo

(★ 20,854)

Kubernetes, Istio, gRPC를 선보이는 10개의 마이크로서비스로 구성된 샘플 클라우드 퍼스트(cloud-first) 애플리케이션입니다.

파일 탐색기

  • .editorconfig
  • .gitattributes
  • .gitignore
  • cloudbuild.yaml
  • LICENSE
  • README.md
  • skaffold.yaml

# 설치 가이드

kubernetes / docker / go

설치 및 실행 절차

git clone --depth 1 --branch v0 https://github.com/GoogleCloudPlatform/microservices-demo.git

저장소를 클론합니다.

export PROJECT_ID=<PROJECT_ID>

구글 클라우드 프로젝트 ID를 설정합니다.

gcloud container clusters create-auto online-boutique --project=${PROJECT_ID} --region=us-central1

GKE 오토 파일럿 클러스터를 생성합니다.

kubectl apply -f ./release/kubernetes-manifests.yaml

쿠버네티스 매니페스트를 배포합니다.

핵심 명령어

gcloud services enable container.googleapis.com --project=my-project

GKE API 등 필요한 구글 클라우드 서비스를 활성화합니다.

kubectl apply -f ./release/kubernetes-manifests.yaml

쿠버네티스 리소스를 클러스터에 적용하여 애플리케이션을 배포합니다.

kubectl get pods

클러스터 내의 파드 실행 상태를 확인합니다.

배포 전 Google Cloud 프로젝트 및 쿠버네티스 권한 설정이 필요합니다.

# CDN으로 사용하기

jsDelivr

jsDelivr는 공개 GitHub 리포지토리를 별도 설정 없이 CDN으로 즉시 서빙합니다. 버전과 파일을 고르면 웹페이지에 바로 붙일 수 있는 링크와 예시 코드가 만들어집니다.

릴리즈 타임라인

활발히 관리 중

명령어 용어집

이 문서에서 사용된 명령어를 모아봤습니다. 낯선 명령어가 있다면 펼쳐서 확인해보세요.

🔍

gcloud container

설명 보기 ▼

Manage containerized applications on Kubernetes and clusters.
See also: `gcloud`.

gcloud auth configure-docker

Register `gcloud` as a Docker credential helper:

gcloud container clusters create {{cluster_name}}

Create a cluster to run GKE containers:

gcloud container clusters list

List clusters for running GKE containers:

🔍

gcloud

설명 보기 ▼

Google Cloud Platform을 위한 공식 CLI 도구.
참고: `gcloud` 하위 명령에는 자체 사용 설명서가 있습니다.
더 많은 정보: <https://docs.cloud.google.com/sdk/gcloud>.

gcloud config list

활성 구성에서 모든 속성 나열:

gcloud auth login

Google 계정에 로그인:

gcloud config set project {{project_name}}

활성 프로젝트 설정:

🔍

git clone

설명 보기 ▼

Clone an existing repository.

git clone {{remote_repository_location}} {{path/to/directory}}

Clone an existing repository into a new directory (the default directory is the repository name):

git clone --recursive {{remote_repository_location}}

Clone an existing repository and its submodules:

git clone {{[-n|--no-checkout]}} {{remote_repository_location}}

Clone only the `.git` directory of an existing repository:

🔍

git

설명 보기 ▼

분산 버전 관리 시스템.
`commit`, `add`, `branch`, `checkout`, `push` 등의 특정 하위 명령어는 고유의 문서가 따로 있습니다.
더 많은 정보: <https://git-scm.com/docs/git>.

git init

하위 명령어 실행:

git clone {{https://example.com/repo.git}}

특정 레파지토리 위치에서 Git 하위 명령어 실행:

git status

주어진 설정으로 Git 하위 명령어 실행:

🔍

kubectl apply

설명 보기 ▼

Manage applications through files defining Kubernetes resources.
Create and update resources in a cluster.

kubectl apply {{[-f|--filename]}} {{path/to/file}}

Apply a configuration to a resource by file name:

kubectl apply {{[-k|--kustomize]}} {{path/to/directory}}

Apply a configuration to a resource from `kustomization.yaml` in a directory:

{{cat pod.json}} | kubectl apply {{[-f|--filename]}} -

Apply a configuration to a resource by `stdin`:

🔍

kubectl get

설명 보기 ▼

Get Kubernetes objects and resources.

kubectl get {{[ns|namespaces]}}

Get all namespaces in the current cluster:

kubectl get {{[no|nodes]}} {{[-n|--namespace]}} {{namespace}}

Get nodes in a specified namespace:

kubectl get {{[po|pods]}} {{[-n|--namespace]}} {{namespace}}

Get pods in a specified namespace:

🔍

kubectl

설명 보기 ▼

Kubernetes 클러스터에서 명령을 실행하기 위한 명령줄 인터페이스.
`run`과 같은 일부 하위 명령에는 자체 사용 설명서가 있습니다.
더 많은 정보: <https://kubernetes.io/docs/reference/kubectl/>.

kubectl get {{pods|service|deployment|ingress|...}} {{[-o|--output]}} wide

리소스에 대한 정보를 자세히 나열:

kubectl label pods {{name}} unhealthy=true

지정된 포드에 'unhealthy' 레이블과 'true' 값을 추가:

kubectl get all

다양한 유형의 모든 리소스 나열:

🔍

kustomize

설명 보기 ▼

Kubernetes 리소스를 쉽게 배포.
더 많은 정보: <https://github.com/kubernetes-sigs/kustomize/blob/master/site/content/en/docs/Reference/CLI/_index.md>.

kustomize create --resources {{deployment.yaml,service.yaml}} --namespace {{staging}}

리소스 및 네임스페이스가 포함된 커스터마이제이션 파일 생성:

kustomize build . | kubectl apply {{[-f|--filename]}} -

커스터마이제이션 파일을 빌드하고 `kubectl`로 배포:

kustomize edit set image {{busybox=alpine:3.6}}

커스터마이제이션 파일에 이미지 설정:

// repository documentation