This repo contains Kubernetes configuration files used for deploying the application to staging and production environments. The configuration is organized into modules for each service, including both front-end and back-end services.
-
Manifests:
deployment.yaml
: Defines the deployment configurations for the service.service.yaml
: Specifies the service configuration for exposing the deployment.secret.yaml
: Contains sensitive data which should be stored as base64 type.configMap.yaml
: Stores non-confidential data in key-value pairs.ingress.yaml
: Configures ingress rules for external access to the services.persistentVolume.yaml
: Defines persistent storage volumes.kustomization.yaml
: Create variations of K8s resources and configurations for specific use cases.
-
Staging Environment
- A K8s cluster set up for staging environment using Terraform & Ansible with kubeadm tool. I already have a repo that sets up the cluster like the architecture below 👉 Here
- Production Environment
- A K8s cluster set up for production environment using AWS EKS service. You can follow this link to create your own cluster: Set up to use Amazon EKS
- Kubernetes clusters: Ensure you have a K8s clusters set up for staging and production environments.
kubectl
: Install and configurekubectl
to interact with your K8s cluster.
→ you need to configure the config file in.kube
folder after installingkubectl
tool. Follow the instructions here.
- Clone the repository:
git clone https://github.com/NT114-O21-DACN-DevOps/class-management-k8s-config.git
cd class-management-k8s-config
- Apply the manifests
- Because of using
kustomization
file, you only need to apply all of the config files with 1 command:
kubectl apply -k .
- Ensure that the
configMap.yaml
andsecret.yaml
files contain appropriate configurations and sensitive data for each environment. - Update
ingress.yaml
with the correct rules for routing external traffic to your services. - Review the
persistentVolume.yaml
to configure persistent storage as required by your application.