Afọ 25 gara aga, Java batara na mmemme mmemme wee mechaa bụrụ otu n'ime isi ihe na-arụkọba ngwa ngwa. Otú ọ dị, taa, ọtụtụ ndị mmadụ na òtù ndị na-eguzosi ike n'ihe nye Java ruo ọtụtụ afọ na-arụsi ọrụ ike ịkwaga ma ọ bụ na-atụle ịkwaga n'elu ikpo okwu.
N'ụzọ dị mwute, Kubernetes nwere usoro mmụta dị elu ma webata oyi akwa ọzọ na-arụ ọrụ n'ime usoro mmepe nke ndị mmemme Java na-amabu. Taa, anyị ga-agwa gị otu esi eji
Usoro mmepe Java ọdịnala
Usoro mmepe ọdịnala
Osikapa. 1. Usoro mmepe Java omenala.
Usoro mmepe Java maka igwe ojii
Mgbe ị na-aga na ngwa igwe ojii, Kubernetes na
A na-egosi metamorphosis nke usoro mmepe Java ọdịnala na ntụgharị na igwe ojii na fig. 2.
Osikapa. 2. Usoro mmepe Java maka igwe ojii.
Eclipse JKube
Ịkwaga Kubernetes na-agbakwụnye ọrụ ọzọ na-arụ ọrụ na usoro mmepe, ọtụtụ ndị mmepe na-atụkwa ụjọ maka ya n'ihi na ha chọrọ ilekwasị anya na isi ọrụ ha - mgbagha ngwa - kama otu esi ebuga ha. Na nke a bụ ebe ọ na-abata egwuregwu.
N'ime edemede ndị ọzọ, anyị ga-egosi gị otu esi eme ka usoro mmepe Java dị mfe na gburugburu Kubernetes site na iji Eclipse JKube na Kubernetes Maven Plugin.
Usoro mmepe igwe ojii na-eji Eclipse JKube
Ka anyị tụlee atụmatụ mmepe Java gbanwetụrụ maka igwe ojii site na Fig. 2, na-ewebata Eclipse JKube na Kubernetes Maven Plugin n'ime ya, dị ka egosiri na fig. 3.
Osikapa. 3. Usoro mmepe Java maka igwe ojii na-eji Eclipse JKube.
Dị ka anyị nwere ike ịhụ, ebe a niile arụmọrụ maka mmekọrịta na Kubernetes na containers (pụtara na-acha uhie uhie na eserese) na-dochie na ndabara Eclipse JKube mgbaru ọsọ ihe aga-eme, nke e depụtara na Tebụl. 1.
Tebụl 1. Eclipse JKube ndabere aga-eme.
Ebumnuche
Nkeji
Nkowasi
PRE_INTEGRATION_TEST
Ihe onyonyo ụlọ docker
Iwunye
Na-ebugo onyonyo docker na ndekọ
PROCESS_RESOURCES
Na-emepụta K8s pụtara
Kpọkọtara
Itinye ihe ngosi emepụtara na K8s
Ebupughi
Iwepu akụrụngwa K8 nke ejiri k8s: tinye na k8s: deploy
Cheta na: Ọ bụrụ na ịchọghị ka ọrụ jiri ndabara echiche ndị a, ị nwere ike iji aka hazie Eclipse JKube maka onwe gị, ebe ọ na-akwado nhazi site na.
Ugbu a, ka anyị leba anya n'ihe atụ nke iji Eclipse JKube na Kubernetes Maven Plugin mgbe ị na-arụ ọrụ na ngwa.
Na-ebunye ngwa Java na Kubernetes Iji Eclipse JKube
N'ihe atụ a, anyị ga-ebunye ngwa Java dị mfe na ụyọkọ
Dị ka ihe atụ ngwa anyị na-eji
~/work/repos/eclipse-jkube-demo-project : $ curl localhost:8080/random | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45 0 45 0 0 818 0 --:--:-- --:--:-- --:--:-- 818
{
"id": "e80a4d10-c79b-4b9a-aaac-7c286cb37f3c"
}
Nzọụkwụ 1. Download Kubernetes Maven Plugin
Kubernetes Maven Plugin dị na ebe nchekwa
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
</plugin>
Ọ bụrụ na a na-eji OpenShift kama ịbụ Kubernetes dị ọcha, mgbe ahụ a gbanwere pom.xml dị ka ndị a:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>openshift-maven-plugin</artifactId>
<version>${jkube.version}</version>
</plugin>
Nzọụkwụ 2. Mepụta ihe oyiyi docker
Enwere ike iji iwu ngwugwu mvn wulite faịlụ JAR ngwa ahụ, wee jiri mvn goal task k8s:wulite wee wuo docker image nke ngwa ahụ. Rịba ama na anyị ejiri akụrụngwa a ewepụla aha onyonyo adịghị mma:
<jkube.generator.name>docker.io/rohankanojia/random-generator:${project.version}</jkube.generator.name>
Tupu ịmepụta ihe oyiyi ahụ, ịkwesịrị ijide n'aka na ekpughere docker daemon nke ọma. Enwere ike ime nke a site na iwu a:
$ eval $(minikube docker-env)
Mgbe ahụ, anyị na-abanye mvn k8s: iwu iwu, nke a bụ ihe anyị ga-ahụ na ihuenyo mgbe ị na-arụ ọrụ docker site na iji Eclipse JKube rụọ ọrụ:
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:build
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:build (default-cli) @ random-generator ---
[INFO] k8s: Running in Kubernetes mode
[INFO] k8s: Building Docker image in Kubernetes mode
[INFO] k8s: Running generator spring-boot
[INFO] k8s: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.7 as base / builder
[INFO] k8s: [docker.io/rohankanojia/random-generator:0.0.1] "spring-boot": Created docker-build.tar in 251 milliseconds
[INFO] k8s: [docker.io/rohankanojia/random-generator:0.0.1] "spring-boot": Built image sha256:a20e5
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.053 s
[INFO] Finished at: 2020-08-10T11:28:23+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $
Nzọụkwụ 3. Bulite oyiyi ahụ na ndekọ docker
Mgbe anyị wuchara onyonyo docker site na ahaziri ndekọ push (n'ọnọdụ anyị ọ bụ docker.io), anyị nwere ike izipu onyonyo a na ndekọ. Nke a bụ ihe a ga-egosipụta mgbe anyị jụrụ Eclipse JKube ka ọ rụọ mvn k8s: push push task:
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:push
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:push (default-cli) @ random-generator ---
[INFO] k8s: Running in Kubernetes mode
[INFO] k8s: Building Docker image in Kubernetes mode
[INFO] k8s: Running generator spring-boot
[INFO] k8s: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.7 as base / builder
[INFO] k8s: The push refers to repository [docker.io/rohankanojia/random-generator]
5dcd9556710f: Layer already exists
b7139ad07aa8: Layer already exists
b6f081e4b2b6: Layer already exists
d8e1f35641ac: Layer already exists
[INFO] k8s: 0.0.1: digest: sha256:9f9eda2a13b8cab1d2c9e474248500145fc09e2922fe3735692f9bda4c76002d size: 1162
[INFO] k8s: Pushed docker.io/rohankanojia/random-generator:0.0.1 in 7 seconds
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.222 s
[INFO] Finished at: 2020-08-10T11:35:37+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $
Mgbe izipu ihe onyonyo a, ịkwesịrị ịlele na etinyere ya na ndekọ. N'ọnọdụ anyị, anyị na-ahụ ya na Docker Hub, dị ka egosiri na fig. 4.
Osikapa. 4. Foto ezigara na ndekọ ahụ pụtara na Docker Hub.
Nzọụkwụ 4. N'ịwa Kubernetes akụ egosipụta maka ngwa
Yabụ, anyị achịkọtala onyonyo ngwa ahụ, ugbu a anyị kwesịrị ide ihe ngosi Kubernetes. Iji mee nke a, Eclipse JKube nwere ọrụ nke na-emepụta ihe onwunwe siri ike na-egosipụta dabere na usoro Java dị n'okpuru.
N'ihe atụ anyị, anyị na-ahapụ ihe niile dị ka ọ dị, ya mere Eclipse JKube na-emepụta ihe ngosi maka ntinye nke ndabara yana maka ọrụ nwere ụdị ClusterIP. Naanị mgbe ahụ, anyị na-agbanwe ngosipụta ọrụ iji gbanwee ụdị ọrụ na NodePort. Ị nwere ike mebie omume ndabara site na iji ihe ndị a:
<jkube.enricher.jkube-service.type>NodePort</jkube.enricher.jkube-service.type>
Nke a bụ ihe mmepụta ihuenyo dị ka mgbe anyị jụrụ Eclipse JKube ka ọ rụọ ọrụ mvn k8s: resource resource.
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:resource
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:resource (default-cli) @ random-generator ---
[INFO] k8s: Running generator spring-boot
[INFO] k8s: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.7 as base / builder
[INFO] k8s: jkube-controller: Adding a default Deployment
[INFO] k8s: jkube-service: Adding a default service 'random-generator' with ports [8080]
[INFO] k8s: jkube-healthcheck-spring-boot: Adding readiness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 10 seconds
[INFO] k8s: jkube-healthcheck-spring-boot: Adding liveness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 180 seconds
[INFO] k8s: jkube-revision-history: Adding revision history limit to 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.344 s
[INFO] Finished at: 2020-08-10T11:38:11+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $ ls target/classes/META-INF/jkube/kubernetes
random-generator-deployment.yml random-generator-service.yml
~/work/repos/eclipse-jkube-demo-project : $ cat target/classes/META-INF/jkube/kubernetes/random-generator-deployment.yml | head -n10
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
jkube.io/git-url: [email protected]:rohanKanojia/eclipse-jkube-demo-project.git
jkube.io/git-commit: 1ef9ef2ef7a6fcbf8eb64c293f26f9c42d026512
jkube.io/git-branch: master
jkube.io/scm-url: https://github.com/spring-projects/spring-boot/spring-boot-starter-parent/random-generator
jkube.io/scm-tag: HEAD
~/work/repos/eclipse-jkube-demo-project : $
Nzọụkwụ 5. Nyefee ngwa ahụ na ụyọkọ Kubernetes
Ugbu a anyị akwadola ibubata ngwa ahụ: anyị ewepụtala onyonyo ya wee mepụta akụrụngwa na-akpaghị aka. Ugbu a naanị ihe fọdụrụ bụ itinye ihe a niile na ụyọkọ Kubernetes. Iji tinye ngwa ahụ, ị nwere ike, n'ezie, jiri kubectl apply -f iwu, mana ngwa mgbakwunye nwere ike imere anyị nke a. Nke a bụ ihe ga-apụta na ihuenyo mgbe anyị jụrụ Eclipse JKube ka o mebie mvn k8s: tinye ọrụ:
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:apply
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:apply (default-cli) @ random-generator ---
[INFO] k8s: Using Kubernetes at https://192.168.39.145:8443/ in namespace default with manifest /home/rohaan/work/repos/eclipse-jkube-demo-project/target/classes/META-INF/jkube/kubernetes.yml
[INFO] k8s: Using namespace: default
[INFO] k8s: Creating a Service from kubernetes.yml namespace default name random-generator
[INFO] k8s: Created Service: target/jkube/applyJson/default/service-random-generator.json
[INFO] k8s: Creating a Deployment from kubernetes.yml namespace default name random-generator
[INFO] k8s: Created Deployment: target/jkube/applyJson/default/deployment-random-generator.json
[INFO] k8s: HINT: Use the command `kubectl get pods -w` to watch your pods start up
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.306 s
[INFO] Finished at: 2020-08-10T11:40:57+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $ kubectl get pods -w
NAME READY STATUS RESTARTS AGE
random-generator-58b7847d7f-9m9df 0/1 Running 0 7s
random-generator-58b7847d7f-9m9df 1/1 Running 0 17s
^C~/work/repos/eclipse-jkube-demo-project : $ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
io-openliberty-sample-getting-started NodePort 10.110.4.104 <none> 9080:30570/TCP 44h
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 18d
random-generator NodePort 10.97.172.147 <none> 8080:32186/TCP 22s
~/work/repos/eclipse-jkube-demo-project : $ curl `minikube ip`:32186/random | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45 0 45 0 0 1800 0 --:--:-- --:--:-- --:--:-- 1875
{
"id": "42e5571f-a20f-44b3-8184-370356581d10"
}
Nzọụkwụ 6. Wepụ ngwa sitere na ụyọkọ Kubernetes
Iji mee nke a, a na-eji ọrụ na-adịghị arụ ọrụ, nke na-ewepụ naanị ihe niile etinyere na nzọụkwụ gara aga, ya bụ, mgbe arụrụ ọrụ ahụ. Nke a bụ ihe anyị ga-ahụ na ihuenyo mgbe anyị jụrụ Eclipse JKube ka ọ rụọ ọrụ mvn k8s: undeploy undeploy task:
~/work/repos/eclipse-jkube-demo-project : $ kubectl get all
NAME READY STATUS RESTARTS AGE
pod/random-generator-58b7847d7f-9m9df 1/1 Running 0 5m21s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 18d
service/random-generator NodePort 10.97.172.147 <none> 8080:32186/TCP 5m21s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/random-generator 1/1 1 1 5m21s
NAME DESIRED CURRENT READY AGE
replicaset.apps/random-generator-58b7847d7f 1 1 1 5m21s
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:undeploy
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- kubernetes-maven-plugin:1.0.0-rc-1:undeploy (default-cli) @ random-generator ---
[INFO] k8s: Using Kubernetes at https://192.168.39.145:8443/ in namespace default with manifest /home/rohaan/work/repos/eclipse-jkube-demo-project/target/classes/META-INF/jkube/kubernetes.yml
[INFO] k8s: Using namespace: default
[INFO] k8s: Deleting resource Deployment default/random-generator
[INFO] k8s: Deleting resource Service default/random-generator
[INFO] k8s: HINT: Use the command `kubectl get pods -w` to watch your pods start up
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.412 s
[INFO] Finished at: 2020-08-10T11:46:22+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $ kubectl get pods -w
^C~/work/repos/eclipse-jkube-demo-project : $ kubectl get all
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 18d
~/work/repos/eclipse-jkube-demo-project : $
Kedu ihe ọzọ ị nwere ike ime na Eclipse JKube
Ya mere, anyị lere anya na isi ihe mgbaru ọsọ Eclipse JKube na Kubernetes Maven Plugin, nke na-eme ka mmepe nke ngwa Java maka ikpo okwu Kubernetes. Ọ bụrụ na ịchọghị itinye ọrụ ndị a mgbe niile site na keyboard, ị nwere ike dee ha na nhazi ngwa mgbakwunye, dịka ọmụmaatụ, dị ka nke a:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>resource</goal>
<goal>apply</goal>
</goals>
</execution>
</executions>
</plugin>
Ekwesịrị ikwu na n'isiokwu a, anyị atụlebeghị ọrụ ebumnuche niile dị na Eclipse JKube na Kubernetes Maven Plugin, yabụ anyị na-enye na Tebụl 2 ndepụta nke ọrụ ndị ọzọ nwekwara ike ịbara gị uru.
Tebụl 2. Mgbakwunye Eclipse JKube mgbaru ọsọ aga-eme.
Ebumnuche
Nkeji
Nkowasi
KWESỊRỊTA
Ịnata ndekọ sitere na ngwa na-agba ọsọ na Kubernetes.
ngwugwu
Mepee ọdụ ụgbọ mmiri debug ka ị nwee ike ihichapụ ngwa gị na-agba ọsọ na Kubernetes ozugbo site na IDE.
Iwunye
Ịmepụta ndụdụ maka ọrụ Wụnye na itinye ihe a na-emepụta na-egosi na ụyọkọ Kubernetes n'otu ụzọ ahụ dị ka ọrụ ntinye.
ngwugwu
Nbunye ngwa na-ekpo ọkụ na-akpaghị aka site na nsuso oghere aha ya.
Na-ebuga ngwa Java na Red Hat OpenShift Iji OpenShift Maven Plugin
Iji tinye ngwa site na ihe atụ anyị na ikpo okwu Red Hat OpenShift, anyị na-eji ngwa mgbakwunye
~/work/repos/eclipse-jkube-demo-project : $ mvn oc:build oc:resource oc:apply
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< meetup:random-generator >-----------------------
[INFO] Building random-generator 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- openshift-maven-plugin:1.0.0-rc-1:build (default-cli) @ random-generator ---
[INFO] oc: Using OpenShift build with strategy S2I
[INFO] oc: Running in OpenShift mode
[INFO] oc: Running generator spring-boot
[INFO] oc: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.7 as base / builder
[INFO] oc: [random-generator:0.0.1] "spring-boot": Created docker source tar /home/rohaan/work/repos/eclipse-jkube-demo-project/target/docker/random-generator/0.0.1/tmp/docker-build.tar
[INFO] oc: Adding to Secret pullsecret-jkube
[INFO] oc: Using Secret pullsecret-jkube
[INFO] oc: Creating BuildServiceConfig random-generator-s2i for Source build
[INFO] oc: Creating ImageStream random-generator
[INFO] oc: Starting Build random-generator-s2i
[INFO] oc: Waiting for build random-generator-s2i-1 to complete...
[INFO] oc: Caching blobs under "/var/cache/blobs".
[INFO] oc: Getting image source signatures
[INFO] oc: Copying blob sha256:cf0f3ebe9f536c782ab3835049cfbd9a663761ded9370791ef6ea3965c823aad
[INFO] oc: Copying blob sha256:57de4da701b511cba33bbdc424757f7f3b408bea741ca714ace265da9b59191a
[INFO] oc: Copying blob sha256:f320f94d91a064281f5127d5f49954b481062c7d56cce3b09910e471cf849050
[INFO] oc: Copying config sha256:52d6788fcfdd39595264d34a3959464a5dabc1d4ef0ae188802b20fc2d6a857b
[INFO] oc: Writing manifest to image destination
[INFO] oc: Storing signatures
[INFO] oc: Generating dockerfile with builder image quay.io/jkube/jkube-java-binary-s2i:0.0.7
[INFO] oc: STEP 1: FROM quay.io/jkube/jkube-java-binary-s2i:0.0.7
[INFO] oc: STEP 2: LABEL "io.openshift.build.source-location"="/tmp/build/inputs" "io.openshift.build.image"="quay.io/jkube/jkube-java-binary-s2i:0.0.7"
[INFO] oc: STEP 3: ENV JAVA_APP_DIR="/deployments" OPENSHIFT_BUILD_NAME="random-generator-s2i-1" OPENSHIFT_BUILD_NAMESPACE="default"
[INFO] oc: STEP 4: USER root
[INFO] oc: STEP 5: COPY upload/src /tmp/src
[INFO] oc: STEP 6: RUN chown -R 1000:0 /tmp/src
[INFO] oc: STEP 7: USER 1000
[INFO] oc: STEP 8: RUN /usr/local/s2i/assemble
[INFO] oc: INFO S2I source build with plain binaries detected
[INFO] oc: INFO S2I binary build from fabric8-maven-plugin detected
[INFO] oc: INFO Copying binaries from /tmp/src/deployments to /deployments ...
[INFO] oc: random-generator-0.0.1.jar
[INFO] oc: INFO Copying deployments from deployments to /deployments...
[INFO] oc: '/tmp/src/deployments/random-generator-0.0.1.jar' -> '/deployments/random-generator-0.0.1.jar'
[INFO] oc: STEP 9: CMD /usr/local/s2i/run
[INFO] oc: STEP 10: COMMIT temp.builder.openshift.io/default/random-generator-s2i-1:48795e41
[INFO] oc: time="2020-08-10T06:37:49Z" level=info msg="Image operating system mismatch: image uses "", expecting "linux""
[INFO] oc: time="2020-08-10T06:37:49Z" level=info msg="Image architecture mismatch: image uses "", expecting "amd64""
[INFO] oc: Getting image source signatures
[INFO] oc: Copying blob sha256:d8e1f35641acb80b562f70cf49911341dfbe8c86f4d522b18efbf3732aa74223
[INFO] oc: Copying blob sha256:b6f081e4b2b6de8be4b1dec132043d14c121e968384dd624fb69c2c07b482edb
[INFO] oc: Copying blob sha256:b7139ad07aa8ce4ed5a132f7c5cc9f1de0f5099b5e155027a23d57f7fbe78b16
[INFO] oc: Copying blob sha256:98972fc90a1108315cc5b05b2c691a0849a149727a7b81e76bc847ac2c6d9714
[INFO] oc: Copying config sha256:27aaadaf28e24856a66db962b88118b8222b61d79163dceeeed869f7289bc230
[INFO] oc: Writing manifest to image destination
[INFO] oc: Storing signatures
[INFO] oc: --> 27aaadaf28e
[INFO] oc: 27aaadaf28e24856a66db962b88118b8222b61d79163dceeeed869f7289bc230
[INFO] oc: Getting image source signatures
[INFO] oc:
[INFO] oc: Pushing image image-registry.openshift-image-registry.svc:5000/default/random-generator:0.0.1 ...
[INFO] oc: Copying blob sha256:f320f94d91a064281f5127d5f49954b481062c7d56cce3b09910e471cf849050
[INFO] oc: Copying blob sha256:cf0f3ebe9f536c782ab3835049cfbd9a663761ded9370791ef6ea3965c823aad
[INFO] oc: Copying blob sha256:57de4da701b511cba33bbdc424757f7f3b408bea741ca714ace265da9b59191a
[INFO] oc: Copying blob sha256:98972fc90a1108315cc5b05b2c691a0849a149727a7b81e76bc847ac2c6d9714
[INFO] oc: Copying config sha256:27aaadaf28e24856a66db962b88118b8222b61d79163dceeeed869f7289bc230
[INFO] oc: Writing manifest to image destination
[INFO] oc: Storing signatures
[INFO] oc: Successfully pushed image-registry.openshift-image-registry.svc:5000/default/random-generator@sha256:aa9e1a380c04ef9174ba56459c13d44420ebe653ebf32884d60fe4306b17306d
[INFO] oc: Push successful
[INFO] oc: Build random-generator-s2i-1 in status Complete
[INFO] oc: Found tag on ImageStream random-generator tag: sha256:aa9e1a380c04ef9174ba56459c13d44420ebe653ebf32884d60fe4306b17306d
[INFO] oc: ImageStream random-generator written to /home/rohaan/work/repos/eclipse-jkube-demo-project/target/random-generator-is.yml
[INFO]
[INFO] --- openshift-maven-plugin:1.0.0-rc-1:resource (default-cli) @ random-generator ---
[INFO] oc: Using docker image name of namespace: default
[INFO] oc: Running generator spring-boot
[INFO] oc: spring-boot: Using Docker image quay.io/jkube/jkube-java-binary-s2i:0.0.7 as base / builder
[INFO] oc: jkube-controller: Adding a default DeploymentConfig
[INFO] oc: jkube-service: Adding a default service 'random-generator' with ports [8080]
[INFO] oc: jkube-healthcheck-spring-boot: Adding readiness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 10 seconds
[INFO] oc: jkube-healthcheck-spring-boot: Adding liveness probe on port 8080, path='/actuator/health', scheme='HTTP', with initial delay 180 seconds
[INFO] oc: jkube-revision-history: Adding revision history limit to 2
[INFO]
[INFO] --- openshift-maven-plugin:1.0.0-rc-1:apply (default-cli) @ random-generator ---
[INFO] oc: Using OpenShift at https://api.crc.testing:6443/ in namespace default with manifest /home/rohaan/work/repos/eclipse-jkube-demo-project/target/classes/META-INF/jkube/openshift.yml
[INFO] oc: OpenShift platform detected
[INFO] oc: Using project: default
[INFO] oc: Creating a Service from openshift.yml namespace default name random-generator
[INFO] oc: Created Service: target/jkube/applyJson/default/service-random-generator.json
[INFO] oc: Creating a DeploymentConfig from openshift.yml namespace default name random-generator
[INFO] oc: Created DeploymentConfig: target/jkube/applyJson/default/deploymentconfig-random-generator.json
[INFO] oc: Creating Route default:random-generator host: null
[INFO] oc: HINT: Use the command `oc get pods -w` to watch your pods start up
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:07 min
[INFO] Finished at: 2020-08-10T12:08:00+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $ oc get pods -w
NAME READY STATUS RESTARTS AGE
random-generator-1-deploy 1/1 Running 0 14s
random-generator-1-vnrm9 0/1 Running 0 11s
random-generator-s2i-1-build 0/1 Completed 0 1m
random-generator-1-vnrm9 1/1 Running 0 24s
random-generator-1-deploy 0/1 Completed 0 28s
~/work/repos/eclipse-jkube-demo-project : $ oc get routes
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
random-generator random-generator-default.apps-crc.testing random-generator 8080 None
~/work/repos/eclipse-jkube-demo-project : $ curl random-generator-default.apps-crc.testing/random
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45 0 45 0 0 1666 0 --:--:-- --:--:-- --:--:-- 1730
{
"id": "d80052d9-2f92-43cb-b9eb-d7cffb879798"
}
~/work/repos/eclipse-jkube-demo-project : $
Ihe nkuzi vidiyo
Iji mụtakwuo maka otu esi eme ka mmepe Kubernetes dị mfe na Eclipse JKube, lelee nkuzi vidiyo a maka otu esi etinye ngwa ngwa Boot Spring dị mfe na Minikube:
nkwubi
N'isiokwu a, anyị gosiri otú Eclipse JKube si eme ka ndụ dị mfe maka onye mmepụta Java mgbe ya na Kubernetes na-arụ ọrụ. Enwere ike ịchọta ozi ndị ọzọ na Eclipse JKube na
isi: www.habr.com