diane-fileserver/infra
evan.steele 5ca1185c90 initial commit 2025-04-05 23:16:43 -07:00
..
k8s initial commit 2025-04-05 23:16:43 -07:00
k8s-dev initial commit 2025-04-05 23:16:43 -07:00
terraform initial commit 2025-04-05 23:16:43 -07:00
README.md initial commit 2025-04-05 23:16:43 -07:00

README.md

#INFRASTRUCTURE FOLDER

This folder should be moved to the root folder where all the services are located.

Replace all the key-value pairs with yours

  • k8s folder contains all production kubernetes manifests
  • k8s-dev folder contains all development kubernetes manifests to run with skaffold
  • scripts folder contains all script related to the creation of a cluster or running skaffold or secret creation

Skaffold File

For production environment: ./k8s/skaffold.yaml

For development environment: ./k8s-dev/skaffold.yaml

Remember to put this file in the root of multi-services project. Depending on the environment, you should specify the correct skaffold configuration.

  • If you use Docker, you should install NGINX at this link NGINX x Docker

TASK TO MAKE THIS WORK

  1. Create a project in GCP
  2. Go to ./scripts/gke-autopilot.sh and change the with your project id.
  3. Launch the script with chmod +x gke-autopilot.sh && ./gke-autopilot.sh
  4. Just in case context is not changed, you should change with kubectl config use-context <clustern-name>
  5. Put the file skaffold.yaml in your root folder where all the services are located.
  6. For each YAML file change the project-id, servicename and all other env variables with your
  7. After you changed all the configuration files you can launch skaffold command with skaffold run

USEFUL COMANDS

  • Change the context of kubernetes
kubectl config use-context <clustern-name>
  • Build the container in gcloud with the command. In the root where Dockerfile is located
gcloud builds submit --tag gcr.io/<gcp-project-id>/<image-name> .
  • CREATE SECRET FROM JSON FILE
    • google-application-credentials = the name of the secret to be stored
    • google-application-credentials.json = the file name and the file will be stored in a volume
    • ./google-application-credentials.json = the actual file downloaded and that is in the config folder
kubectl create secret generic google-application-credentials --from-file=google-application-credentials.json=./google-application-credentials.json