The Coworking Space Service is a set of APIs that enables users to request one-time tokens and administrators to authorize access to a coworking space.
- Python Environment - run Python 3.6+ applications and install Python dependencies via
pip
- Docker CLI - build and run Docker images locally
kubectl
- run commands against a Kubernetes clusterhelm
- apply Helm Charts to a Kubernetes cluster
- AWS CodeBuild - build Docker images remotely
- AWS ECR - host Docker images
- Kubernetes Environment with AWS EKS - run applications in k8s
- AWS CloudWatch - monitor activity and logs in EKS
- GitHub - pull and clone code
- Open EKS console and create a EKS cluster.
- Waiting for EKS cluster created, navigate to Compute tab and create Node Group.
- Update the Kubeconfig
aws eks --region <region> update-kubeconfig --name <your_cluster_name>
Set up a Postgres database using a Helm Chart.
- Prepare storage for database.
kubectl apply -f deployment/pv.yaml
kubectl apply -f deployment/pvc.yaml
- Set up Bitnami Repo
helm repo add bitnami https://charts.bitnami.com/bitnami
- Install PostgreSQL Helm Chart
helm install coworking-db bitnami/postgresql \
--set auth.username=admin \
--set auth.password=admin123 \
--set auth.database=coworking \
--set primary.persistence.existingClaim=coworking-space-pvc \
--set volumePermissions.enabled=true
- Test Database Connection
- Connecting Via Port Forwarding
kubectl port-forward --namespace default svc/coworking-db-postgresql 5432:5432 &
psql --host 127.0.0.1 -U admin -d coworking -p 5432
- Run Seed Files
We will need to run the seed files in
db/
in order to create the tables and populate them with data.
- On Windows:
kubectl port-forward --namespace default svc/<SERVICE_NAME>-postgresql 5432:5432
psql --host 127.0.0.1 -U postgres -d postgres -p 5432 -f <FILE_NAME.sql>
- Push Analytics Application source code and CodeBuild template to your Github repository.
- Create CodeBuild project and config project to run your CodeBuild template.
- Open ECR console and find the Analytics application image's URI
- Update your deployment template
containers:
- name: coworking-space
image: 346395109265.dkr.ecr.us-east-1.amazonaws.com/coworking-space:1
- Deploy your application
kubectl apply -f deployment/db-secret.yaml
kubectl apply -f deployment/db-configmap.yaml
kubectl apply -f deployment/coworking-space-configmap.yaml
kubectl apply -f deployment/coworking-space.yaml
- With Amazon CloudWatch cross-account observability, you can monitor and troubleshoot applications that span multiple accounts within a Region.
- Seamlessly search, visualize, and analyze your metrics, logs, traces, and Application Insights applications across linked accounts without account boundaries1.
kubectl cluster-info
This command displays information about the Kubernetes cluster, including the cluster endpoint and the Kubernetes version.
kubectl get nodes
This command lists all the nodes in the cluster and their status. It can help you verify if the nodes are running and ready.
kubectl get pods --all-namespaces
This command lists all the pods in all namespaces. It can help you identify if any pods are not running or experiencing issues.
kubectl describe pod <pod-name> -n <namespace>
This command provides detailed information about a specific pod, including its current state, events, and any error messages. Replace pod-name with the name of the pod and namespace with the namespace it belongs to.
kubectl logs <pod-name> -n <namespace>
This command displays the logs of a specific pod. It can help you troubleshoot issues by examining the output and error messages. Replace pod-name with the name of the pod and namespace with the namespace it belongs to.
kubectl exec -it <pod-name> -n <namespace> -- <command>
This command allows you to execute a command directly inside a pod. It can be useful for troubleshooting or debugging purposes. Replace pod-name with the name of the pod, namespace with the namespace it belongs to, and command with the desired command.