Skip to content

Instantly share code, notes, and snippets.

@cmackenzie1
Last active January 22, 2018 05:58
Show Gist options
  • Save cmackenzie1/fe228a9ce9ce2411784b8b33086b5b47 to your computer and use it in GitHub Desktop.
Save cmackenzie1/fe228a9ce9ce2411784b8b33086b5b47 to your computer and use it in GitHub Desktop.
Shopify Infrastructure Problem

Shopify Infrastructure Problem

Screenshot of WebApp

Solution

Outputs

$ minikube service list
|-------------|----------------------|-----------------------------|
|  NAMESPACE  |         NAME         |             URL             |
|-------------|----------------------|-----------------------------|
| default     | hello-rails          | http://192.168.99.100:30423 |
| default     | kubernetes           | No node port                |
| default     | mysql                | No node port                |
| kube-system | kube-dns             | No node port                |
| kube-system | kubernetes-dashboard | http://192.168.99.100:30000 |
|-------------|----------------------|-----------------------------|
$ kubectl describe deployments -n default
Name:                   hello-rails
Namespace:              default
CreationTimestamp:      Sun, 21 Jan 2018 22:43:16 -0700
Labels:                 app=hello-rails
Annotations:            deployment.kubernetes.io/revision=1
Selector:               app=hello-rails
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=hello-rails
  Containers:
   hello-rails:
    Image:  benjamincaldwell/hello-docker-rails
    Port:   <none>
    Environment:
      MYSQL_HOST:      10.97.199.47
      MYSQL_PASSWORD:  password
      MYSQL_USER:      root
      MYSQL_PORT:      3306
    Mounts:            <none>
  Volumes:             <none>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   hello-rails-5c8dd66c94 (1/1 replicas created)
Events:
  Type    Reason             Age   From                   Message
  ----    ------             ----  ----                   -------
  Normal  ScalingReplicaSet  1m    deployment-controller  Scaled up replica set hello-rails-5c8dd66c94 to 1


Name:                   mysql
Namespace:              default
CreationTimestamp:      Sun, 21 Jan 2018 22:41:20 -0700
Labels:                 app=mysql
Annotations:            deployment.kubernetes.io/revision=1
Selector:               app=mysql
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:  app=mysql
  Containers:
   mysql:
    Image:  mysql
    Port:   <none>
    Environment:
      MYSQL_ROOT_PASSWORD:  password
    Mounts:                 <none>
  Volumes:                  <none>
Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
OldReplicaSets:  <none>
NewReplicaSet:   mysql-6c7cd44f6d (1/1 replicas created)
Events:
  Type    Reason             Age   From                   Message
  ----    ------             ----  ----                   -------
  Normal  ScalingReplicaSet  2m    deployment-controller  Scaled up replica set mysql-6c7cd44f6d to 1
$ kubectl describe pods
Name:           hello-rails-5c8dd66c94-h5lgd
Namespace:      default
Node:           minikube/192.168.99.100
Start Time:     Sun, 21 Jan 2018 22:43:16 -0700
Labels:         app=hello-rails
              pod-template-hash=1748822750
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"hello-rails-5c8dd66c94","uid":"24a92d58-ff37-11e7-bd9f-0800277a8...
Status:         Running
IP:             172.17.0.5
Controlled By:  ReplicaSet/hello-rails-5c8dd66c94
Containers:
hello-rails:
  Container ID:   docker://e551e85dfe843414c685c0195622d46f0e5493a436c9d26ca8270fb556d4c243
  Image:          benjamincaldwell/hello-docker-rails
  Image ID:       docker-pullable://benjamincaldwell/hello-docker-rails@sha256:80013937f9d037e2e5406dff4ce6f16f80ae0c2f166a49629ac947cdba450696
  Port:           <none>
  State:          Running
    Started:      Sun, 21 Jan 2018 22:43:18 -0700
  Ready:          True
  Restart Count:  0
  Environment:
    MYSQL_HOST:      10.97.199.47
    MYSQL_PASSWORD:  password
    MYSQL_USER:      root
    MYSQL_PORT:      3306
  Mounts:
    /var/run/secrets/kubernetes.io/serviceaccount from default-token-kq889 (ro)
Conditions:
Type           Status
Initialized    True
Ready          True
PodScheduled   True
Volumes:
default-token-kq889:
  Type:        Secret (a volume populated by a Secret)
  SecretName:  default-token-kq889
  Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     <none>
Events:
Type    Reason                 Age   From               Message
----    ------                 ----  ----               -------
Normal  Scheduled              12m   default-scheduler  Successfully assigned hello-rails-5c8dd66c94-h5lgd to minikube
Normal  SuccessfulMountVolume  12m   kubelet, minikube  MountVolume.SetUp succeeded for volume "default-token-kq889"
Normal  Pulling                12m   kubelet, minikube  pulling image "benjamincaldwell/hello-docker-rails"
Normal  Pulled                 12m   kubelet, minikube  Successfully pulled image "benjamincaldwell/hello-docker-rails"
Normal  Created                12m   kubelet, minikube  Created container
Normal  Started                12m   kubelet, minikube  Started container


Name:           mysql-6c7cd44f6d-k8vxw
Namespace:      default
Node:           minikube/192.168.99.100
Start Time:     Sun, 21 Jan 2018 22:41:20 -0700
Labels:         app=mysql
              pod-template-hash=2737800928
Annotations:    kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"mysql-6c7cd44f6d","uid":"df861af8-ff36-11e7-bd9f-0800277a8164","...
Status:         Running
IP:             172.17.0.4
Controlled By:  ReplicaSet/mysql-6c7cd44f6d
Containers:
mysql:
  Container ID:   docker://2e99219b84ba6514a4f4f744b5126964c1bdd4329840eb49dd7569fb09c52f04
  Image:          mysql
  Image ID:       docker-pullable://mysql@sha256:7cdb08f30a54d109ddded59525937592cb6852ff635a546626a8960d9ec34c30
  Port:           <none>
  State:          Running
    Started:      Sun, 21 Jan 2018 22:41:22 -0700
  Ready:          True
  Restart Count:  0
  Environment:
    MYSQL_ROOT_PASSWORD:  password
  Mounts:
    /var/run/secrets/kubernetes.io/serviceaccount from default-token-kq889 (ro)
Conditions:
Type           Status
Initialized    True
Ready          True
PodScheduled   True
Volumes:
default-token-kq889:
  Type:        Secret (a volume populated by a Secret)
  SecretName:  default-token-kq889
  Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     <none>
Events:
Type    Reason                 Age   From               Message
----    ------                 ----  ----               -------
Normal  Scheduled              14m   default-scheduler  Successfully assigned mysql-6c7cd44f6d-k8vxw to minikube
Normal  SuccessfulMountVolume  14m   kubelet, minikube  MountVolume.SetUp succeeded for volume "default-token-kq889"
Normal  Pulling                14m   kubelet, minikube  pulling image "mysql"
Normal  Pulled                 14m   kubelet, minikube  Successfully pulled image "mysql"
Normal  Created                14m   kubelet, minikube  Created container
Normal  Started                14m   kubelet, minikube  Started container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment