Skip to content

ykyr/practical-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task 1

Prepare environment

  1. Download sources.
  2. Configure gcloud unitily to work with current project.
gcloud auth login
gcloud config list project
gcloud config list
  1. Download credentials.json due to official documentation.
  2. Configure path to credentials.json file in main.tf
  3. Install GKE.
cd terraform
terrafrom plan
terrafrom apply

Build docker image 6. Change directory to "application/java"

cd application
  1. Configure docker to use Google container registry. (gcloud should be already configured to your project)
gcloud alpha auth configure-docker
  1. Build docker image and according to PROJECT_ID You can use following command to get PROJECT_ID
export PROJECT_ID="$(gcloud config get-value project -q)"
echo $PROJECT_ID
docker build -t eu.gcr.io/$PROJECT_ID/java_app:v1 .

Check application

docker run --rm eu.gcr.io/$PROJECT_ID/java_app:v1
  1. Push image to google cloud registry
docker push eu.gcr.io/$PROJECT_ID/java_app:v1
  1. Prepare kubectl to work with deployed k8s.
gcloud container clusters get-credentials k8skiwi-cluster --zone europe-west2-a --project $PROJECT_ID
  1. Set correct image name in kubernetes/deployment.yml (from previous push)
  2. Deploy application, service and ingress to Kubernetes
cd kubernetes
kubectl apply -f deployment.yml
kubectl apply -f service.yml
kubectl apply -f ingress.yml
  1. Get ingress external endpoint and check connection
kubectl get ingress

Releases

No releases published

Packages

No packages published