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

Added kubernetes artifacts #2640

Closed
wants to merge 4 commits into from
Closed

Conversation

MATRIX4284
Copy link

@MATRIX4284 MATRIX4284 commented Sep 30, 2021

What's in the PR

  • Kubernetes config file to run INCEpTION

How to test manually

kubectl create -f inception.yaml

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

@ukp-svc-jenkins
Copy link

Can one of the admins verify this patch?

@reckart
Copy link
Member

reckart commented Oct 2, 2021

Thanks for the PR :) Could you please fill in the description template so we have an idea what the PR actually is?

@MATRIX4284
Copy link
Author

Added kuberetes artifact for inception so that it can e run as cloud native

@MATRIX4284
Copy link
Author

MATRIX4284 commented Oct 2, 2021

Thanks for the PR :) Could you please fill in the description template so we have an idea what the PR actually is?

I provided the kubernetes artifact so that we can run inception on kubernetes .

@reckart
Copy link
Member

reckart commented Oct 5, 2021

Ok, nice. How can one use it?

@MATRIX4284
Copy link
Author

MATRIX4284 commented Oct 5, 2021 via email

@MATRIX4284
Copy link
Author

Ok, nice. How can one use it?

Hi ,

It is executed by this command below.

kubectl create -f inception.yaml

I am giving the manual as a part of next pr.

Please let me know about the decision to merge.

Thanks & Regards,
Kaustav

@reckart
Copy link
Member

reckart commented Oct 8, 2021

The PR looks very helpful indeed.

However, I cannot tell if the location where the PR places the file is a good one.

Is it something that should be used out of the box? Probably not because there seem to be lots of settings that a particular user would want to change for their particular deployment. So a new module (as in the PR) doesn't seem quite right to me.

So it may be more an example file like the docker-compose.yml? In that case it would probably go next to the docker-compose.yml in the admin documentation: inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/scripts/ - and then a short piece of text explaining what the file does and how one would use it would be very useful - some installation_kubernetes.adoc file in /inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide.

@reckart
Copy link
Member

reckart commented Oct 8, 2021

I have enabled Kubernetes on my Docker Desktop and tried the command that you said, but it doesn't seem to work:

% kubectl create -f inception.yaml
persistentvolume/inception-pv created
persistentvolumeclaim/inception-pvc created
service/inception-svc created
The Deployment "inception" is invalid: spec.template.spec.containers[0].volumeMounts[0].name: Not found: "mapr"

Corrwcted the volume name typo for which it was failing
@MATRIX4284
Copy link
Author

Corrected the typo in the volume name which was causing it to fail .

@MATRIX4284
Copy link
Author

I have enabled Kubernetes on my Docker Desktop and tried the command that you said, but it doesn't seem to work:

% kubectl create -f inception.yaml
persistentvolume/inception-pv created
persistentvolumeclaim/inception-pvc created
service/inception-svc created
The Deployment "inception" is invalid: spec.template.spec.containers[0].volumeMounts[0].name: Not found: "mapr"

Hi there was a typo in volume name I fixed that ..now it will run without errors

@reckart
Copy link
Member

reckart commented Oct 12, 2021

I still have not managed to actually start it. While the required things now all seem to be configured ok, the docker image does not start on my M1 Mac - interestingly I get further than if I try running the same image via docker run. I'm looking into doing a multi-platform image and then need to have another look at the kubernetes file. Looks like there is no database? How would one inject a custom settings.properties with kubernetes?

@MATRIX4284
Copy link
Author

MATRIX4284 commented Oct 12, 2021 via email

@reckart
Copy link
Member

reckart commented Oct 12, 2021

Yes, as I said, I am looking into setting up a multi-platform image using docker buildx. Actually, I have meanwhile already managed to build an M1 compatible image. Next I need to look into how the multi-image setup can be pushed as part of the Maven build. Normally, I am using a Maven plugin to do that and that picks up the dockerhub credentials from my machine. When I try the same thing using docker buildx, it currently fails because of missing credentials. Baby steps...

@reckart
Copy link
Member

reckart commented Oct 12, 2021

Ok, so have a multi-platform image now -> #2651

I have managed to start INCEpTION using kubectl but I was unable to access port 8080 despite the YAML listing that port as exposed. docker ps also shows no accessible ports:

% docker ps
CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS          PORTS     NAMES
8be0756cb2df   inceptionproject/inception-snapshots   "/bin/sh -c 'java ${…"   22 seconds ago   Up 21 seconds             k8s_inception_inception-5c7dd56bc-9qqj2_default_fb030190-fddf-41f1-aa9e-b78cd2ba8ebf_0

Also, every once in a while when I start, the start fails:

% kubectl describe pods
...
Events:
  Type     Reason            Age              From               Message
  ----     ------            ----             ----               -------
  Warning  FailedScheduling  5s (x2 over 6s)  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

It seems that I always need to run kubectl delete -f ...; kubectl create -f ... twice until the whole thing starts up again.

@MATRIX4284
Copy link
Author

MATRIX4284 commented Oct 13, 2021 via email

@reckart
Copy link
Member

reckart commented Oct 13, 2021

@MATRIX4284 IMHO the question why the port doesn't seem accessible would be more interesting to look at. The volume seems a bit flaky but at least it also works from time to time. Do you have any idea regarding the port?

@MATRIX4284
Copy link
Author

MATRIX4284 commented Oct 13, 2021 via email

@blochs
Copy link

blochs commented Dec 13, 2021

You may want to look into an init container and mounting the volume for the config's required to get this to run in Kubernetes. In addition, having an Ingress config in the code might be helpful as well.

@reckart reckart marked this pull request as draft June 1, 2022 20:19
@reckart
Copy link
Member

reckart commented Nov 21, 2023

Trying this again now using Docker Desktop 4.25.1 (128006) and its built-in Kubernetes v1.28.2 - and ... it actually launches! 🚀

@reckart
Copy link
Member

reckart commented Nov 27, 2023

Superseded by #4325

@reckart reckart closed this Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants