Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Enable generating endpoints with paths and exposing job ports. #2318

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

njhale
Copy link
Member

@njhale njhale commented Nov 3, 2023

Add a path field to container ports so that users can specify an
optional path to append to container's endpoint URL. The path field
supports interpolation which, for example, enables the use of runtime
generated tokens.

Additionally, deploy ServiceInstances and Ingresses for job ports. This
allows jobs to serve traffic and expose things like temporary web pages
for collecting user credentials.

e.g. Adding a port with an interpolated path to a job:

jobs: ahoy: {
	build: "."
	ports: publish: [
		{
			targetPort: 9000
			protocol:   "http"
			path:       "/ahoy?token=@{secrets.token-ahoy.token}"
		},
	]
}


secrets: {
	"token-ahoy": type: "token"
}

Will result in an app endpoint that stays active until the job completed (or the app is stopped)

NAME        IMAGE          COMMIT         CREATED    ENDPOINTS                                                                                                                 MESSAGE
cupule-j5   b831b259b470   ffaa36e7e2a2   32s ago    http://ahoy-job-cupule-j5-0ce4c978.local.oss-acorn.io/ahoy?token=bsgqt4bv75wm9sj85rldnv69m7bjsh6qrttqv9h8vw7w9g8nr6k7zt   (job: ahoy): job running
NAME        IMAGE          COMMIT         CREATED     ENDPOINTS   MESSAGE
cupule-j5   b831b259b470   ffaa36e7e2a2   2m50s ago               OK

Add a path field to container ports so that users can specify an
optional path to append to container's endpoint URL. The path field
supports interpolation which, for example, enables the use of runtime
generated tokens.

Signed-off-by: Nick Hale <[email protected]>
@njhale njhale changed the title wip: add path to port spec and endpoint status Enable generating endpoints with paths and exposing job ports. Nov 3, 2023
@njhale njhale marked this pull request as ready for review November 3, 2023 17:01
Deploy ServiceInstances and Ingresses for job ports. This
allows jobs to serve traffic and expose things like temporary web pages
for collecting user credentials.

Signed-off-by: Nick Hale <[email protected]>
Signed-off-by: Nick Hale <[email protected]>
Copy link
Contributor

@thedadams thedadams left a comment

Choose a reason for hiding this comment

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

Looks good. Great job!

@njhale njhale merged commit 1849371 into acorn-io:main Nov 4, 2023
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants