linghaiyan 发表于 2018-9-16 07:51:57

Kubernetes 安装配置笔记

# 创建  # kubectl create -f pop-webserver.yaml
  pods/httpd
  # 使用命令查看创建的状态,状态为Pending[准备中]
  # kubectl get pods
  NAME      READY   STATUS    RESTARTS   AGE
  httpd   0/1       Pending   0          18s
  # pod 已经 Running 状态[已经创建成功]
  #kubectl get pods
  NAME      READY   STATUS    RESTARTS   AGE
  httpd   0/1       Running   0          24s
  # 查看该容器在哪个节点
  # kubectl get pods -o wide
  NAME      READY   STATUS       RESTARTS   AGE       NODE
  httpd   1/1       Running      0          29s       node01.vqiu.cn
  # 查看该容器的所有状态
  # kubectl get pods httpd -o yaml
  apiVersion: v1
  kind: Pod
  metadata:
  creationTimestamp: 2016-01-11T10:58:49Z
  name: httpd
  namespace: default
  resourceVersion: "1716"
  selfLink: /api/v1/namespaces/default/pods/httpd
  uid: 4b661f54-b852-11e5-bad9-005056b9211a
  spec:
  containers:
  - image: web_server
  imagePullPolicy: IfNotPresent
  name: httpd
  ports:
  - containerPort: 80
  protocol: TCP
  resources: {}
  terminationMessagePath: /dev/termination-log
  volumeMounts:
  - mountPath: /var/www/html
  name: httpd-storage
  - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
  name: default-token-tfkup
  readOnly: true
  dnsPolicy: ClusterFirst
  nodeName: node01.vqiu.cn
  restartPolicy: Always
  serviceAccount: default
  serviceAccountName: default
  volumes:
  - hostPath:
  path: /var/docker/disk01
  name: httpd-storage
  - name: default-token-tfkup
  secret:
  secretName: default-token-tfkup
  status:
  conditions:
  - status: "True"
  type: Ready
  containerStatuses:
  - containerID: docker://521fa2a7baf4f2821ec11960efcaa8776d9f0ddfc996bb3f4ce4ecbd9ca7688e
  image: web_server
  imageID: docker://5de94d0f03ec3c9fa582b7ab6673502195646a503c2fa8471a5a0ee3c0541dee
  lastState: {}
  name: httpd
  ready: true
  restartCount: 0
  state:
  running:
  startedAt: 2016-01-05T03:53:32Z
  hostIP: 172.16.4.131
  phase: Running
  podIP: 10.1.15.1
  startTime: 2016-01-05T03:53:06Z


页: [1]
查看完整版本: Kubernetes 安装配置笔记