Skip to content

add service linking for deploio apps#388

Merged
gajicdev merged 1 commit intomainfrom
app-env-inj
Apr 22, 2026
Merged

add service linking for deploio apps#388
gajicdev merged 1 commit intomainfrom
app-env-inj

Conversation

@gajicdev
Copy link
Copy Markdown
Contributor

@gajicdev gajicdev commented Apr 21, 2026

Related to #1591.

Summary

  • Add --service flag to nctl create application and nctl update application for linking On-Demand Services (KeyValueStore, MySQL, PostgreSQL) to Deploio apps with automatic credential injection
  • Add --delete-service flag to nctl update application for removing service references
  • Show linked services in nctl get application table output

Examples

Create an application with service references

$ nctl create application my-app \
    --git-url=https://github.com/example/app.git \
    --service cache=keyvaluestore/my-kvs \
    --service db=mysql/my-db

Add a service reference to an existing application

$ nctl update application my-app --service cache=keyvaluestore/prod-kvs

Remove a service reference

$ nctl update application my-app --delete-service cache

View linked services

$ nctl get application my-app

NAME      REPLICAS  WORKERJOBS  SCHEDULEDJOBS  SERVICES                                    HOSTS               UNVERIFIEDHOSTS
my-app    2         0           0              cache=keyvaluestore/my-kvs,db=mysql/my-db    my-app.deploio.app  none

Flag help

$ nctl create application --help
...
      --service=KEY=VALUE;...      Service reference in the form
                                   name=kind/target-name. Credentials will
                                   be automatically injected as environment
                                   variables.

$ nctl update application --help
...
      --service=KEY=VALUE;...      Service reference to add/update in the form
                                   name=kind/target-name.
      --delete-service=DELETE-SERVICE,...
                                   Service reference names to remove.

Test plan

  • Unit tests for ParseServiceTarget, ServicesFromMap, UpdateServices (internal/application/service_test.go)
  • Integration test: create application with --service flag (create/application_test.go)
  • Integration test: update application to add service (update/application_test.go)
  • Integration test: update application to delete service (update/application_test.go)
  • All existing tests continue to pass (go test ./...)
  • Manual: nctl create application with --service flag against a real cluster
  • Manual: nctl update application with --service and --delete-service against a real cluster
  • Manual: nctl get application shows SERVICES column

Comment thread create/application_test.go Outdated
Comment thread create/serviceconnection.go Outdated
Comment thread create/serviceconnection.go Outdated
Comment thread internal/application/service.go Outdated
Comment thread create/application.go Outdated
Comment thread create/serviceconnection.go Outdated
Comment thread update/application.go Outdated
Comment thread internal/application/service.go Outdated
Comment thread internal/application/service.go Outdated
Comment thread internal/application/service.go
Comment thread internal/application/service.go
Copy link
Copy Markdown
Contributor

@thirdeyenick thirdeyenick left a comment

Choose a reason for hiding this comment

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

👍

@gajicdev gajicdev merged commit 53c2a6e into main Apr 22, 2026
3 checks passed
@gajicdev gajicdev deleted the app-env-inj branch April 22, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants