建立一個k8s應用
阿新 • • 發佈:2018-12-31
[[email protected] ~]# kubectl get deployment NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE net-test 2 2 2 2 15m nginx-deployment 3 3 3 0 35s [[email protected]-node1 ~]# kubectl describe deployment nginx-deployment Name: nginx-deployment Namespace: default CreationTimestamp: Thu, 31 May 2018 17:09:05 +0800 Labels: app=nginx Annotations: deployment.kubernetes.io/revision=1 Selector: app=nginx Replicas: 3 desired | 3 updated | 3 total | 0 available | 3 unavailable StrategyType: RollingUpdate MinReadySeconds:0 RollingUpdateStrategy: 25% max unavailable, 25% max surge Pod Template: Labels: app=nginx Containers: nginx: Image: nginx:1.10.3 Port: 80/TCP Host Port: 0/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason---- ------ ------ Available False MinimumReplicasUnavailable Progressing True ReplicaSetUpdated OldReplicaSets: <none> NewReplicaSet: nginx-deployment-75d56bb955 (3/3 replicas created) Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ScalingReplicaSet 1m deployment-controller Scaled up replica set nginx-deployment-75d56bb955 to 3 [[email protected]-node1 ~]# kubectl get pod NAME READY STATUS RESTARTS AGE net-test-5767cb94df-gdlqq 1/1 Running 0 17m net-test-5767cb94df-r2wp5 1/1 Running 0 17m nginx-deployment-75d56bb955-4bvhk 0/1 ImagePullBackOff 0 2m nginx-deployment-75d56bb955-5kvfw 0/1 ContainerCreating 0 2m nginx-deployment-75d56bb955-r5dr5 0/1 ContainerCreating 0 2m [[email protected]-node1 ~]# kubectl describe pod nginx-deployment-75d56bb955-4bvhk Name: nginx-deployment-75d56bb955-4bvhk Namespace: default Node: 192.168.56.12/192.168.56.12 Start Time: Thu, 31 May 2018 17:09:05 +0800 Labels: app=nginx pod-template-hash=3181266511 Annotations: <none> Status: Pending IP: 10.2.13.3 Controlled By: ReplicaSet/nginx-deployment-75d56bb955 Containers: nginx: Container ID: Image: nginx:1.10.3 Image ID: Port: 80/TCP Host Port: 0/TCP State: Waiting Reason: ImagePullBackOff Ready: False Restart Count: 0 Environment: <none> Mounts: /var/run/secrets/kubernetes.io/serviceaccount from default-token-wn78r (ro) Conditions: Type Status Initialized True Ready False PodScheduled True Volumes: default-token-wn78r: Type: Secret (a volume populated by a Secret) SecretName: default-token-wn78r Optional: false QoS Class: BestEffort Node-Selectors: <none> Tolerations: <none> Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 3m default-scheduler Successfully assigned nginx-deployment-75d56bb955-4bvhk to 192.168.56.12 Normal SuccessfulMountVolume 3m kubelet, 192.168.56.12 MountVolume.SetUp succeeded for volume "default-token-wn78r" Warning Failed 2m kubelet, 192.168.56.12 Failed to pull image "nginx:1.10.3": rpc error: code = Unknown desc = error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/registry-v2/docker/registry/v2/blobs/sha256/03/0346349a1a640da9535acfc0f68be9d9b81e85957725ecb76f3b522f4e2f0455/data?Expires=1527760756&Signature=FsFobL4~r~N6zja0Nft-H-GlJCzxDZ6Ne-z-Ucnh-4iQe4fFi2m1bV9naqFWAo2ayIZHyo2FKdR4wujqZuqQKdwuj9L8bevbdIlKwy7qbBMFJq3n6g3jzmIjZ5QrlvV3AMD~hb60A2TRHtbOAtPgsYBEANbzJUnlnSDtpW8fxkg_&Key-Pair-Id=APKAJECH5M7VWIS5YZ6Q: net/http: TLS handshake timeout Warning Failed 2m kubelet, 192.168.56.12 Error: ErrImagePull Normal BackOff 2m kubelet, 192.168.56.12 Back-off pulling image "nginx:1.10.3" Warning Failed 2m kubelet, 192.168.56.12 Error: ImagePullBackOff