- Its specified inside terraform code that there are 2 types of Nodes running:
- General Purpose Group(t3.medium) : Does not autoscale and handled by Lord Voldemort used for general purpose thingy, Handles nginx-controller,cert-manager,monitoring
- Karpenter Group(m5-large): Ability to autoscale (yay) will be used for: kube-system, argocd, application
- Some of the packages are installed using Helm some with kubectl and others with gitops (this is because : why not) #TODO: needs to be cleaned asap
Manually done stuff: Installing these manifests manually :( -> This needs to be ported to gitops as mentioned above
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.3/cert-manager.yamlhelm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespacekubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.12.1/deploy/static/provider/aws/deploy.yamlkubectl get -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-image-updater/stable/manifests/install.yamlThis repository contains the Kubernetes configurations for deploying and managing infrastructure and applications using the GitOps methodology with ArgoCD.
-
argo-config/: ArgoCD specific configurations
image-updater.yaml: Configuration for automatically updating container imagesREADME.md: Documentation for ArgoCD setup
-
monitoring/: Observability infrastructure
namespace.yaml: Creates monitoring namespaceprometheus-cluster-monitoring.yaml: Prometheus setup for metrics collectiongrafana.yaml: Grafana setup for dashboards and visualizationloki-cluster-logging.yaml: Loki and Grafana Alloy for log aggregation and collectiondashboard.yaml: Kubernetes dashboard for cluster overviewREADME.md: Documentation for monitoring setup
-
k8s/: Kubernetes resource templates
deployment.yaml: Application deployment configurationservice.yaml: Service configuration for exposing applicationsconfigmap.yaml: ConfigMap for storing configuration datahorizontal-pod-scaler.yaml: Automatic scaling configurationcertificate.yaml: TLS certificate configurationcluster-issuer.yaml: Certificate issuer configurationsecret-store.yaml: Secret store configurationexternalSecret.yaml: External secrets configurationREADME.md: Documentation for Kubernetes resources
-
external-secrets/: External secrets operator configuration
secret-operator.yaml: External Secrets Operator deploymentREADME.md: Documentation for external secrets setup
This repository follows the GitOps methodology:
- All infrastructure and application configurations are defined as code in this repository
- ArgoCD monitors this repository for changes
- When changes are detected, ArgoCD automatically applies them to the Kubernetes cluster
- The ArgoCD Image Updater automatically updates application versions when new container images are available
- Kubernetes cluster
- ArgoCD installed and configured
kubectlCLI tool- Access to container registries
-
Deploy ArgoCD if not already installed:
kubectl create namespace argocd kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
-
Deploy the ArgoCD Image Updater:
kubectl apply -f argo-config/image-updater.yaml
-
Create the monitoring infrastructure:
kubectl apply -f monitoring/namespace.yaml kubectl apply -f monitoring/
-
Set up the External Secrets Operator:
kubectl apply -f external-secrets/secret-operator.yaml
-
Configure your application in ArgoCD to use the resources in the
k8s/directory
-
Forward the ArgoCD API server port:
kubectl port-forward svc/argocd-server -n argocd 8080:443
-
Access the ArgoCD UI at https://localhost:8080
-
Log in with the initial admin credentials:
# Get the initial admin password kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
-
Access Grafana:
kubectl port-forward svc/grafana -n monitoring 3000:80
Then open http://localhost:3000 in your browser
-
Access Prometheus:
kubectl port-forward svc/prometheus -n monitoring 9090:9090
Then open http://localhost:9090 in your browser
-
Access Kubernetes Dashboard:
kubectl port-forward svc/kubernetes-dashboard -n kubernetes-dashboard 8443:443
Then open https://localhost:8443 in your browser
- Create a new branch for your changes
- Make your changes to the configuration files
- Submit a pull request
- After review and approval, the changes will be merged to the main branch
- ArgoCD will automatically apply the changes to the cluster
- Never commit sensitive data like passwords or tokens to this repository
- Use the External Secrets Operator to manage sensitive information
- Ensure proper RBAC permissions for all components
- Follow the principle of least privilege when defining roles