3.1-deploy-services

command
v0.0.0-...-e665a74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 21 Imported by: 0

README

Deploy Service

  1. Slides Deploy Service

  2. Open directory

cd /root/automation-technology/chapter03-deploy-scale-services/3.1-deploy-services
  1. Register for https://hub.docker.com

  2. Create public repository call [your-docker-repository-name]/automation-technology

  3. Make sure you are logged in with your docker account

docker login
username:
password:
  1. Update file deploy.sh change
DOCKER_REPOSITORY=
to
DOCKER_REPOSITORY=[your-docker-repository-name]
  1. Run command (deploy.sh will be the file used to build your project, especially when it integrate with ci/cd)
./deploy.sh

This will build the Dockerfile and push image to [your-docker-repository-name]/automation-technology

  1. Explain deploy.sh (Each comments will explain itself)

  2. Explain Dockerfile

  3. Explain entrypoint.sh

  4. Run command

cd k8s
  1. Run command
kubectl apply -f .
  1. Run command
kubectl get po -n deploy-service
NAME                            READY   STATUS    RESTARTS   AGE
register-api-854c48c45c-nd8hh   1/1     Running   0          27s
register-api-854c48c45c-9fvkl   1/1     Running   0          27s
  1. Run command
kubectl get svc -n deploy-service
NAME           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
register-api   ClusterIP   10.152.183.47   <none>        8080/TCP   43s
  1. Run command
kubectl get ing -n deploy-service
NAME      CLASS    HOSTS                        ADDRESS     PORTS   AGE
ingress   public   kubernetes.docker.internal   127.0.0.1   80      65s
  1. Run command
curl -X POST "http://kubernetes.docker.internal/citizen"
{"status":"success"}
  1. Run command
curl -X PUT "http://kubernetes.docker.internal/citizen/123"
{"id":"123"}
  1. Run command
curl -X GET "http://kubernetes.docker.internal/citizen/123?page=2"
{"id":"123","page":"2"}
  1. Run command
curl -X DELETE "http://kubernetes.docker.internal/citizen/123"
{"status":"success"}
  1. Run command
kubectl delete ns deploy-service

Documentation

Overview

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Create and maintain by Chaiyapong Lapliengtrakul (chaiyapong@3dsinteractive.com), All right reserved (2021 - Present)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL