Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPENJDK-2992] Spec for deployment and route object #500

Open
wants to merge 3 commits into
base: jlink-dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions templates/jlink/jlinked-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,44 @@ objects:
from:
kind: ImageStreamTag
name: ubimicro:latest # ImageStreamTag for registry.access.redhat.com/ubi9/ubi-micro
##############################################################################
# Deployment and Route object specs
- apiVersion: apps/v1
kind: Deployment
metadata:
name: jlinked-app
spec:
replicas: 1
selector:
matchLabels:
app: jlinked-app
template:
metadata:
labels:
app: jlinked-app
spec:
containers:
- name: jlinked-app-container
image: lightweight-image:latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be an issue. Comparing this to a manually-created Deployment, the working one has, instead,

- image: image-registry.openshift-image-registry.svc:5000/jlink2/lightweight-image@sha256:19538848d2f06ee00d7462f8290982191fe9acb63c6ecea026d8df484e840ecc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but that's also specific to my OpenShift cluster. I'm not sure what to put in a template. re-reading https://docs.openshift.com/container-platform/4.15/openshift_images/using-templates.html, the example they have of a template with a Deployment in it does not name the image at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I referred this template : https://docs.openshift.com/container-platform/4.15/applications/deployments/what-deployments-are.html#deployments-kube-deployments_what-deployments-are
DeploymentConfig is marked as deprecated and they recommend to use Deployment object.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't noticed the discrepancy between Deployment and DeploymentConfig. Hmm. I see (from that example) that DeploymentConfig supports specifying an ImageStreamTag. It doesn't look like Deployment does (which makes sense, since Deployment comes from Kubernetes but ImageStreams are an OpenShift addition). So I'm not really sure how we would specify the image to use for the Deployment in a safe/generic way.

Even though DCs are deprecated, I think I'd be happy to merge a PR which used them if it worked today!

imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
- apiVersion: v1
kind: Service
metadata:
name: jlinked-app-service
spec:
selector:
app: jlinked-app
ports:
- protocol: TCP
port: 80
targetPort: 8080
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: jlinked-app-route
spec:
to:
kind: Service
name: jlinked-app-service
Loading