連続的な統合(CI)ローカル
セットアップ
Minikubeをインストールしてください
あなたがKubectlをインストールしたことを確認してください
Dockerがインストールされていることを確認します
画像をプッシュする
ブログを参照してください
ステップ
次の依存関係を持つ
スタートから.春.io
2 .イメージを作成するためのDockerファイルリファレンスの参照
FROM openjdk:13
EXPOSE 9000
ARG JAR_FILE= ./target/spring-dockr-k8s-0.0.1-SNAPSHOT.jar
ADD ./target/spring-dockr-k8s-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-version}</version> <executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<username>username</username>
<password>******</password>
<repository>sanjaybsm/spring-dockr-k8s</repository>
<tag>latest</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
ビルド、インストール、プッシュ
あなたのPOM変化がそれから正しいならば、

mvn clean install' should already build an image for you, and you should see below logs.
[INFO] Successfully built sanjaybsm/spring-dockr-k8s:latest
`プッシュ
InteliIjからスナップの下に、手動でもコマンドラインからコマンドを実行するイメージをプッシュすることができます.

[INFO] Image 54ab11ed5591: Preparing
[INFO] Image b8cb43830a76: Preparing
[INFO] Image 93c304238ab8: Preparing
[INFO] Image 12a9cd7d069e: Preparing
[INFO] Image 93c304238ab8: Layer already exists
[INFO] Image b8cb43830a76: Layer already exists
[INFO] Image 54ab11ed5591: Pushing
[INFO] Image 12a9cd7d069e: Layer already exists
[INFO] Image 54ab11ed5591: Pushed
[INFO] latest: digest: sha256:f2ddde51cbd4005ec90c25698649e1cf960cd1fbeb308f1de4b05b9a53606c48 size: 1166
Start minikube and run the image locally
Start minikube minikube start
あなたがK 8 Sクラスタの外のアプリにアクセスできるようにMinikubeトンネルを開始しますminikube tunnel
トンネルを開いておいてください、そして、この変更はWindowsのために必要です.
展開の作成
kubectl create deployment testspringk8s --image={dockerhub_username}/{image_name}:{version}
e.g.kubectl create deployment testspringk8s --image=sanjaybsm/spring-dockr-k8s
Expose Deployment
kubectl expose deployment testspringk8s --type=LoadBalancer --port=9000
Run this command to know the externalIp assigned
kubectl get svc
It should show something like below

if it's pending it means that your tunnel is not running or some issue with your minikube
Happy learning!
reference
Reference
この問題について(連続的な統合(CI)ローカル), 我々は、より多くの情報をここで見つけました
https://dev.to/sanjaybsm/springboot-docker-minikube-kubectl-local-setup-and-deployment-382m
テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol