Deploy EKS with hem

1. Require

Install EKS

To install or upgrade eksctl on macOS using Homebrew

  1. Install the Weaveworks Homebrew tap.

    brew tap weaveworks/tap
    1. Install or upgrade eksctl.

      • Install eksctl with the following command.

        brew install weaveworks/tap/eksctl
      • If eksctl is already installed, run the following command to upgrade.

        brew upgrade eksctl & brew link --overwrite eksctl
    2. Test that your installation was successful with the following command. You must have eksctl 0.34.0 version or later.

      eksctl version
To install or upgrade eksctl on Linux using curl

  1. Download and extract the latest release of eksctl with the following command.

    curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
  2. Move the extracted binary to /usr/local/bin.

    sudo mv /tmp/eksctl /usr/local/bin
  3. Test that your installation was successful with the following command. You must have eksctl 0.34.0 version or later.

    eksctl version
Create an Amazon EKS cluster using eksctl

  1. Create cluster

    eksctl create cluster -n ordering-app --region ap-southeast-1 --profile zig

2. Todo

See all the pods

$ kubectl get po




Check logs

$ kubectl logs 


3. Key Note

#I. Config EKS AWS for K8S local
## Check Kubectl version
```
kubectl version --client
```
## Add Cluster EKS AWS to k8s local
```
aws eks --region <region> update-c --name <cluster-name>
```
## Verification
```
kubectl config get-contexts
```
## Switch to use the context for EKS AWS; even though if you have a problem with kubectl get pods, or some thing like that, you also use this command.
```
kubectl config use-context <context-name>
```

## If you want to remove configuration EKS Cluster, Context AWS in your k8s
### The first: remove config
```
kubectl config show
kubectl config delete-cluster <cluster-name>
```
### The second: remove context
```
kubectl config get-contexts
kubectl config delete-context <context-name>
```
## Note
### Set configuration 
```
aws eks --region <region-code> update-kubeconfig --name <cluster-name>
```
### Some commands for tracking when having issue
#### Check Node Resources
```
kubectl describe nodes
```
#### Monitoring
```
kubectl get pods --all-namespaces
kubectl describe pod ordering-app-rabbitmq-0

kubectl get po
kubectl logs kubectl logs auth-c55dd54d5-4c247
```
```
# Get deployment
kubectl get deployment
```
```
# Get replicaset
kubectl get replicaset
```
#### 

# II. Build Dockerfile
## Build images
```
cd apps/ordering
docker build ../../ -f Dockerfile -t loinv4/ordering-app_order
```
### Push image
```
docker image push loinv4/ordering-app_order
```

# III. Install Helm
## Deploy
```bash
cd helm/ordering-app
helm install ordering-app .
```

## Update Helm dependency to install the dependencies such as RabbitMQ, Redis,..
```
helm dependency update
```

## Update Helm dependency
```
helm upgrade ordering-app .
```

3. Kind of K8S

  1. Pod: The smallest deployable unit in Kubernetes, representing a single instance of a running process in the cluster.

  2. Deployment: A resource used to define a desired state for a deployment of pods. It provides declarative updates to applications, such as rolling updates and scaling.

  3. StatefulSet: Manages the deployment and scaling of a set of pods, and provides guarantees about the ordering and uniqueness of these pods.

  4. Service: Defines a logical set of pods and a policy by which to access them, typically providing a stable endpoint for communication.

  5. ReplicaSet: Ensures that a specified number of pod replicas are running at any given time, providing high availability for your application.

  6. Ingress: Manages external access to services in a cluster, typically HTTP(S) routes.


  7. ConfigMap: Stores configuration data as key-value pairs, which can be used by other resources in the cluster.


  8. Secret: Stores sensitive data, such as passwords or API keys, and makes it available to pods securely.


  9. Namespace: Provides a scope for names, allowing to partition resources into logically named groups.


  10. Job: Runs a specific task to completion, such as a batch job or one-off tasks.


  11. CronJob: Runs a job on a schedule, similar to cron in Unix-like operating systems.


  12. PersistentVolume / PersistentVolumeClaim: Provides a way for users to request durable storage resources and have them provisioned by an administrator.


  13. ServiceAccount: Provides an identity for processes that run in a pod, allowing control over the permissions those processes have in the cluster.


  14. Namespace: Provides a way to logically divide cluster resources between multiple users, teams, or projects.


  15. DaemonSet: Ensures that all (or some) nodes run a copy of a pod, typically used for system daemons or log collectors.

3. Install K8S at your local

Require: Docker
Install kubectl
Install Kind
Create Cluster using Kind
Done


The OCR Service to extract the Text Data

Optical character recognition, or OCR, is a key tool for people who want to build or collect text data. OCR uses machine learning to extract...