文章转载自冰糖大佬的博客,不过他的版本是1.13xxx的, 我安装的是最新版,一路踩了各种坑,各种百度,然后在巨人的肩膀上修改了大佬文章,并添加了我遇到的错误,如果有安装1.13版本左右的,可以直接查看大佬的版本,原文章清晰格式工整,链接如下:

https://blog.csdn.net/wangchunfa122/article/details/86529406

----------------------我的修订版本开始了---------------------------------------

环境信息
安装步骤

    系统配置修改
    安装docker
    安装kubectl,kubelet,kubeadm
    配置Master
    配置Node
    部署结果检查

K8S部署mysql学习

    新建mysql-rc.yaml
    创建mysql-svc.yaml
    安装

K8S部署JAVA应用

    创建deployment
    创建service
    更新deployment
    其他命令
 

环境信息
名称:     版本
Docker     18.06.1-ce
操作系统     Ubuntu16.04
K8s     v1.13.2

机器信息
IP     作用     组件
10.2.14.78     Master     
10.2.14.79     Node     
10.2.14.80     Node     

安装步骤
系统配置修改

禁用swap

swapoff -a

同时把/etc/fstab包含swap那行记录删掉。

关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

禁用Selinux

apt install selinux-utils
setenforce 0

各主机的主机名及ip配置。
本次实战中一共用到二台主机,一台用于Master的部署,领导两台分别为node1。主机名和IP的对应关系如下:

192.168.26.131 nuke-k8s-m
192.168.26.132 nuke-k8s-n

同时在每台机器的/etc/hosts配置如下

192.168.26.131 nuke-k8s-m
192.168.26.132 nuke-k8s-n

 

安装docker

在Master和Node节点分别执行如下操作

    先安装相关工具

apt-get update && apt-get install -y apt-transport-https curl

    1

    添加密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

    1

    安转docker

apt-get install docker.io -y

    1

    查看docker版本

root@nuke2:~# docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        2d0083d
 Built:             Wed Jul  3 13:38:22 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       2d0083d
  Built:            Mon Jul  1 19:31:53 2019
  OS/Arch:          linux/amd64
  Experimental:     false

  • 启动docker service
systemctl enable docker
systemctl start docker
systemctl status docker

修改文件

vim  /etc/docker/daemon.json
{
    "registry-mirrors": ["https://alzgoonw.mirror.aliyuncs.com"],
    "live-restore": true
}

重起docker服务

systemctl daemon-reload
systemctl restart docker

安装kubectl,kubelet,kubeadm

在Master和Node节点分别执行如下操作

  • 接下来添加秘钥

国内只能用这个

curl -s https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg| sudo apt-key add -

  • 添加Kubernetes软件源

cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF

上面是官方的源,国内不通需要修改为如下

cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main
EOF

安装

# apt-get update && apt-get install -y kubelet kubeadm kubectl
# systemctl enable kubelet

– 修改源—

问题:apt-get update 错误超时,被墙了。需要修改apt-get的源,采用ustc源

vim /etc/apt/sources.list.d/kubernetes.list

增加内容如下,然后重新安装

# deb http://apt.kubernetes.io/ kubernetes-xenial main
deb http://mirrors.ustc.edu.cn/kubernetes/apt kubernetes-xenial main

    1
    2

注:ubuntu16.04 代号为xenial

配置Master

在/etc/profile 下面增加如下环境变量

export KUBECONFIG=/etc/kubernetes/admin.conf

*暂时没有这个文件,不要担心,就照着做就行

# 重起kubelet
systemctl daemon-reload
systemctl restart kubelet
 

在master节点上执行

kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.2.14.78 --kubernetes-version=v1.15.1 --ignore-preflight-errors=Swap

–pod-network-cidr是指配置节点中的pod的可用IP地址,此为内部IP

–apiserver-advertise-address 为master的IP地址

–kubernetes-version 通过kubectl version 可以查看到

不幸的是报错, k8s.gcr.io 被墙了,镜像下载失败

[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: [preflight] Some fatal errors occurred:
    [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.13.2: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
........

根据报错信息,在国内网站站上找到相关的镜像(docker需要配置阿里云的镜像仓库)

看版本, 我用的时1.15.1

docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.2.24
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.2.6
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.13.2


docker tag gcr.azk8s.cn/google-containers/kube-apiserver:v1.15.1 k8s.gcr.io/kube-apiserver:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-controller-manager:v1.15.1 k8s.gcr.io/kube-controller-manager:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-scheduler:v1.15.1 k8s.gcr.io/kube-scheduler:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-proxy:v1.15.1 k8s.gcr.io/kube-proxy:v1.15.1
docker tag gcr.azk8s.cn/google-containers/pause:3.1 k8s.gcr.io/pause:3.1
docker tag gcr.azk8s.cn/google-containers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10
docker tag gcr.azk8s.cn/google-containers/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

重新执行

kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.26.131 --kubernetes-version=v1.15.1 --ignore-preflight-errors=Swap

输出结果如下,其中最后一行是节点加入master集群需要的命令

root@nuke1:/home/nuke# kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.26.131 --kubernetes-version=v1.15.1 --ignore-preflight-errors=Swap
[init] Using Kubernetes version: v1.15.1
[preflight] Running pre-flight checks
    [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet-start] Activating the kubelet service
[certs] Using certificateDir folder "/etc/kubernetes/pki"
[certs] Generating "etcd/ca" certificate and key
[certs] Generating "apiserver-etcd-client" certificate and key
[certs] Generating "etcd/server" certificate and key
[certs] etcd/server serving cert is signed for DNS names [nuke1 localhost] and IPs [192.168.26.131 127.0.0.1 ::1]
[certs] Generating "etcd/peer" certificate and key
[certs] etcd/peer serving cert is signed for DNS names [nuke1 localhost] and IPs [192.168.26.131 127.0.0.1 ::1]
[certs] Generating "etcd/healthcheck-client" certificate and key
[certs] Generating "front-proxy-ca" certificate and key
[certs] Generating "front-proxy-client" certificate and key
[certs] Generating "ca" certificate and key
[certs] Generating "apiserver-kubelet-client" certificate and key
[certs] Generating "apiserver" certificate and key
[certs] apiserver serving cert is signed for DNS names [nuke1 kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.26.131]
[certs] Generating "sa" key and public key
[kubeconfig] Using kubeconfig folder "/etc/kubernetes"
[kubeconfig] Writing "admin.conf" kubeconfig file
[kubeconfig] Writing "kubelet.conf" kubeconfig file
[kubeconfig] Writing "controller-manager.conf" kubeconfig file
[kubeconfig] Writing "scheduler.conf" kubeconfig file
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take up to 4m0s
[apiclient] All control plane components are healthy after 28.520233 seconds
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.15" in namespace kube-system with the configuration for the kubelets in the cluster
[upload-certs] Skipping phase. Please see --upload-certs
[mark-control-plane] Marking the node nuke1 as control-plane by adding the label "node-role.kubernetes.io/master=''"
[mark-control-plane] Marking the node nuke1 as control-plane by adding the taints [node-role.kubernetes.io/master:NoSchedule]
[bootstrap-token] Using token: 13zy98.ubjskmoo7rqthc4n
[bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.26.131:6443 --token 13zy98.ubjskmoo7rqthc4n \
    --discovery-token-ca-cert-hash sha256:5a2fbd7d74327c3ea716835fc49cb2cf8d9db3ec29af2925812cbc4b811d8383
root@nuke1:/home/nuke# mkdir -p $HOME/.kube
root@nuke1:/home/nuke#   sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
root@nuke1:/home/nuke#   sudo chown $(id -u):$(id -g) $HOME/.kube/config

在安装完Master节点后,查看节点信息( kubectl get nodes)会发现节点的状态为noready。查看noready的原因发现是由于cni插件没有配置。其实这是由于还没有配置网络。可以配置多种网络,这里作者选用最长远的fannel网络进行配置。

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

配置Node

在各个node节点执行如下命令(对应master配置返回的 kubeadm join命令),加入master集群-- 这个就是master启动完的最后一句命令

kubeadm join 192.168.26.131:6443 --token 13zy98.ubjskmoo7rqthc4n \
    --discovery-token-ca-cert-hash sha256:5a2fbd7d74327c3ea716835fc49cb2cf8d9db3ec29af2925812cbc4b811d8383

在master查看nodes状态,Node的状态为NotReady

root@nuke1:~# kk get nodes
NAME    STATUS   ROLES    AGE    VERSION
nuke1   Ready    master   105m   v1.15.1
nuke2   NotReady    <none>   102m   v1.15.1
查看pod状态,部分服务没有正常启动,原因是各个node也缺少镜像,需要手动下载,按照在master手动下载镜像的方式下载即可, 再node上执行:

docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.13.2
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.1
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.2.24
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.2.6
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.13.2


docker tag gcr.azk8s.cn/google-containers/kube-apiserver:v1.15.1 k8s.gcr.io/kube-apiserver:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-controller-manager:v1.15.1 k8s.gcr.io/kube-controller-manager:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-scheduler:v1.15.1 k8s.gcr.io/kube-scheduler:v1.15.1
docker tag gcr.azk8s.cn/google-containers/kube-proxy:v1.15.1 k8s.gcr.io/kube-proxy:v1.15.1
docker tag gcr.azk8s.cn/google-containers/pause:3.1 k8s.gcr.io/pause:3.1
docker tag gcr.azk8s.cn/google-containers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10
docker tag gcr.azk8s.cn/google-containers/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

部署结果检查

root@nuke1:~# kubectl get pod --all-namespaces
NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
default       demo-deployment-5c6cb6ffcf-mxqt5   1/1     Running   0          55m
default       mysql-rc-8ljq8                     1/1     Running   0          63m
kube-system   coredns-5c98db65d4-kvkxt           1/1     Running   0          106m
kube-system   coredns-5c98db65d4-vflqh           1/1     Running   0          106m
kube-system   etcd-nuke1                         1/1     Running   0          105m
kube-system   kube-apiserver-nuke1               1/1     Running   0          105m
kube-system   kube-controller-manager-nuke1      1/1     Running   0          105m
kube-system   kube-flannel-ds-amd64-46brt        1/1     Running   0          105m
kube-system   kube-flannel-ds-amd64-wwnqf        1/1     Running   0          103m
kube-system   kube-proxy-rz744                   1/1     Running   0          106m
kube-system   kube-proxy-xgfdk                   1/1     Running   0          103m
kube-system   kube-scheduler-nuke1               1/1     Running   0          105m
root@nuke1:~#

root@nuke1:~# kk get nodes
NAME    STATUS   ROLES    AGE    VERSION
nuke1   Ready    master   105m   v1.15.1
nuke2   NotReady    <none>   102m   v1.15.1
 

如果node 依然无法ready, 那么去node执行以下命令:

kubectl api-resources

我的报了如下错误:

The connection to the server localhost:8080 。。。。

这个错误的解决方法是:

scp  /etc/kubernetes/admin.conf  root@192.168.26.132:/etc/kubernetes/admin.conf

export KUBECONFIG=/etc/kubernetes/admin.conf

vi /root/.bash_profile

把这一行粘贴进去

source /root/.bash_profile

root@nuke1:~# kk get nodes
NAME    STATUS   ROLES    AGE    VERSION
nuke1   Ready    master   114m   v1.15.1
nuke2   Ready    <none>   111m   v1.15.1

------------------------------------以下部分为粘贴大佬的原文章----------------------------------------------------

已经亲测,没有问题 都可以跑起来,但是再虚拟机里要慢一些,多等等就可以了

K8S部署mysql学习

新建mysql-rc.yaml

apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql-rc
  labels:
    name: mysql-rc
spec:
  replicas: 1
  selector:
    name: mysql-pod
  template:
    metadata:
      labels:
        name: mysql-pod
    spec:
      containers:
      - name: mysql
        image: mysql
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 3306
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "password"

创建mysql-svc.yaml

[root@k8s-master ~]# cat mysql-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: mysql-svc
  labels:
    name: mysql-svc
spec:
  type: NodePort
  ports:
  - port: 3306
    protocol: TCP
    targetPort: 3306
    name: http
    nodePort: 30000
  selector:
    name: mysql-pod

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

安装

k8s 执行文件,下载mysql镜像和运行mysqlr容器

[root@k8s-master ~]# kubectl create -f mysql-rc.yaml
replicationcontroller "mysql-rc" created
[root@k8s-master ~]# kubectl create -f mysql-svc.yaml
service "mysql-svc" created

    1
    2
    3
    4

在其中一台node节点上看到mysql容器实例已启动

root@wangcf-k8s-n1:~# docker ps
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS               NAMES
338cd4b675ab        mysql                  "docker-entrypoint.s…"   15 hours ago        Up 15 hours                             k8s_mysql_mysql-rc-d5zht_default_f55914bc-1a49-

    1
    2
    3

进入容器看到mysql的版本为 8.0.13

root@wangcf-k8s-n1:~# docker exec -it 338cd4b675ab bash
root@mysql-rc-d5zht:/# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.13 MySQL Community Server - GPL

    1
    2
    3
    4
    5
    6

设置root远程访问

$mysql -u root -p
Enter password:
mysql> use mysql;
mysql> GRANT ALL ON *.* TO 'root'@'%';
Query OK, 0 rows affected (0.04 sec)

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
Query OK, 0 rows affected (0.01 sec)

    1
    2
    3
    4
    5
    6
    7
    8

最后在mysql客户端连接mysql容器实例

IP:(任意master或node节点IP)

用户名:root

密码:password 【设置的密码】

端口:30000 【设置的端口】
K8S部署JAVA应用

采用deployment方式部署java应用,应用的名称为demo。

通过docker pull wangchunfa/demo 可以下载改测试应用,是一个spring boot项目,对外暴露的端口是8771.

构建docker镜像请参考另一篇博文 《Spring boot项目部署到Docker环境》
创建deployment

新建文件demo_deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: wangcf-demo
        image: wangchunfa/demo:latest
        ports:
        - containerPort: 8771

 

注意:apiVersion写apps/v1

1.6版本之前 apiVsersion:extensions/v1beta1
1.6版本到1.9版本之间:apps/v1beta1
1.9版本之后:apps/v1

 

创建一个deployment部署和查看状态, 最终可以看到我们的应用程序被部署上去了

root@wangcf-k8s-m:~/demo_deployment# kubectl create -f demo_deployment.yaml --record
deployment.apps/demo-deployment created
root@wangcf-k8s-m:~/demo_deployment# kubectl get deployment
NAME              READY   UP-TO-DATE   AVAILABLE   AGE
demo-deployment   1/1     1            1           10s
root@wangcf-k8s-m:~/demo_deployment# kubectl get rs
NAME                        DESIRED   CURRENT   READY   AGE
demo-deployment-9c754c4d9   1         1         1       10s

    1
    2
    3
    4
    5
    6
    7
    8

执行命令kubectl get pods -o wide,注意IP列,显示是内部POD网络的IP地址,而不是Node的IP地址

root@wangcf-k8s-m:~/demo_deployment# kubectl get pods -o wide
NAME                              READY   STATUS    RESTARTS   AGE   IP           NODE            NOMINATED NODE   READINESS GATES
demo-deployment-9c754c4d9-zp8wl   1/1     Running   0          69s   10.244.1.7   wangcf-k8s-n1   <none>           <none>
mysql-rc-d5zht                    1/1     Running   0          10d   10.244.1.2   wangcf-k8s-n1   <none>           <none>

    1
    2
    3
    4

测试应用,正常返回。其中

root@wangcf-k8s-n1:~# curl http://10.244.1.7:8771/api/v1/product/find?id=2
{"id":2,"name":"冰箱 data from port=8771","price":5342,"store":19}

    1
    2

创建service

采用expose 快捷部署

kubectl expose deployment demo-deployment --type=NodePort --name=demo-svc

root@wangcf-k8s-m:~/demo_deployment# kubectl expose deployment demo-deployment --type=NodePort --port=8771 --protocol=TCP --target-port=30001 --name=demo-svc
service/demo-svc exposed
root@wangcf-k8s-m:~/demo_deployment# kubectl get svc
NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
demo-svc     NodePort    10.107.171.26   <none>        8771:31538/TCP   6s

    1
    2
    3
    4
    5

–port=8771 容器暴露的端口

–target-port=30002 service提供对外访问的端口,目前看不能指定端口

–name=demo-svc 指定service名称

–protocol=TCP 容器内应用对外服务暴露的访问协议

测试应用访问,成功!

root@wangcf-k8s-m:~/demo_deployment# curl http://10.2.14.78:30272/api/v1/product/find?id=2
{"id":2,"name":"冰箱 data from port=8771","price":5342,"store":19}root@wangcf-k8s-m:~/demo_deployment#

    1
    2

更新deployment

将rs的副本增大为2

root@wangcf-k8s-m:~# kubectl scale deployment demo-deployment --replicas 2
deployment.extensions/demo-deployment scaled
root@wangcf-k8s-m:~/demo_deployment# kubectl get deployment
NAME              READY   UP-TO-DATE   AVAILABLE   AGE
demo-deployment   2/2     2            2           23m

    1
    2
    3
    4
    5

其他命令

删除deployment

# kubectl delete deployment demo-deployment

    1

查看deployment

# kubectl describe deployment demo-deployment

    1

查看历史记录

root@wangcf-k8s-m:~/demo_deployment# kubectl rollout history deployment/demo-deployment
deployment.extensions/demo-deployment
REVISION  CHANGE-CAUSE
1         kubectl create --filename=demo_deployment.yaml --record=true

    1
    2
    3
    4

查看单个revision 的详细信息:

root@wangcf-k8s-m:~/demo_deployment# kubectl rollout history deployment demo-deployment  --revision=1
deployment.extensions/demo-deployment with revision #1
Pod Template:
  Labels:    app=demo
    pod-template-hash=9c754c4d9
  Annotations:    kubernetes.io/change-cause: kubectl create --filename=demo_deployment.yaml --record=true
  Containers:
   wangcf-demo:
    Image:    wangchunfa/demo:latest
    Port:    8771/TCP
    Host Port:    0/TCP
    Environment:    <none>
    Mounts:    <none>
  Volumes:    <none>

 

 

 

 

 

 

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