syntasso/kratix-marketplace

App as a service runs the container in the platform-worker

Closed this issue · 4 comments

Describe the bug

When running the app as a service promise, the todoer app runs in the platform cluster.

image

The PgSQL db does get deployed to the worker cluster.

image

To Reproduce
Steps to reproduce the behaviour:

  1. Install Kratix
  2. Set Kratix platform cluster as a destination (required for compound promises?)
  3. Install App-As-a-Service promise, and its dependencies.
  4. Send a Resource request

kubectl --context $PLATFORM apply -f https://raw.githubusercontent.com/syntasso/kratix-marketplace/main/app-as-a-service/resource-request.yaml

Expected behaviour
I'd expect the app for deployment to take place where the pgsql is so that the app can query the database.

Screenshots

Desktop (please complete the following information):

  • Kratix Version: latest
  • Promise (if applicable): App-as-a-service
  • Kubernetes Version: 1.27.3

Additional context
I think the problem is in the promise.yaml

https://github.com/syntasso/kratix-marketplace/blob/1f229245c2f9e0d3fcf9086b22efcd41488b0648/app-as-a-service/promise.yaml#L7C1-L10C28

This line here targets the platform, but from reading the docs I understand that it must be platform as the promises live on the platform cluster therefor needs to be there for execution of the chain.

Happy to contribute, and also learn more!

Hi @Phiph , thanks for opening the issue

You are correct that was the cause of one of the issues! I've updated the promise to take in the fix.

There was also one slight other issue under the hood that I noticed and have pushed a fix to the Docker image ghcr.io/syntasso/kratix-marketplace/app-as-a-service-configure-pipeline:v0.1.0. This repo consist of example promises, and as such the Docker images aren't versioned properly (we push over the tag repeatedly), because you've already ran a pod in kubernetes it already has the "old" version of the tag cached, and it won't pull down the "new" version of the tag by default. You can either recreate the cluster (slow!) or just run the following to manually update the docker image that is cached in the kind cluster:

docker pull ghcr.io/syntasso/kratix-marketplace/app-as-a-service-configure-pipeline:v0.1.0
kind load docker-image ghcr.io/syntasso/kratix-marketplace/app-as-a-service-configure-pipeline:v0.1.0 --name platform

Let me know how you get on and if you need any help.

@Phiph have you had a chance to test it?

Not quite, I've been using your changes as a reference for my new promise. I'll give it a go shortly though!

Yeah this worked fine! Thanks @aclevername