Chapter 3. Skaffold – Easy-Peasy Cloud-Native Kubernetes Application Development


$ cd ~/tmp/Effortless-Cloud-Native-App-Development-Using-Skaffold/Chapter03/


$ skaffold dev


// Еще 1 терминалом подключаюсь
$ gcloud cloud-shell ssh


$ kubectl get all


$ kubectl get svc
NAME                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
kubernetes              ClusterIP   10.96.0.1        <none>        443/TCP          54m
skaffold-introduction   NodePort    10.102.184.144   <none>        8080:30087/TCP   3m30s


// Убеждаемся, что значение профиля установлено
$ echo ${PROFILE}


Если нет


$ export \
  PROFILE=marley-minikube


$ echo $(minikube --profile ${PROFILE} ip)
$ export MINIKUBE_IP=$(minikube --profile ${PROFILE} ip)
$ echo ${MINIKUBE_IP}


// Одно значение д.б. но выводятся все. Нужно смотреть код, что не так
$ curl -X GET "${MINIKUBE_IP}:30087/states?name=Karnataka" \
  | jq


// Все данные
$ curl $(minikube --profile ${PROFILE} ip):30087/states \
  | jq


[
  {
    "name": "Andra Pradesh",
    "capital": "Hyderabad"
  },
  {
    "name": "Arunachal Pradesh",
    "capital": "Itangar"
  },
  {
    "name": "Assam",
    "capital": "Dispur"
  },
  {
    "name": "Bihar",
    "capital": "Patna"
  },
  {
    "name": "Chhattisgarh",
    "capital": "Raipur"
  },
  {
    "name": "Goa",
    "capital": "Panaji"
  },
  {
    "name": "Gujarat",
    "capital": "Gandhinagar"
  },
  {
    "name": "Haryana",
    "capital": "Chandigarh"
  },
  {
    "name": "Himachal Pradesh",
    "capital": "Shimla"
  },
  {
    "name": "Jharkhand",
    "capital": "Ranchi"
  },
  {
    "name": "Karnataka",
    "capital": "Bengaluru"
  },
  {
    "name": "Kerala",
    "capital": "Thiruvananthapuram"
  },
  {
    "name": "Madhya Pradesh",
    "capital": "Bhopal"
  },
  {
    "name": "Maharashtra",
    "capital": "Mumbai"
  },
  {
    "name": "Manipur",
    "capital": "Imphal"
  },
  {
    "name": "Meghalaya",
    "capital": "Shillong"
  },
  {
    "name": "Mizoram",
    "capital": "Aizawl"
  },
  {
    "name": "Nagaland",
    "capital": "Kohima"
  },
  {
    "name": "Orissa",
    "capital": "Bhubaneshwar"
  },
  {
    "name": "Rajasthan",
    "capital": "Jaipur"
  },
  {
    "name": "Sikkim",
    "capital": "Gangtok"
  },
  {
    "name": "Tamil Nadu",
    "capital": "Chennai"
  },
  {
    "name": "Telangana",
    "capital": "Hyderabad"
  },
  {
    "name": "Tripura",
    "capital": "Agartala"
  },
  {
    "name": "Uttarakhand",
    "capital": "Dehradun"
  },
  {
    "name": "Uttar Pradesh",
    "capital": "Lucknow"
  },
  {
    "name": "West Bengal",
    "capital": "Kolkata"
  },
  {
    "name": "Punjab",
    "capital": "Chandigarh"
  }
]