Skaffold Jib

Razor

2019/12/19 发布于 技术 分类

文字内容
1. Skaffold for Java Continuous Development for Kubernetes github.com/GoogleContainerTools/skaffol d
2. Skaffold github.com/GoogleContainerTools/skaffold
3. Cloud Tools for Java Qingyang “Q” Chen @coollog Appu Goundan @loosebazooka
4. Skaffold is a command line tool that facilitates continuous development for Kubernetes applications. You can iterate on your application source code locally then deploy to local or remote Kubernetes clusters. Skaffold handles the workflow for building, pushing and deploying your application. It can also be used in an automated context such as a CI/CD pipeline to leverage the same workflow and tooling when moving applications to production. github.com/GoogleContainerTools/skaffold official website
5. "Dev"
6. $ ./gradlew assemble Build
7. $ ./gradlew assemble $ docker build . -t gcr.io/co-repo/co-app:v9 Containerize
8. $ ./gradlew assemble $ docker build . -t gcr.io/co-repo/co-app:v9'>co-app:v9 $ docker push gcr.io/co-repo/co-app:v9'>co-app:v9 Push
9. $ $ $ $ $ Deploy ./gradlew assemble docker build . -t gcr.io/co-repo/co-app:v9'>co-app:v9 docker push gcr.io/co-repo/co-app:v9'>co-app:v9 vi co-deployment.yaml kubectl apply -f co-deployment.yaml
10. Connect $ $ $ $ $ $ $ $ ./gradlew assemble docker build . -t gcr.io/co-repo/co-app:v9'>co-app:v9 docker push gcr.io/co-repo/co-app:v9'>co-app:v9 vi co-deployment.yaml kubectl apply -f co-deployment.yaml kubectl get pods kubectl port-forward co-pod-qx54dw 8080:8080 kubectl logs -f co-pod-qx54dw
12. Development Process code build push deploy k8s config connect application update Things I care about Things I wish would just happen
13. $ skaffold dev Skaffold
14. Development Process code skaffold k8s config application
15. Demo
16. Skaffold Workflow
17. Simple Skaffold Config skaffold.yaml k8s-deployment.yaml apiVersion: skaffold/v1alpha4 kind:'>kind: Deployment kind:'>kind: Config ... build: spec:'>spec: artifacts: - image:'>image: gcr.io/appu-learn/skaffold-talk context: app deploy: kubectl: manifests: - k8s-* template: spec:'>spec: containers: - image:'>image: gcr.io/appu-learn/skaffold-talk ports: - containerPort: 8080
18. Pluggable
22. Demo
23. What about Jib? Java?
24. Steps: 1. Apply the plugin. 2. gradle jib (or mvn jib:build) github.com/GoogleContainerTools/jib
25. Jib ❤ Skaffold
26. Jib
27. Simple skaffold.yaml (powered up with Jib) apiVersion:'>apiVersion: skaffold/v1alpha4 apiVersion:'>apiVersion: skaffold/v1alpha4 kind:'>kind: Config kind:'>kind: Config build:'>build: build:'>build: artifacts:'>artifacts: artifacts:'>artifacts: - imageName:'>imageName: gcr.io/appu-learn/skaffold-talk - imageName:'>imageName: gcr.io/appu-learn/skaffold-talk jibGradle: {} deploy:'>deploy: kubectl:'>kubectl: manifests:'>manifests: - k8s-* jibMaven: {} deploy:'>deploy: kubectl:'>kubectl: manifests:'>manifests: - k8s-*
28. Simple skaffold.yaml (powered up with Jib) apiVersion:'>apiVersion: skaffold/v1alpha4 apiVersion:'>apiVersion: skaffold/v1alpha4 kind:'>kind: Config kind:'>kind: Config build:'>build: build:'>build: artifacts:'>artifacts: artifacts:'>artifacts: - imageName:'>imageName: gcr.io/appu-learn/skaffold-talk - imageName:'>imageName: gcr.io/appu-learn/skaffold-talk jibGradle: project: subproject deploy:'>deploy: kubectl:'>kubectl: manifests:'>manifests: - k8s-* jibMaven: profile: skaffold module: submodule deploy:'>deploy: kubectl:'>kubectl: manifests:'>manifests: - k8s-*
29. Lets see this in action!
30. Survey App frontend-service Groovy/Micronaut/Gradle / cast votes vote-service Java/Spring/Gradle /results view results notification-service NodeJS
31. skaffold.yaml apiVersion: skaffold/v1alpha4 kind: Config build: artifacts: - image:'>image:'>image:'>image: gcr.io/qingyangc-sandbox/codeone-frontend jibGradle:'>jibGradle: {} context:'>context:'>context:'>context: frontend-service - image:'>image:'>image:'>image: gcr.io/qingyangc-sandbox/codeone-vote jibGradle:'>jibGradle: {} context:'>context:'>context:'>context: vote-service - image:'>image:'>image:'>image: gcr.io/qingyangc-sandbox/codeone-notification context:'>context:'>context:'>context: notification-service
32. skaffold dev github.com/coollog/skaffold-code.one
33. skaffold-code.one github.com/coollog/skaffold-code.one
34. Other features - skaffold run skaffold build remote file sync --trigger=manual Future features - Debugger Test phase IDE support skaffold init with Jib Beta
35. github.com/GoogleContainerTools/skaffold github.com/GoogleContainerTools/jib github.com/coollog/skaffold-code.one