Deploying OpenLibertyApplication rewrites the /config/server.xml specified in the container image
<httpEndpoint id="defaultHttpEndpointss"
host="*"
httpPort="8080"
httpsPort="9443" />
<httpEndpoint id="defaultHttpEndpointssssssssss"
host="*"
httpPort="8080"
httpsPort="8083" />
apiVersion: openliberty.io/v1beta1
kind: OpenLibertyApplication
metadata:
name: vehicle
labels:
app: vehicle
name: vehicle
service: vehicle
version: v2
spec:
applicationImage: quay.io/xxxx/xxxxx:latest
createAppDefinition: false
version: v2
service:
port: 8080
portName: http
expose: true
server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<featureManager>
<feature>servlet-4.0</feature>
<feature>springBoot-2.0</feature>
</featureManager>
<httpEndpoint id="defaultHttpEndpointssssssssss"
host="*"
httpPort="8080"
httpsPort="8083" />
<springBootApplication id="vehicle"
location="thin-vehicle-0.0.1-SNAPSHOT.jar"
name="vehicle" />
</server>
/config/server.xml in the Openshift pod showing the correct updated port for httpEndpoint http: 8080, https: 8083
Instead, I'm seeing the old port values on the Pod /config/server.xml, http: 8080, https: 9443. Id remains the old value too: id="defaultHttpEndpointss"
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.7", GitCommit:"1dd5338295409edcfff11505e7bb246f0d325d15", GitTreeState:"clean", BuildDate:"2021-01-13T13:23:52Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.0+2817867", GitCommit:"2817867655bb7b68215b4e77873a8facf82bee06", GitTreeState:"clean", BuildDate:"2021-06-02T22:14:22Z", GoVersion:"go1.15.7", Compiler:"gc", Platform:"linux/amd64"}
Client Version: 4.7.0-202104250659.p0-95881af
Server Version: 4.7.16
Kubernetes Version: v1.20.0+2817867
The problem in this case was cached image with the latest
tag. If the application is created without specifying policy, it is set to pullPolicy: IfNotPresent
to optimize creating container. Since the OP first created image with incorrect settings, and then overwrite image with the same tag, OCP used cached version.
To ensure that you are using correct image either:
pullPolicy: Always
in your application definition