使用 kompose 转义
下载安装 kompose:地址
有各种各样的版本供你选择,总有一款适合你
注意:新版本的 kompose 砍掉了 up 和 down 两个子命令,以前很多关于 kompose 把 docker-compose 项目直接迁移到 k8s 平台的教程都没有办法使用了
具体情况参考:如何解决 unknown command “up” for “kompose”
输入 kompose convert
使用
kubectl apply -f authentication-service-deployment.yaml,http-api-service-deployment.yaml,add-service-deployment.yaml
kubectl apply -f add-service-service.yaml,authentication-service-service.yaml,http-api-service-service.yaml
kubectl get pods -A
minikube image load ponponon/test-nameko-for-rabbitmq:1.0.1
minikube ssh
``````java
docker@minikube:~$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ponponon/test-nameko-for-rabbitmq 1.0.1 eb717d2bfbaa 17 hours ago 1.1GB
nginx latest c919045c4c2b 11 days ago 142MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver v1.23.1 b6d7abedde39 2 months ago 135MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy v1.23.1 b46c42588d51 2 months ago 112MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler v1.23.1 71d575efe628 2 months ago 53.5MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager v1.23.1 f51846a4fd28 2 months ago 125MB
registry.cn-hangzhou.aliyuncs.com/google_containers/etcd 3.5.1-0 25f8c7f3da61 4 months ago 293MB
registry.cn-hangzhou.aliyuncs.com/google_containers/coredns v1.8.6 a4ca41631cc7 5 months ago 46.8MB
registry.cn-hangzhou.aliyuncs.com/google_containers/coredns/coredns v1.8.6 a4ca41631cc7 5 months ago 46.8MB
registry.cn-hangzhou.aliyuncs.com/google_containers/pause 3.6 6270bb605e12 6 months ago 683kB
registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetesui/dashboard v2.3.1 e1482a24335a 8 months ago 220MB
registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard <none> e1482a24335a 8 months ago 220MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetesui/metrics-scraper v1.0.7 7801cfc6d5c0 9 months ago 34.4MB
registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper <none> 7801cfc6d5c0 9 months ago 34.4MB
registry.cn-hangzhou.aliyuncs.com/google_containers/k8s-minikube/storage-provisioner v5 6e38f40d628d 11 months ago 31.5MB
registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner v5 6e38f40d628d 11 months ago 31.5MB
kubectl create -f env-configmap.yaml
─➤ kubectl describe configmap env
Name: env
Namespace: default
Labels: io.kompose.service=add-service-env
Annotations: <none>
Data
====
DATABASE_HOST:
----
192.168.31.203
kubectl apply -f authentication-service-deployment.yaml,http-api-service-deployment.yaml,add-service-deployment.yaml
─➤ kubectl get deployment,svc,pods
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/add-service 1/1 1 1 15m
deployment.apps/authentication-service 1/1 1 1 15m
deployment.apps/http-api-service 1/1 1 1 15m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/authentication-service ClusterIP 10.99.60.205 <none> 5002/TCP 29h
service/http-api-service ClusterIP 10.104.237.146 <none> 5000/TCP 29h
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 29h
NAME READY STATUS RESTARTS AGE
pod/add-service-79949489f7-kjm4m 1/1 Running 0 15m
pod/authentication-service-786df44c64-mjhtg 1/1 Running 0 15m
pod/http-api-service-5d6dd96ffb-2btxx 1/1 Running 0 15m
以上就是全部内容。希望对大家有所帮助,