Skip to content

Commit

Permalink
Split the wildfly and deployment image and use initContainer to deplo…
Browse files Browse the repository at this point in the history
…y the ws deployment
  • Loading branch information
jimma committed Sep 8, 2023
1 parent c2a962c commit 4e0a7c7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
45 changes: 44 additions & 1 deletion modules/testsuite/cloud-tests/k8s/pom.xml
Expand Up @@ -184,7 +184,7 @@
<build>true</build>
<push>true</push>
<docker-binary>docker</docker-binary>
<name>${project.artifactId}</name>
<name>wildfly-without-deployment</name>
<tag>latest</tag>
<registry>localhost:5000</registry>
</image>
Expand All @@ -198,6 +198,48 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<executions>
<execution>
<id>build-deployment-image</id>
<phase>pre-integration-test</phase>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
<configuration>
<images>
<image>
<name>localhost:5000/jbossws-deployment:latest</name>
<build>
<from>busybox</from>
<assembly>
<mode>dir</mode>
<targetDir>/opt/app/deployment</targetDir>
<inline>
<formats>
<format>dir</format>
</formats>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.war</include>
</includes>
</fileSet>
</fileSets>
</inline>
</assembly>
</build>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down Expand Up @@ -262,6 +304,7 @@
<testTarget>11</testTarget>
</configuration>
</plugin>

</plugins>
</build>
</project>
Expand Up @@ -15,9 +15,12 @@ spec:
labels:
app.kubernetes.io/name: jbossws-cxf-k8s-tests
spec:
volumes:
- name: deployments
emptyDir: { }
containers:
- name: jbossws-cxf-k8s-tests
image: localhost:5000/jbossws-cxf-k8s-tests:latest
- name: widlfly-container
image: localhost:5000/wildfly-without-deployment:latest
imagePullPolicy: Always
ports:
- containerPort: 9990
Expand All @@ -26,6 +29,13 @@ spec:
- containerPort: 8080
name: http
protocol: TCP
initContainers:
- name: init-container
image: localhost:5000/jbossws-deployment:latest
volumeMounts:
- name: deployments
mountPath: /deployment
command: [ "sh", "-c", "cp /opt/app/deployment/jbossws-cxf-k8s.war /deployment" ]
---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit 4e0a7c7

Please sign in to comment.