新特性初探:Docker for Mac喜迎Kuberntes支持能力
Posted 分布式实验室
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了新特性初探:Docker for Mac喜迎Kuberntes支持能力相关的知识,希望对你有一定的参考价值。
同一主机支持多个容器后端
只支持Linux
使用boot2docker镜像
模块化支持各家云提供商插件
命令行方式操作
不支持Windows和Mac
安装简便
自动配置命令行
图形化界面配置
一键启停作业
共享卷时性能很差
高耗能降低电池使用时间
支持Windows 10 pro或者enterprise
$ minikube start
Starting local Kubernetes v1.8.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
本地环境易于访问
Kubernetes可用
Kubernetes在空闲时耗费大量电力
感觉还是跟docker-machine很类似
内置Docker版本严重滞后
有些功能尚不支持,例如RBAC(role-based authentication control)
需要使用minikube start/stop
kubectl config use-context docker-for-desktop
$kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:48:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.2", GitCommit:"bdaeafa71f6c7c04636251031f93464384d54963", GitTreeState:"clean", BuildDate:"2017-10-24T19:38:10Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
$kubectl get stacks
No resources found.
$ kubectl get crd
NAME AGE
stacks.compose.docker.com 24d
$ docker stack deploy prometheus -c ./docker-compose.yml
Stack prometheus was created
Waiting for the stack to be stable and running...
- Service exporter has one container running
- Service grafana has one container running
- Service prom has one container running
Stack prometheus is stable and running
$ kubectl get stacks
NAME AGE
prometheus 1m
$kubectl get pods
NAME READY STATUS RESTARTS AGE
exporter-66c7bbfcc6-r5sq4 1/1 Running 0 2m
grafana-7c5f5f6b75-rfgzp 1/1 Running 0 2m
prom-76b4f584f7-qckc9 0/1 CrashLoopBackOff 4 2m
kubectl apply 支持YAML
helm
RBAC激活
$ mkdir -p go/src/github.com/openfaas/ && \
cd go/src/github.com/openfaas/ && \
git clone https://github.com/openfaas/faas-netes && \
cd faas-netes && \
kubectl apply -f ./yaml
service "alertmanager" created
deployment "alertmanager" created
configmap "alertmanager-config" configured
service "faas-netesd" created
deployment "faas-netesd" created
deployment "gateway" created
service "gateway" created
service "nats" created
deployment "nats" created
service "prometheus" created
deployment "prometheus" created
configmap "prometheus-config" configured
deployment "queue-worker" created
serviceaccount "faas-controller" configured
role "faas-controller" configured
rolebinding "faas-controller-fn" configured
$ kubectl get all --namespace openfaas
$ kubectl get all --namespace openfaas-fn
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deploy/figlet 1 1 1 1 8m
NAME DESIRED CURRENT READY AGE
rs/figlet-676c995d66 1 1 1 8m
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deploy/figlet 1 1 1 1 8m
NAME DESIRED CURRENT READY AGE
rs/figlet-676c995d66 1 1 1 8m
NAME READY STATUS RESTARTS AGE
po/figlet-676c995d66-rqjpn 1/1 Running 0 8m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
svc/figlet ClusterIP 10.101.45.157 8080/TCP 8m
https://www.docker.com/docker-mac
https://www.vagrantup.com/
https://github.com/ahmetb/kubectx
https://docs.docker.com/datacenter/ucp/2.2/guides/
https://news.ycombinator.com/item?id=16084243
以上是关于新特性初探:Docker for Mac喜迎Kuberntes支持能力的主要内容,如果未能解决你的问题,请参考以下文章