私はdocker-composeの準備ができているプロジェクトを持っています。今、私はkubernetesに移動したいです。私はKomposeツールを使用して、ドッカーの作成からkubernetesへの変換を行います。 docker-compose up
:docker-composeからkubernetesへの変換にkomposeを使用できません
はたとえば、ここに私のサンプル私はコマンドを使用して、正常に実行されている
version: '3'
volumes:
database_hades_volume:
external: true
services:
db:
image: postgres:latest
container_name: hades-db
ports:
- "5432:5432"
environment:
POSTGRES_DB: hades_dev
POSTGRES_PASSWORD: 1234
volumes:
- database_hades_volume:/var/lib/postgresql/data/
tty: true
stdin_open: true
redis:
container_name: hades-redis
image: redis:latest
ports:
- "6379:6379"
app:
container_name: hades-app
build:
context: .
dockerfile: Dockerfile
ports:
- "4001:4001"
volumes:
- ".:/webapp"
env_file:
- ./.env.docker_compose-dev
depends_on:
- db
- redis
docker-compose.yml
ファイルです。今、私はコマンドを使用してkubernetesに変換するためのkompose
を使用します。
kompose convert
その後、私は使用して実行します。
kompose up
をここでは、コマンドラインの結果情報は、次のとおりです。
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
INFO Deploying application in "default" namespace
INFO Successfully created Service: app
INFO Successfully created Service: db
INFO Successfully created Service: redis
INFO Successfully created Deployment: app
INFO Successfully created PersistentVolumeClaim: app-claim0 of size 100Mi. If your cluster has dynamic storage provisioning, you don't have to do anything. Otherwise you have to create PersistentVolume to make PVC work
INFO Successfully created Deployment: db
INFO Successfully created PersistentVolumeClaim: database-hades-volume of size 100Mi. If your cluster has dynamic storage provisioning, you don't have to do anything. Otherwise you have to create PersistentVolume to make PVC work
INFO Successfully created Deployment: redis
Your application has been deployed to Kubernetes. You can run 'kubectl get deployment,svc,pods,pvc' for details.
しかし、ときに私localhost:4001
または10.0.0.180:4001
に行って試してみると、それは永遠に待っていることがわかります。
設定が間違っているか、いくつかの手順が不足しているかどうかわかりません。私を助けてください。
おかげ
は、デプロイメントを得るkubectl '実行しました意味、SVC、ポッド、pvc'を作る願って、のようにすることができますすべての配備、サービス、ポッド、量請求が準備完了状態であることを確認しますか? –
これとは別に、私たちはより良い質問をすることができます。これは、初めてのkubernetesとの接触ですか?以前はドッカーの作成経験がありましたか? –