
이 블로그는 여러 파트로 구성된 블로그 시리즈의 일부로, Kubernetes에서 애플리케이션을 실행하는 방법을 보여줍니다. 이 블로그는 카우치베이스오픈소스 NoSQL 분산 문서 데이터베이스인 Docker
컨테이너.
- 1부에서는 Vagrant를 사용하여 Kubernetes 클러스터를 시작하는 방법에 대해 설명했습니다. Vagrant의 Kubernetes
- 2부에서는 Amazon Web Services에 대해서도 동일한 작업을 수행했습니다. 아마존 웹 서비스의 Kubernetes
- 3부에서는 Google Cloud에 대해서도 동일한 작업을 수행했습니다. 구글 클라우드의 쿠버네티스
이 네 번째 파트에서 보여드릴 내용입니다:
- Azure에서 Kubernetes 클러스터를 설정하고 시작하는 방법
- 쿠버네티스 클러스터에서 도커 컨테이너 실행하기
- 쿠버네티스에서 파드를 서비스로 노출하기
- 클러스터 종료
많은 분들께 감사드립니다. 콜미킨스 이 레시피를 도와주셔서 감사합니다.
Azure CLI 설치 및 구성
Azure CLI 는 Azure 애플리케이션을 개발, 배포 및 관리하기 위한 명령줄 인터페이스입니다. Azure에 Kubernetes 클러스터를 설치하기 위해 필요합니다.
- 노드를 설치합니다:
123456789101112131415brew install node==> Downloading https://homebrew.bintray.com/bottles/node-6.2.0.yosemite.bottle.tar.gz######################################################################## 100.0%==> Pouring node-6.2.0.yosemite.bottle.tar.gz==> CaveatsPlease note by default only English locale support is provided. If you needfull locale support you should either rebuild with full icu:`brew reinstall node --with-full-icu`or add full icu data at runtime following:https://github.com/nodejs/node/wiki/Intl#using-and-customizing-the-small-icu-buildBash completion has been installed to:/usr/local/etc/bash_completion.d==> Summary? /usr/local/Cellar/node/6.2.0: 3,979 files, 40.4M - Azure CLI를 설치합니다:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286npm install -g azure-cli/usr/local/bin/azure -> /usr/local/lib/node_modules/azure-cli/bin/azure> fibers@1.0.13 install /usr/local/lib/node_modules/azure-cli/node_modules/fibers> node build.js || nodejs build.js`darwin-x64-v8-5.0` exists; testingBinary is fine; exiting/usr/local/lib└─┬ azure-cli@0.10.0├─┬ adal-node@0.1.17│ ├── date-utils@1.2.21│ ├─┬ jws@3.1.3│ │ ├─┬ base64url@1.0.6│ │ │ └─┬ meow@2.0.0│ │ │ ├─┬ camelcase-keys@1.0.0│ │ │ │ ├── camelcase@1.2.1│ │ │ │ └── map-obj@1.0.1│ │ │ ├─┬ indent-string@1.2.2│ │ │ │ ├── get-stdin@4.0.1│ │ │ │ └─┬ repeating@1.1.3│ │ │ │ └── is-finite@1.0.1│ │ │ ├── minimist@1.2.0│ │ │ └── object-assign@1.0.0│ │ └─┬ jwa@1.1.3│ │ ├── buffer-equal-constant-time@1.0.1│ │ └─┬ ecdsa-sig-formatter@1.0.5│ │ └── base64-url@1.2.2│ ├── node-uuid@1.4.1│ ├── xmldom@0.1.22│ └── xpath.js@1.0.6├── applicationinsights@0.15.12├── async@1.4.2├── azure-arm-authorization@2.0.0├── azure-arm-batch@0.1.0├── azure-arm-cdn@0.1.0-preview├── azure-arm-commerce@0.1.1├── azure-arm-compute@0.18.0├── azure-arm-datalake-analytics@0.3.2├── azure-arm-datalake-store@0.3.0├── azure-arm-dns@0.10.1├── azure-arm-hdinsight@0.2.0├── azure-arm-hdinsight-jobs@0.1.0├── azure-arm-insights@0.11.1├── azure-arm-network@0.13.1├── azure-arm-rediscache@0.2.1├── azure-arm-resource@1.4.4-preview├── azure-arm-storage@0.13.1-preview├── azure-arm-trafficmanager@0.10.5├─┬ azure-arm-website@0.10.0│ ├─┬ azure-common@0.9.12│ │ ├─┬ request@2.45.0│ │ │ ├── aws-sign2@0.5.0│ │ │ ├── bl@0.9.5│ │ │ ├── caseless@0.6.0│ │ │ ├── forever-agent@0.5.2│ │ │ ├─┬ form-data@0.1.4│ │ │ │ ├── async@0.9.2│ │ │ │ └─┬ combined-stream@0.0.7│ │ │ │ └── delayed-stream@0.0.5│ │ │ ├─┬ hawk@1.1.1│ │ │ │ ├── boom@0.4.2│ │ │ │ ├── cryptiles@0.2.2│ │ │ │ ├── hoek@0.9.1│ │ │ │ └── sntp@0.2.4│ │ │ ├─┬ http-signature@0.10.1│ │ │ │ ├── asn1@0.1.11│ │ │ │ └── assert-plus@0.1.5│ │ │ ├── mime-types@1.0.2│ │ │ ├── node-uuid@1.4.7│ │ │ ├── oauth-sign@0.4.0│ │ │ └── qs@1.2.2│ │ └── xml2js@0.2.7│ └── moment@2.6.0├── azure-asm-compute@0.15.0├── azure-asm-hdinsight@0.10.2├── azure-asm-mgmt@0.10.1├── azure-asm-network@0.11.0├── azure-asm-sb@0.10.1├── azure-asm-sql@0.10.1├── azure-asm-storage@0.10.1├── azure-asm-subscription@0.10.1├── azure-asm-trafficmanager@0.10.3├─┬ azure-asm-website@0.10.1│ └── moment@2.6.0├── azure-batch@0.3.0├─┬ azure-common@0.9.16│ ├── dateformat@1.0.2-1.2.3│ ├── duplexer@0.1.1│ ├── envconf@0.0.4│ ├─┬ request@2.45.0│ │ ├── aws-sign2@0.5.0│ │ ├── bl@0.9.5│ │ ├── caseless@0.6.0│ │ ├── forever-agent@0.5.2│ │ ├─┬ form-data@0.1.4│ │ │ ├── async@0.9.2│ │ │ ├─┬ combined-stream@0.0.7│ │ │ │ └── delayed-stream@0.0.5│ │ │ └── mime@1.2.11│ │ ├─┬ hawk@1.1.1│ │ │ ├── boom@0.4.2│ │ │ ├── cryptiles@0.2.2│ │ │ ├── hoek@0.9.1│ │ │ └── sntp@0.2.4│ │ ├─┬ http-signature@0.10.1│ │ │ ├── asn1@0.1.11│ │ │ ├── assert-plus@0.1.5│ │ │ └── ctype@0.5.3│ │ ├── mime-types@1.0.2│ │ ├── node-uuid@1.4.7│ │ ├── oauth-sign@0.4.0│ │ └── qs@1.2.2│ ├── validator@3.22.2│ └── xml2js@0.2.7├── azure-gallery@2.0.0-pre.18├── azure-graph@0.1.1├─┬ azure-keyvault@0.10.1│ └── node-uuid@1.4.7├─┬ azure-monitoring@0.10.2│ └── moment@2.6.0├─┬ azure-storage@0.7.0│ ├── browserify-mime@1.2.9│ ├── extend@1.2.1│ ├── node-uuid@1.4.7│ ├─┬ readable-stream@2.0.6│ │ ├── isarray@1.0.0│ │ ├── process-nextick-args@1.0.7│ │ └── util-deprecate@1.0.2│ ├─┬ request@2.57.0│ │ ├── aws-sign2@0.5.0│ │ ├─┬ bl@0.9.5│ │ │ └─┬ readable-stream@1.0.34│ │ │ └── isarray@0.0.1│ │ ├── caseless@0.10.0│ │ ├─┬ form-data@0.2.0│ │ │ ├── async@0.9.2│ │ │ └─┬ combined-stream@0.0.7│ │ │ └── delayed-stream@0.0.5│ │ ├─┬ har-validator@1.8.0│ │ │ ├── bluebird@2.10.2│ │ │ └── commander@2.9.0│ │ ├── hawk@2.3.1│ │ ├─┬ http-signature@0.11.0│ │ │ ├── asn1@0.1.11│ │ │ └── assert-plus@0.1.5│ │ ├─┬ mime-types@2.0.14│ │ │ └── mime-db@1.12.0│ │ └── qs@3.1.0│ ├── validator@3.22.2│ └── xml2js@0.2.7├─┬ caller-id@0.1.0│ └── stack-trace@0.0.9├── colors@0.6.2├─┬ commander@1.0.4│ └── keypress@0.1.0├── easy-table@0.0.1├─┬ event-stream@3.1.5│ ├── from@0.1.3│ ├── map-stream@0.1.0│ ├── pause-stream@0.0.11│ ├── split@0.2.10│ └── stream-combiner@0.0.4├── eyes@0.1.8├── fast-json-patch@0.5.6├── github@0.1.6├── js2xmlparser@1.0.0├── jsrsasign@4.8.2├─┬ kuduscript@1.0.6│ ├── commander@1.1.1│ └── streamline@0.4.11├── moment@2.13.0├── ms-rest@1.14.2├─┬ ms-rest-azure@1.14.2│ ├── async@0.2.7│ └── uuid@2.0.1├── node-forge@0.6.23├── node-uuid@1.2.0├── number-is-nan@1.0.0├── omelette@0.1.0├─┬ openssl-wrapper@0.2.1│ ├── debug@0.7.4│ └── q@0.9.7├─┬ read@1.0.7│ └── mute-stream@0.0.6├─┬ readable-stream@1.0.34│ ├── core-util-is@1.0.2│ ├── inherits@2.0.1│ ├── isarray@0.0.1│ └── string_decoder@0.10.31├─┬ request@2.69.0│ ├── aws-sign2@0.6.0│ ├── aws4@1.4.1│ ├─┬ bl@1.0.3│ │ └─┬ readable-stream@2.0.6│ │ └── isarray@1.0.0│ ├── caseless@0.11.0│ ├─┬ combined-stream@1.0.5│ │ └── delayed-stream@1.0.0│ ├── extend@3.0.0│ ├── forever-agent@0.6.1│ ├─┬ form-data@1.0.0-rc4│ │ └── async@1.5.2│ ├─┬ har-validator@2.0.6│ │ ├─┬ chalk@1.1.3│ │ │ ├── ansi-styles@2.2.1│ │ │ ├── escape-string-regexp@1.0.5│ │ │ ├─┬ has-ansi@2.0.0│ │ │ │ └── ansi-regex@2.0.0│ │ │ ├── strip-ansi@3.0.1│ │ │ └── supports-color@2.0.0│ │ ├─┬ commander@2.9.0│ │ │ └── graceful-readlink@1.0.1│ │ ├─┬ is-my-json-valid@2.13.1│ │ │ ├── generate-function@2.0.0│ │ │ ├─┬ generate-object-property@1.2.0│ │ │ │ └── is-property@1.0.2│ │ │ ├── jsonpointer@2.0.0│ │ │ └── xtend@4.0.1│ │ └─┬ pinkie-promise@2.0.1│ │ └── pinkie@2.0.4│ ├─┬ hawk@3.1.3│ │ ├── boom@2.10.1│ │ ├── cryptiles@2.0.5│ │ ├── hoek@2.16.3│ │ └── sntp@1.0.9│ ├─┬ http-signature@1.1.1│ │ ├── assert-plus@0.2.0│ │ ├─┬ jsprim@1.2.2│ │ │ ├── extsprintf@1.0.2│ │ │ ├── json-schema@0.2.2│ │ │ └── verror@1.3.6│ │ └─┬ sshpk@1.8.3│ │ ├── asn1@0.2.3│ │ ├── assert-plus@1.0.0│ │ ├─┬ dashdash@1.13.1│ │ │ └── assert-plus@1.0.0│ │ ├── ecc-jsbn@0.1.1│ │ ├─┬ getpass@0.1.6│ │ │ └── assert-plus@1.0.0│ │ ├── jodid25519@1.0.2│ │ ├── jsbn@0.1.0│ │ └── tweetnacl@0.13.3│ ├── is-typedarray@1.0.0│ ├── isstream@0.1.2│ ├── json-stringify-safe@5.0.1│ ├─┬ mime-types@2.1.11│ │ └── mime-db@1.23.0│ ├── node-uuid@1.4.7│ ├── oauth-sign@0.8.2│ ├── qs@6.0.2│ ├── stringstream@0.0.5│ ├── tough-cookie@2.2.2│ └── tunnel-agent@0.4.3├─┬ ssh-key-to-pem@0.11.0│ ├── asn1@0.1.11│ └── ctype@0.5.2├─┬ streamline@0.10.17│ ├── fibers@1.0.13│ ├── galaxy@0.1.12│ └─┬ source-map@0.1.43│ └── amdefine@1.0.0├── streamline-streams@0.1.5├─┬ sync-request@3.0.0│ ├─┬ concat-stream@1.4.10│ │ ├── readable-stream@1.1.14│ │ └── typedarray@0.0.6│ ├── http-response-object@1.1.0│ └─┬ then-request@2.2.0│ ├── http-basic@2.5.1│ ├─┬ promise@7.1.1│ │ └── asap@2.0.4│ └── qs@6.2.0├── through@2.3.4├── tunnel@0.0.2├── underscore@1.4.4├── validator@3.1.0├─┬ winston@0.6.2│ ├── async@0.1.22│ ├── cycle@1.0.3│ ├── pkginfo@0.2.3│ └── request@2.9.203├── wordwrap@0.0.2├─┬ xml2js@0.1.14│ └── sax@0.5.2└── xmlbuilder@0.4.3 - 다음에서 무료 평가판에 등록하세요. https://azure.microsoft.com/en-us/free/.
- 다음 명령을 사용하여 Azure에 로그인합니다.
Azure 로그인:
1234567azure logininfo: Executing command logininfo: To sign in, use a web browser to open the page https://aka.ms/devicelogin. Enter the code BS5P64ANU to authenticate.|info: Added subscription Free Trialinfo: Setting subscription "Free Trial" as default+info: login command OK - 다음을 사용하여 계정 정보를 가져옵니다.
Azure 계정 쇼명령을 사용합니다:
12345678910111213azure account showinfo: Executing command account showdata: Name : Free Trialdata: ID : XXXdata: State : Enableddata: Tenant ID : YYYdata: Is Default : truedata: Environment : AzureClouddata: Has Certificate : Nodata: Has Access Token : Yesdata: User name : arun.gupta@gmail.comdata:info: account show command OK
XXX와 YYY 대신 표시된 값에 주목하세요. 이 값은 쿠버네티스 클러스터를 구성하는 데 사용됩니다.
쿠버네티스 클러스터 시작
- 다운로드 쿠버네티스 1.2.4 를 클릭하고 추출합니다.
- Azure의 Kubernetes 클러스터는 다음과 같이 시작할 수 있습니다:
1234export KUBERNETES_PROVIDER=azureexport AZURE_SUBSCRIPTION_ID=XXXexport AZURE_TENANT_ID=YYY./cluster/kube-up.sh
다음에 적절한 값을 지정해야 합니다.XXX그리고YYY를 이전 명령에서 변경합니다.azure_subscription_id그리고AZURE_TENANT_ID는 Azure에만 해당됩니다. 다음 값
에서도 편집할 수 있습니다.cluster/azure/config-default.sh. - Kubernetes 클러스터를 시작합니다:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748./kubernetes/cluster/kube-up.sh... Starting cluster using provider: azure... calling verify-prereqs... calling kube-up++> AZURE KUBE-UP STARTED: Tue May 31 16:15:26 PDT 2016This will be interactive. (export AZURE_AUTH_METHOD=client_secret to avoid the prompt)hyperkube-amd64:v1.2.4 was found in the gcr.io/google_containers repositoryFlag --tenant-id has been deprecated, tenant-id is deprecated. it is now determined automatically from the subscription idWARN[0000] --resource-group is unset. Derived one from --deployment-name: "kube-20160531-161525"WARN[0000] --master-fqdn is unset. Derived one from input: "kube-20160531-161525.westus.cloudapp.azure.com".To sign in, use a web browser to open the page https://aka.ms/devicelogin. Enter the code BPRLH2ARJ to authenticate.INFO[0034] Starting ARM Deployment. This will take some time. deployment="kube-20160531-161525-1464736561"INFO[0279] Finished ARM Deployment. deployment="kube-20160531-161525-1464736561"INFO[0279] Validating Kubernetes cluster.WARN[0279] Failed to validate components: Get https://kube-20160531-161525.westus.cloudapp.azure.com:6443/api/v1/componentstatuses: dial tcp 23.99.60.138:6443: getsockopt: connection refusedINFO[0294] Validating Kubernetes cluster.WARN[0294] Failed to validate components: Get https://kube-20160531-161525.westus.cloudapp.azure.com:6443/api/v1/componentstatuses: dial tcp 23.99.60.138:6443: getsockopt: connection refusedINFO[0309] Validating Kubernetes cluster.WARN[0309] Failed to validate components: Get https://kube-20160531-161525.westus.cloudapp.azure.com:6443/api/v1/componentstatuses: dial tcp 23.99.60.138:6443: getsockopt: connection refusedINFO[0324] Validating Kubernetes cluster.WARN[0347] validate: incorrect healthy count. expected=3 actual=4INFO[0347] Deployment Complete!INFO[0347] master: "https://kube-20160531-161525.westus.cloudapp.azure.com:6443"INFO[0347] output: "/opt/azkube/_deployments/kube-20160531-161525"cluster "kube-20160531-161525" set.user "kube-20160531-161525_user" set.context "kube-20160531-161525" set.switched to context "kube-20160531-161525".++> AZURE KUBE-UP FINISHED: Tue May 31 16:21:15 PDT 2016 (duration: -349 seconds)... calling validate-clusterDetected 4 ready nodes, found 4 nodes out of expected 3. Found more nodes than expected, your cluster may not behave correctly.Found 4 node(s).NAME STATUS AGEkube-20160531-161525-vm-master Ready,SchedulingDisabled 21skube-20160531-161525-vm-node-0 Ready 18skube-20160531-161525-vm-node-1 Ready 19skube-20160531-161525-vm-node-2 Ready 19sFlag --api-version has been deprecated, flag is no longer respected and will be deleted in the next releaseValidate output:NAME STATUS MESSAGE ERRORscheduler Healthy okcontroller-manager Healthy oketcd-1 Healthy {"health": "true"}etcd-0 Healthy {"health": "true"}Cluster validation succeededDone, listing cluster services:Kubernetes master is running at https://kube-20160531-161525.westus.cloudapp.azure.com:6443
네 개의 노드를 시작합니다.Standard_A1크기. 각
노드는 코어 1개, 1.75GB RAM, 40GB HDD를 제공합니다.
Azure의 Kubernetes 클러스터에서 Docker 컨테이너 실행하기
이제 클러스터가 실행 중이므로 모든 노드 목록을 가져옵니다:
|
1 2 3 4 5 6 |
./kubernetes/cluster/kubectl.sh get no NAME STATUS AGE kube-20160531-161525-vm-master Ready,SchedulingDisabled 3m kube-20160531-161525-vm-node-0 Ready 3m kube-20160531-161525-vm-node-1 Ready 3m kube-20160531-161525-vm-node-2 Ready 3m |
그림과 같이 마스터 노드용 인스턴스 1개와 워커 노드용 인스턴스 3개 등 4개의 인스턴스가 생성됩니다. Azure 포털 리소스 그룹에서 생성된 모든 아티팩트를 표시합니다:

