-
Notifications
You must be signed in to change notification settings - Fork 0
suggestion/minikube #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| .idea | ||
| .vscode | ||
| **node_modules | ||
| config.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| build: | ||
| chmod +x pre-run.sh | ||
| ./pre-run.sh first_deploy | ||
|
|
||
| start: | ||
| chmod +x pre-run.sh | ||
| ./pre-run.sh | ||
|
|
||
| clean: | ||
| echo Deletes all local Kubernetes cluster. This command deletes the VM, and removes all associated files. | ||
| minikube stop | ||
| minikube delete --all | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ spec: | |
| spec: | ||
| containers: | ||
| - name: client | ||
| image: hakimixx/docker-infra-client:v1.1 | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vær opmærksom her |
||
| image: hakimixx/docker-infra-client:latest | ||
| imagePullPolicy: Always | ||
| ports: | ||
| - containerPort: 3000 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
| CURRENT_PATH=$PWD | ||
| eval $(minikube docker-env) | ||
| echo $CURRENT_PATH | ||
| echo $CURRENT_PATH | rev | cut -d "/" -f1 | rev | ||
|
Comment on lines
+4
to
+5
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double quote these values |
||
| FILES=(client-deployment.yml server-deployment.yml worker-deployment.yml) | ||
| PATH_OF_DOCKERFILES=$(echo $CURRENT_PATH | rev | cut -d "/" -f1 | rev) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this line do? |
||
|
|
||
| first_deploy() { | ||
| minikube start | ||
| minikube addons enable ingress | ||
| eval $(minikube docker-env) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double quote here as well. |
||
| kubectl create secret generic pgpassword --from-literal PGPASSWORD=postgres | ||
| } | ||
|
|
||
| if [[ ! -z "$1" ]]; then first_deploy; fi | ||
|
|
||
| docker build -t "$PATH_OF_DOCKERFILES"/docker-infra-client:latest -t "$PATH_OF_DOCKERFILES"/docker-infra-client:latest -f ./client/Dockerfile ./client | ||
| docker build -t "$PATH_OF_DOCKERFILES"/docker-infra-server:latest -t "$PATH_OF_DOCKERFILES"/docker-infra-server:latest -f ./server/Dockerfile ./server | ||
| docker build -t "$PATH_OF_DOCKERFILES"/docker-infra-worker:latest -t "$PATH_OF_DOCKERFILES"/docker-infra-worker:latest -f ./worker/Dockerfile ./worker | ||
|
|
||
| cd $CURRENT_PATH/kubernetes/deployments | ||
| # Use local images in minikube - this probably won't work on ubuntu | ||
| for key in ${!FILES[@]}; do | ||
| sed -i "" "/^\([[:space:]]*imagePullPolicy: \).*/s//\1Never/" ${FILES[${key}]} | ||
| done | ||
| cd $CURRENT_PATH | ||
|
|
||
| ./scripts/apply-resources.sh | ||
| kubectl rollout restart deployment client-deployment | ||
| kubectl rollout restart deployment server-deployment | ||
| kubectl rollout restart deployment worker-deployment | ||
|
|
||
| cd $CURRENT_PATH/kubernetes/deployments | ||
| # Resetting values changed. | ||
| for key in ${!FILES[@]}; do | ||
| sed -i "" "/^\([[:space:]]*imagePullPolicy: \).*/s//\1Always/" ${FILES[${key}]} | ||
| done | ||
| cd $CURRENT_PATH | ||
| echo | ||
| echo | ||
| echo | ||
| echo sometimes it gets stuck just do ctrl + c on it, do verify by refreshing website. | ||
|
Comment on lines
+40
to
+43
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps replace these lines with: echo $'\nIn case the script is stuck, simply terminate and verify by refreshing the client' |
||
| minikube -p minikube docker-env | ||
| minikube tunnel | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about creating a minikube profile which allows us to manage multiple minikube instances.
That way we don't terminate other minikube instances (applications running) by executing
minikube stop.And perhaps add a
stopstep, that simply stops the current instance and doesn't delete it.