项目作者: daggerok

项目描述 :
Quarkus k8s
高级语言: Java
项目地址: git://github.com/daggerok/quarkus-kubernetes-example.git
创建时间: 2019-11-27T03:06:26Z
项目社区:https://github.com/daggerok/quarkus-kubernetes-example

开源协议:

下载


quarkus k8s reactive vertx handlebars Build Status

Quarkus k8s

docker (fabric8)

requires: docker network create quarkus-kubernetes-example || echo oops

jvm

  1. ./mvnw -Pfabric8-jvm clean compile quarkus:build docker:build docker:start
  2. #for id in $(docker ps -q) ; do docker inspect $id | jq '.[].NetworkSettings.Ports."8080/tcp"[].HostPort' -r ; done
  3. #for id in $(docker ps -q) ; do http :$(docker inspect $id | jq '.[].NetworkSettings.Ports."8080/tcp"[].HostPort' -r) ; done
  4. http :8080
  5. http :8081
  6. ./mvnw -Pfabric8-jvm docker:stop docker:remove

native

  1. ./mvnw -Pnative -Dquarkus.native.container-build=true clean compile quarkus:build
  2. ./mvnw -Pfabric8-native docker:build docker:start
  3. #for id in $(docker ps -q) ; do docker inspect $id | jq '.[].NetworkSettings.Ports."8080/tcp"[].HostPort' -r ; done
  4. #for id in $(docker ps -q) ; do http :$(docker inspect $id | jq '.[].NetworkSettings.Ports."8080/tcp"[].HostPort' -r) ; done
  5. http :8080
  6. http :8081
  7. ./mvnw -Pfabric8-native docker:stop docker:remove

k8s

jvm k8s in docker for mac / windows

  1. ./mvnw -Pfabric8-jvm clean compile quarkus:build docker:build docker:push
  2. kubectl get pods -o wide -w &
  3. kubectl apply -f k8s/ -f k8s/ingress/docker.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
  4. # wait for bootstrap...
  5. http :/
  6. http :/backend
  7. http :30080/
  8. http :30081/
  9. kubectl delete -f k8s/ -f k8s/ingress/docker.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml

jvm k8s in k3s in k3d

  1. ./mvnw -Pfabric8-jvm clean compile quarkus:build docker:build docker:push
  2. k3d create --name k3s --api-port 6551 --publish 80:80 --publish 30080:30080 --publish 30081:30081 --workers 2
  3. sleep 10s ; export KUBECONFIG="$(k3d get-kubeconfig --name='k3s')" ; kubectl get pods -o wide -w &
  4. kubectl apply -f k8s/ -f k8s/ingress/traefik.yaml
  5. # wait for bootstrap...
  6. http :/
  7. http :/backend
  8. http :30080/
  9. http :30081/
  10. kubectl delete -f k8s/ -f k8s/ingress/traefik.yaml
  11. k3d stop --name=k3s -a ; rm -rf ~/.config/k3d/k3s

native k8s in docker for mac / windows

  1. ./mvnw -Pnative -Dquarkus.native.container-build=true clean compile quarkus:build
  2. ./mvnw -Pfabric8-native docker:build docker:push
  3. kubectl get pods -o wide -w &
  4. kubectl apply -f k8s/ -f k8s/ingress/docker.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml
  5. # wait for bootstrap...
  6. http :/
  7. http :/backend
  8. http :30080/
  9. http :30081/
  10. kubectl delete -f k8s/ -f k8s/ingress/docker.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/cloud-generic.yaml

native k8s in k3s in k3d

  1. ./mvnw -Pnative -Dquarkus.native.container-build=true clean compile quarkus:build
  2. ./mvnw -Pfabric8-native docker:build docker:push
  3. k3d create --name k3s --api-port 6551 --publish 80:80 --publish 30080:30080 --publish 30081:30081 --workers 2
  4. sleep 10s ; export KUBECONFIG="$(k3d get-kubeconfig --name='k3s')" ; kubectl get pods -o wide -w &
  5. kubectl apply -f k8s/ -f k8s/ingress/traefik.yaml
  6. # wait for bootstrap...
  7. http :/
  8. http :/backend
  9. http :30080/
  10. http :30081/
  11. kubectl delete -f k8s/ -f k8s/ingress/traefik.yaml
  12. k3d stop --name=k3s -a ; rm -rf ~/.config/k3d/k3s ; docker rm -fv `docker ps -aq`

features

resources