smart48 / larak8

DigitalOcean Kubernetes Deployment of Laravel App
2 stars 2 forks source link

local nginx not shown #7

Closed jasperf closed 3 years ago

jasperf commented 3 years ago

I deployed all local containers using

kubectl apply -f local/deployment.yml
deployment.apps/localweb created

and then I can see these pods and deployments under the namespaces smt-local

get pods -n smt-local
NAME                       READY   STATUS    RESTARTS   AGE
localweb-5fcbfb587-f7tzh   2/2     Running   0          5m28s
localweb-5fcbfb587-lrcfw   2/2     Running   0          5m28s
localweb-5fcbfb587-vggk6   2/2     Running   0          5m28s
➜  smt-deploy git:(main) kubectl get deployments -n smt-local
NAME       READY   UP-TO-DATE   AVAILABLE   AGE
localweb   3/3     3            3           6m24s

but my deployment was also supposed to load the nginx container. See https://github.com/smart48/smt-deploy/blob/main/local/deployment.yml#L37-L40 so where is it?

jasperf commented 3 years ago

It is inside the pod of course

kubectl describe pod localweb-5fcbfb587-f7tzh -n smt-local
Name:         localweb-5fcbfb587-f7tzh
Namespace:    smt-local
Priority:     0
Node:         minikube/192.168.64.5
Start Time:   Tue, 01 Dec 2020 13:24:55 +0700
Labels:       app=web
              pod-template-hash=5fcbfb587
Annotations:  <none>
Status:       Running
IP:           172.17.0.6
IPs:
  IP:           172.17.0.6
Controlled By:  ReplicaSet/localweb-5fcbfb587
Containers:
  laravel:
    Container ID:   docker://465a95a28ec9cb3c270fb2c9fe9345a071d5b5a676f9ad53de547caac0b688ca
    Image:          smart48/smt-laravel:latest
    Image ID:       docker-pullable://smart48/smt-laravel@sha256:53ff2435c5190e4da1685627d741e17b56d0fe732c5a5154db43ab20d2271b6b
    Port:           9000/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Tue, 01 Dec 2020 13:25:50 +0700
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:  500m
    Requests:
      cpu:        250m
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-pb9k5 (ro)
  nginx:
    Container ID:   docker://e40d4d5a256760bc35fef01e9f9ee806308af208b6ed6167e0ea694854ea921a
    Image:          smart48/smt-nginx:latest
    Image ID:       docker-pullable://smart48/smt-nginx@sha256:b8b99438afa785387c8f10da634a52447a512e73ad7c0385f869605a995a7fcc
    Port:           80/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Tue, 01 Dec 2020 13:26:10 +0700
    Ready:          True
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-pb9k5 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  dir:
    Type:          HostPath (bare host directory volume)
    Path:          ~/code/project
    HostPathType:
  default-token-pb9k5:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-pb9k5
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type    Reason     Age        From               Message
  ----    ------     ----       ----               -------
  Normal  Scheduled  <unknown>  default-scheduler  Successfully assigned smt-local/localweb-5fcbfb587-f7tzh to minikube
  Normal  Pulling    10m        kubelet, minikube  Pulling image "smart48/smt-laravel:latest"
  Normal  Pulled     9m45s      kubelet, minikube  Successfully pulled image "smart48/smt-laravel:latest"
  Normal  Created    9m45s      kubelet, minikube  Created container laravel
  Normal  Started    9m45s      kubelet, minikube  Started container laravel
  Normal  Pulling    9m45s      kubelet, minikube  Pulling image "smart48/smt-nginx:latest"
  Normal  Pulled     9m26s      kubelet, minikube  Successfully pulled image "smart48/smt-nginx:latest"
  Normal  Created    9m25s      kubelet, minikube  Created container nginx
  Normal  Started    9m25s      kubelet, minikube  Started container nginx