runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Nested Acorn's not publishing endpoints.

Open cloudnautique opened this issue 1 year ago • 4 comments

Given this Acornfile:

acorns: "echo-app": {
    image: "index.docker.io/cloudnautique/echo-app:services"
    links: ["service-redis.redis:redis"]
    secrets: ["service-redis.redis-password:redis-password"]
}

services: "service-redis": {
    build: {
        context: "./helm-chart"
        acornfile: "./helm-chart/Acornfile"
    }
}

When you run this, the ingress for the echo-app is created, but it is not shown as an endpoint for the app. Adding publishMode and publish fields on the acorn did not result in an published endpoint.

I would expect that the endpoint for the echo-app would be shown in the acorn app results.

cloudnautique avatar May 18 '23 23:05 cloudnautique

Part of this issue is related to Traefik needing to be updated to have allowExternalNameServices set to true in a k3s deployment. This populates the url when doing acorn apps. However, it doesn't show up on the root app's name and isn't shown to the user when running -i.

acorn apps
NAME                         IMAGE          HEALTHY   UP-TO-DATE   CREATED     ENDPOINTS                                                                          MESSAGE
snowy-violet                 6cb9daa9f2d4   1         1            3d15h ago                                                                                      OK
snowy-violet.echo-app        1aade30e370e   1         1            3d15h ago   http://app-snowy-violet-echo-app-eed924a4-73bcaa54.local.on-acorn.io => app:5000   OK
snowy-violet.service-redis   372329e728bd   0         0            3d15h ago

when running with -i:

INFO[16874] Updating app [snowy-violet] to image [6cb9daa9f2d48c6b594b2a246a7433f31fac639879c8ce62d3b199206c72e4c7] 
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] pending
┌───────────────────────────────────────────────┐
| STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] OK |
└───────────────────────────────────────────────┘
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] [acorns: service-redis: failed [failed to update existing owned object snowy-violet-service-redis-a75a9dd9-10e873ac-56a/helm-deploy batch/v1, Kind=Job for acorn-controller acorn/snowy-violet-service-redis-a75a9dd9, old subcontext [acorn-controller] gvk [internal.acorn.io/v1, Kind=AppInstance] namespace [acorn] name [snowy-violet-service-redis-a75a9dd9]: object is being deleted: jobs.batch "helm-deploy" already exists]]
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] [acorns: service-redis: failed [waiting: [redis-auth: job not complete], helm-deploy: running [helm-deploy ContainerCreating]]]
helm-deploy-2z74c.helm-deploy: helmchart.helm.cattle.io/redis unchanged
STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] [acorns: service-redis: failed [waiting: [redis-auth: job not complete], helm-deploy: running []]]
┌───────────────────────────────────────────────┐
| STATUS: ENDPOINTS[] HEALTHY[1] UPTODATE[1] OK |
└───────────────────────────────────────────────┘
app-67cfbdcfdd-cwglj: 10.42.0.211 - - [22/May/2023 15:19:24] "GET / HTTP/1.1" 200 -

cloudnautique avatar May 22 '23 16:05 cloudnautique

@cloudnautique

However, it doesn't show up on the root app's name and isn't shown to the user when running -i.

Is this actually expected? I would expect only endpoints published by containers to be shown under the root name, no? :thinking:

I could imagine showing the additional (nested acorns and services) endpoints to be shown in the status output though.

Example I used:

containers:  {
  "foo": {
    image: "nginx"
    ports: publish: "80/http" 
  },
  "bar": {
    image: "nginx"
    ports: publish: "80/http" 
  },
}

acorns: "echo-app": {
    image: "index.docker.io/cloudnautique/echo-app:services"
}

gives me

$ acorn run -n issue1623-4 .
# ... truncated ...
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| STATUS: ENDPOINTS[http://bar-issue1623-4-6c68d18e.local.oss-acorn.io => bar:80, http://foo-issue1623-4-362b5904.local.oss-acorn.io => foo:80] HEALTHY[2] UPTODATE[2] OK |
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| STATUS: ENDPOINTS[http://bar-issue1623-4-6c68d18e.local.oss-acorn.io => bar:80, http://foo-issue1623-4-362b5904.local.oss-acorn.io => foo:80] HEALTHY[2] UPTODATE[2] OK |
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

$ acorn apps  
NAME                   IMAGE          HEALTHY   UP-TO-DATE   CREATED     ENDPOINTS                                                                                                                    MESSAGE
issue1623-4            3a2746d8bcea   2         2            4m5s ago    http://bar-issue1623-4-6c68d18e.local.oss-acorn.io => bar:80, http://foo-issue1623-4-362b5904.local.oss-acorn.io => foo:80   OK
issue1623-4.echo-app   1aade30e370e   2         2            4m5s ago    http://app-issue1623-4-echo-app-379af356-cf1232d5.local.oss-acorn.io => app:5000  

iwilltry42 avatar May 31 '23 16:05 iwilltry42

Yes, I think this is behaving as expected. I will move out to v0.8 rather than close so that we can revisit intended behavior when @ibuildthecloud is around

cjellick avatar Jun 05 '23 16:06 cjellick

Yes, the container endpoints being part of the output is expected behavior.

In the event that you are using a deploy file, no containers, just acorns and services, you would not see the echo-app endpoint without doing acorn apps, which is annoying.

cloudnautique avatar Jun 05 '23 16:06 cloudnautique