我正在努力学习docker和kubernetes。我们可以说我是个初学者。我通过docker下载容器。我想将其中三个容器部署到kubernetes。我该怎么做?
docker图像
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 2b7d6430f78d 11 days ago 142MB
ubuntu latest df5de72bdb3b 4 weeks ago 77.8MB
busybox latest 7a80323521cc 5 weeks ago 1.24MB
gcr.io/k8s-minikube/kicbase v0.0.33 b7ab23e98277 5 weeks ago 1.14GB
fedora latest 98ffdbffd207 3 months ago 163MB
hello-world latest feb5d9fea6a5 11 months ago 13.3kB
您需要创建一个包含nginx映像的配置的yaml文件:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
要创建吊舱,请运行以下命令
kubectl apply -f pathToYourYamlFile