Skip to content

Instantly share code, notes, and snippets.

@abelaska
Created June 16, 2020 06:02
Show Gist options
  • Save abelaska/e5ef6af66cab006374ea1d50a42af6f7 to your computer and use it in GitHub Desktop.
Save abelaska/e5ef6af66cab006374ea1d50a42af6f7 to your computer and use it in GitHub Desktop.
Deploy to Minikube

Deploy to minikube

Ensure that docker is configured to use localhost:5000 as insecure registry https://docs.docker.com/registry/insecure/

minikube start
eval $(minikube docker-env)
docker run -d -p 5000:5000 --restart=always --name registry registry:2

mvn clean install -DskipChecks -DskipTests -DdockerBuild

docker tag docker-registry.somewhere.cz/myservice:1.5.0.BUILD-SNAPSHOT localhost:5000/myservice:1.5.0.BUILD-SNAPSHOT
docker push localhost:5000/myservice:1.5.0.BUILD-SNAPSHOT

kubectl apply -f namespace.yaml
kubectl apply -f rbac.yaml
kubectl apply -f myservice.yaml

Restart bezicich podu, s fetch policy Always znamena, ze se aktualizuji vsechny pody:

kubectl rollout restart deployment.v1.apps/myservice

Zmena poctu bezicich podu sluzby:

kubectl scale deployment.v1.apps/myservice --replicas=1
kubectl rollout status deployment.v1.apps/myservice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment