资源:

kubernetes把资源实例化之后称为对象,常见的资源有:

  • workload: Pod,ReplicaSet,Deployment,StatefulSet DaemonSet,Job,Cronjob,...
  • 服务发现及均衡: service,ingress
  • 配置与存储:Volume(云端存储,分布式存储,nfs,glastfs), CSI容器存储接口,configmap(配置中心),secret(保存敏感信息),DownwordAPI
  • 集群级资源: Namespace, Node, Role, ClusterRole, RoleBanding, ClusterRoleBanding
  • 元数据型资源: HPA,  PodTemlate,  limitRange

查看pod的资源清单:

# kubectl get pod myapp-5bc569c47d-5cvcx -o yaml

K8S(三)-资源清单
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2019-10-09T03:11:08Z"
  generateName: myapp-5bc569c47d-
  labels:
    pod-template-hash: 5bc569c47d
    release: stable
    run: myapp
  name: myapp-5bc569c47d-5cvcx
  namespace: default
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicaSet
    name: myapp-5bc569c47d
    uid: 70044b8c-ea42-11e9-9460-fa163e359251
  resourceVersion: "2283413"
  selfLink: /api/v1/namespaces/default/pods/myapp-5bc569c47d-5cvcx
  uid: 70151f83-ea42-11e9-9460-fa163e359251
spec:
  containers:
  - image: ikubernetes/myapp:v1
    imagePullPolicy: IfNotPresent
    name: myapp
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: default-token-bpr69
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: szgl-szgl-baol1-test03-8144.jpushoa.com
  priority: 0
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: default
  serviceAccountName: default
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
  volumes:
  - name: default-token-bpr69
    secret:
      defaultMode: 420
      secretName: default-token-bpr69
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2019-10-09T03:11:08Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2019-10-09T03:11:55Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2019-10-09T03:11:55Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2019-10-09T03:11:08Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: docker://67f6558d7f14f73a0bc67cf06084a6031896a230b8904b3738c1d48738cd4c2f
    image: ikubernetes/myapp:v1
    imageID: docker-pullable://ikubernetes/myapp@sha256:9c3dc30b5219788b2b8a4b065f548b922a34479577befb54b03330999d30d513
    lastState: {}
    name: myapp
    ready: true
    restartCount: 0
    state:
      running:
        startedAt: "2019-10-09T03:11:54Z"
  hostIP: 172.17.8.144
  phase: Running
  podIP: 10.244.1.8
  qosClass: BestEffort
  startTime: "2019-10-09T03:11:08Z"
View Code

相关文章: