Я из команды разработчиков Eclipse JKube / FMP. Я думаю, что вы должны иметь возможность переопределить имя контроллера по умолчанию, используя свойство jkube.enricher.jkube-controller.name
или предоставив XML конфигурацию для jkube-controller
(Enricher, который отвечает за плагин Deployment
по умолчанию), например:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.0.0-alpha-1</version>
<configuration>
<enricher>
<config>
<jkube-controller>
<name>some-deployment</name>
</jkube-controller>
</config>
</enricher>
</configuration>
</plugin>
Когда я попробовал это, я увидел, как имя Deployment
меняется в соответствии с нашей конфигурацией:
~/work/repos/eclipse-jkube-demo-project : $ mvn k8s:resource 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-alpha-1:resource (default-cli) @ random-generator ---
[INFO] k8s: Running generator spring-boot
[INFO] k8s: spring-boot: Using Docker image fabric8/java-centos-openjdk8-jdk:1.5 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] --- kubernetes-maven-plugin:1.0.0-alpha-1:apply (default-cli) @ random-generator ---
[INFO] k8s: Using Kubernetes at https://192.168.39.93: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 some-deployment
[INFO] k8s: Created Deployment: target/jkube/applyJson/default/deployment-some-deployment.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: 8.076 s
[INFO] Finished at: 2020-04-03T16:57:04+05:30
[INFO] ------------------------------------------------------------------------
~/work/repos/eclipse-jkube-demo-project : $ kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
some-deployment 0/1 1 0 8s
~/work/repos/eclipse-jkube-demo-project : $ kubectl get pods
NAME READY STATUS RESTARTS AGE
some-deployment-97495447b-z9p48 0/1 Running 0 15s