생성된 노드에 대한 자세한 내용은 여기에서 확인할 수 있습니다:

카우치베이스 포드를 생성합니다:
|
1 2 |
./kubernetes/cluster/kubectl.sh run couchbase --image=arungupta/couchbase deployment "couchbase" created |
CLI에서 이미지 이름을 지정하는 방법에 주목하세요. 1.2 이전 버전의 쿠버네티스에서는 이 명령어로 복제 컨트롤러를 생성했습니다. 이에 대한 설명은 아마존 웹 서비스의 Kubernetes 또는 구글 클라우드의 쿠버네티스. 쿠버네티스 1.2 도입된 디플로이먼트 그리고
대신 배포를 생성합니다. 이를 통해 버전 관리, 여러 개의 동시 롤아웃, 모든 포드에 걸친 상태 집계, 애플리케이션 가용성 유지 및 롤백 등 애플리케이션 배포 및 관리를 간소화할 수 있습니다.
이 포드는 다음을 사용합니다. 아룽업타/카우치베이스 사전 구성된 Couchbase 서버를 제공하는 Docker 이미지입니다. 모든 Docker 이미지를 여기에서 지정할 수 있습니다. 파드의 상태를 볼 수 있습니다:
|
1 2 3 4 5 |
./kubernetes/cluster/kubectl.sh get -w po NAME READY STATUS RESTARTS AGE couchbase-2830197765-f0s9c 0/1 ContainerCreating 0 5s NAME READY STATUS RESTARTS AGE couchbase-2830197765-f0s9c 1/1 Running 0 1m |
포드에 대한 자세한 내용을 알아보세요:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
./kubernetes/cluster/kubectl.sh describe po couchbase-2830197765-f0s9c Name: couchbase-2830197765-f0s9c Namespace: default Node: kube-20160531-161525-vm-node-2/10.0.0.6 Start Time: Tue, 31 May 2016 16:28:02 -0700 Labels: pod-template-hash=2830197765,run=couchbase Status: Running IP: 10.2.74.2 Controllers: ReplicaSet/couchbase-2830197765 Containers: couchbase: Container ID: docker://eba043085c95645cf650206469be5c7e2d6c7395883a053d197446a14e757440 Image: arungupta/couchbase Image ID: docker://sha256:f6b013d9694354148ace6804127dadee01c733151b5ff5e169f7c3b0e4faf321 Port: QoS Tier: cpu: BestEffort memory: BestEffort State: Running Started: Tue, 31 May 2016 16:29:04 -0700 Ready: True Restart Count: 0 Environment Variables: Conditions: Type Status Ready True Volumes: default-token-ylszs: Type: Secret (a volume populated by a Secret) SecretName: default-token-ylszs Events: FirstSeen LastSeen Count From SubobjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 7m 7m 1 {default-scheduler } Normal Scheduled Successfully assigned couchbase-2830197765-f0s9c to kube-20160531-161525-vm-node-2 7m 7m 1 {kubelet kube-20160531-161525-vm-node-2} spec.containers{couchbase} Normal Pulling pulling image "arungupta/couchbase" 6m 6m 1 {kubelet kube-20160531-161525-vm-node-2} spec.containers{couchbase} Normal Pulled Successfully pulled image "arungupta/couchbase" 6m 6m 1 {kubelet kube-20160531-161525-vm-node-2} spec.containers{couchbase} Normal Created Created container with docker id eba043085c95 6m 6m 1 {kubelet kube-20160531-161525-vm-node-2} spec.containers{couchbase} Normal Started Started container with docker id eba043085c95 |
쿠버네티스에서 파드를 서비스로 노출하기
이제 파드가 실행 중인데, Couchbase 서버에 어떻게 액세스하나요? Kubernetes 클러스터 외부에 서비스형 배포를 노출해야 합니다. 일반적으로, 이것은 명령을 사용하여 노출됩니다:
|
1 |
./kubernetes/cluster/kubectl.sh expose deployment couchbase --target-port=8091 --port=8091 --type=LoadBalancer |
하지만 Azure는 다음을 지원하지 않습니다. --유형=로드밸런서 를 사용할 수 없습니다. 이 기능은 현재 개발 중이며 가까운 시일 내에 제공될 예정입니다. 그 동안에는 서비스를 다음과 같이 노출할 예정입니다:
|
1 2 |
./kubernetes/cluster/kubectl.sh expose deployment couchbase --target-port=8091 --port=8091 service "couchbase" exposed |
이제 다음을 사용하여 이 서비스를 프록시합니다. kubectl 프록시 명령을 사용합니다:
|
1 2 |
./kubernetes/cluster/kubectl.sh proxy --address='0.0.0.0' --port=9999 --accept-hosts='.*' Starting to serve on [::]:9999 |
이제 이 노출된 서비스는 https://127.0.0.1:9999/api/v1/proxy/namespaces/default/services/couchbase/index.html 에서 액세스할 수 있습니다. 로그인 화면이 표시됩니다.
화면의 카우치베이스 웹 콘솔:

쿠버네티스 클러스터 종료
마지막으로 다음을 사용하여 클러스터를 종료합니다. cluster/kube-down.sh 스크립트.
|
1 2 3 4 5 6 7 |
./kubernetes/cluster/kube-down.sh Bringing down cluster using provider: azure Bringing down cluster You must do this manually (for now)! This can be done with: ./kubernetes/cluster/../cluster/../cluster/azure/util.sh: line 246: AZ_RESOURCE_GROUP: unbound variable |
이 스크립트는 클러스터를 종료하지만 Azure 리소스 그룹은 명시적으로 제거해야 합니다. 이 작업은 다음에서 리소스 그룹을 선택하여 수행할 수 있습니다. portal.azure.com:

이것은 다음과 같이 제출됩니다. #26601.
추가 참고 자료 ...
- 카우치베이스 서버 개발자 포털
- 컨테이너의 카우치베이스
- 다음에 대한 질문 스택오버플로, 포럼 또는 슬랙 채널
- 팔로우하기 @couchbasedev
- Couchbase 4.5
즐기세요!

이 방법을 시도하는 과정에서 좋은 진전을 이루었지만 마지막에 문제가 발생했습니다. 프록시 연결에서 풀 엔드포인트에 수동으로 접속하여 인증할 수 있지만 웹 UI가 프록시된 URL을 사용하지 않고 전체 프록시된 URL 대신 127.0.0.1:9999/pools만 시도하고 있습니다. 제가 단계를 놓쳤나요? 여담이지만, 이제 분명히 사용할 수 있는 -type=LoadBalancer를 사용할 수 있었습니다.