Repository navigation
Releases
v1.23.0
Changelog
Resetting Credentials
--reset-credentials now works for databases. It generates new credentials and waits until they are applied:
nctl update postgresdatabase mydb --reset-credentials
This works for mysql, postgres, mysqldatabase, postgresdatabase, keyvaluestore, opensearch and bucketuser.
nctl update bucketuser --reset-credentials now asks for confirmation like the other resources. Pass --force to skip it.
Retrieving Credentials
After creating a resource or resetting its credentials, nctl shows the command to retrieve them, for example:
nctl get postgresdatabase mydb --project myproject --print-connection-string
Dependencies
- Go 1.26.11
go.opentelemetry.io/otel/*1.47.0
v1.22.0
Changelog
⚠️ Behavior Changes
- Credentials are stored in the keyring of the operating system. See Credentials in the Keyring.
- The kubeconfig no longer contains the API client secret of an APIServiceAccount login. Kubeconfigs written by earlier versions keep working.
nctl get grafanashows more columns. The table now includesLOCATIONandHIGH AVAILABILITY. Scripts parsing the table by column position need to be adjusted, or use-o yaml/-o json.nctl auth logoutreports a failed logout request. It used to ignore errors of the OIDC logout endpoint.
Credentials in the Keyring
nctl auth login stores the OIDC tokens and the client secrets of APIServiceAccounts in the keyring of the operating system (Keychain on macOS, Secret Service on Linux, Credential Manager on Windows) instead of plain text files.
Where no keyring is available, such as on headless servers or in CI, nctl falls back to files only the user can read and prints a warning. To use files without the warning, pass --insecure-storage:
nctl auth login --api-client-id=... --api-client-secret=... --organization=... --insecure-storageExisting logins survive the upgrade. If your kubeconfig still contains a client secret from an earlier version, nctl shows the command to move it into the keyring:
nctl auth login --api-client-id=<id> --api-client-secret=<secret> --organization=<org>NCTL_API_CLIENT_SECRET and --api-client-secret still take precedence over the stored secret.
Build Type of Applications
nctl create application and nctl update application gained a --build-type flag, which selects how an application is built: dockerfile, heroku or paketo.
nctl update application my-app --build-type=dockerfileApplications can now be switched between Dockerfile and buildpack builds. Changing the build type triggers a new build, and the current release stays active until the new build succeeds.
--dockerfile (create) and --buildpack-stack (create and update) keep working but are deprecated in favour of --build-type.
Backup Time and Retention of Databases
mysqldatabase and postgresdatabase gained --backup-daily-time and --backup-ttl on create and update:
nctl update postgresdatabase my-db --backup-daily-time=01:30 --backup-ttl=168h--backup-daily-timesets the time of day (HH:MM, Europe/Zurich) of the daily backup. Without it, a time between 02:00 and 03:59 is chosen.--backup-ttlsets how long scheduled backups are kept, between24hand720h. On update,0resets it to the default.
Grafana Location and High Availability
nctl create grafana gained --location and --high-availability:
nctl create grafana my-grafana --high-availabilityHigh availability runs Grafana with multiple replicas, so it stays available during maintenance and node failures. It cannot be changed after creation.
deplo.io Events in Application Logs
The deplo.io events of an application are now part of its logs. To show only the events:
nctl logs application my-app -t eventFixes
- Repeating
--delete-envor--delete-build-envonnctl update applicationnow deletes all the given variables instead of only the last one. - Application logs show the scheduled job label instead of the deploy job label twice.
Go API
For users of the github.com/ninech/nctl/api package: api.New keeps secrets in api.KeyringCredentials by default, and api.WithCredentials replaces them. StaticToken no longer takes a context, and GetTokenFromConfig and GetTokenFromExecConfig take the credentials to read the secrets from.
Commits
- f2a4679 Merge pull request #491 from ninech/handle-repeated-flag
- d358dd8 Merge pull request #495 from ninech/events-log
- 366b515 Merge pull request #496 from ninech/dirk/add_time_ttl
- 243d5f3 Merge pull request #497 from ninech/allow-dockerfile-switch
- 324121b Merge pull request #498 from ninech/build-type-flag
- b570507 Merge pull request #499 from ninech/grafana-location-ha
- 67c6acc build(deps): bump crate-ci/typos from 1.50.3 to 1.51.1
- fba275d build(deps): bump github.com/grafana/loki/v3 from 3.7.6 to 3.7.9
- 8a4239f build(deps): bump github.com/int128/kubelogin from 1.36.3 to 1.36.4
- 333d037 build(deps): bump k8s.io/client-go from 0.37.1 to 0.37.2
- 9a75ec6 feat(application): add --build-type flag
- e45aa3d feat(auth): store credentials in the keyring of the operating system
- bb45fb6 feat(databases): add BackupDailyTime & BackupTTL
- 291d71e feat(grafana): add location and high availability
- 03eda9a feat(logs): show the deplo.io events of applications
- 272d266 feat(update): allow switching applications between dockerfile and buildpack builds
- 718b192 fix(logs): show the scheduled job label in application logs
- 50a2798 fix(update): accumulate repeated --delete-env and --delete-build-env flags
- 830b26b refactor(grafana): rely on the API default of the location
- 562301d test(get): synchronize the watch test with the watch
v1.21.0
Changelog
⚠️ Behavior Changes
Some changes in this release can affect scripts using nctl:
- Diagnostics and errors go to stderr. Warnings, spinners, confirmation prompts and errors are now written to stderr instead of stdout. They no longer corrupt the output of a command, such as
nctl get all -o json, and prompts still show when stdout is redirected. Scripts reading warnings or errors from stdout need to read stderr instead. Usage output on parse errors stays on stdout. - Failures exit with a non-zero exit code. Some errors, such as a blocked public IP in
nctl exec, exited with0. They now exit with an error code. Empty results ofnctl getstill exit with0. - Changed connection strings.
--print-connection-stringnow includes the port explicitly and URL-encodes the credentials. PostgreSQL connection strings use thepostgresql://scheme. See Unified Print Flags for Services. --filenameis required.nctl apply,nctl createandnctl deletewith a manifest report a missing-f/--filenameas a usage error (exit code80) before running.--servicetakes one service per flag. Repeat the flag to pass more than one service reference tonctl create applicationandnctl update application.
Reset Credentials of Databases and Key Value Stores
nctl update gained a --reset-credentials flag for mysql, mysqldatabase, postgres, postgresdatabase, keyvaluestore and opensearch. It generates new credentials and waits until the resource is available with them again:
nctl update postgresdatabase my-db --reset-credentialsClients using the current credentials lose access, so nctl asks for confirmation first. Pass --force to skip it. Declining cancels the whole update.
Databases and key value stores usually get their new credentials within seconds, while instances can take a few minutes.
Unified Print Flags for Services
All on-demand services now offer the same print flags: --print-user, --print-password, --print-connection-string and --print-ca-cert.
keyvaluestoregained--print-userand--print-connection-string(rediss://).--print-passwordreplaces--print-token, which keeps working but is hidden.opensearchgained--print-connection-string.
The printed connection strings now match the DSNs injected into deplo.io applications by service connections:
nctl get postgresdatabase my-db --print-connection-string
postgresql://user:password@my-db.example.com:5432/my-db?sslmode=requireIf the service is not ready yet, nctl returns an error instead of a malformed connection string.
Time Zones for Scheduled Jobs
Scheduled jobs of applications can now run in a time zone other than UTC:
nctl create application my-app --scheduled-job-name=report \
--scheduled-job-command="bundle exec rake report" \
--scheduled-job-schedule="0 8 * * *" \
--scheduled-job-time-zone=Europe/Zurichnctl update application accepts --scheduled-job-time-zone as well.
Shell Completion for API Fields
Shell completion now suggests the values of API fields, such as locations, machine types and versions of storage services, and the help of these flags lists their available values.
nctl get all With Project Scoped Service Accounts
nctl get all no longer needs access to the organization when listing a single project, so it works with API service accounts scoped to a project. --all-projects still requires access to the organization.
Other Fixes
- Multiple
--serviceflags with the same name but different kinds no longer overwrite each other onnctl update application. nctl update applicationhandles scheduled job fields correctly.- The spinner shows again while
nctltests access to the git repository of an application. - The help of
nctl update mysql --sql-modeno longer shows a default, as omitting the flag keeps the current modes. - Shell completion handles flags more reliably.
nctl get build --pull-imageuses the current Docker client libraries, resolving govulncheck alerts.
v1.20.0
Changelog
New Database Defaults and Versions
Following the new EOL lifecycle for business databases:
| Setting | Before | Now |
|---|---|---|
| Default Location | nine-cz41 |
nine-cz42 |
| Default Version MySQL | 8 |
8.4 |
| Selectable Versions MySQL | 8 |
8.4 |
| Default Version PostgreSQL | 17 |
18 |
| Selectable Versions Postgres | 17, 16, 15 |
18, 17 |
nctl create mysql gained a --mysql-version flag, matching the existing --postgres-version:
nctl create mysql my-db --mysql-version=8.4Automatic Location Fallback for Databases
When a MySQL or PostgreSQL instance is created without --location, and the default location does not currently accept new resources, nctl now retries in one of the locations the API reports as available instead of failing:
nctl create mysql my-db
⚠ the default location does not currently accept new MySQL resources, creating in "nine-es34" instead. The location cannot be changed later, pass --location to choose a different one.The fallback is only used when no location was requested explicitly. If --location is set, the error is returned as before.
TLS in Printed MySQL Connection Strings
Connection strings printed for MySQL instances and databases now carry ssl-mode=REQUIRED, matching what PostgreSQL already did with sslmode=require.
nctl get mysqldatabase my-db --print-connection-string
mysql://user:password@my-db.example.com/my-db?ssl-mode=REQUIREDLocations in nctl get all
nctl get all now shows a LOCATION column, listing the location of every resource that has one, and <none> for the ones that don't:
nctl get all
PROJECT NAME KIND GROUP LOCATION
dev banana Application apps.nine.ch <none>
prod orange KubernetesCluster infrastructure.nine.ch nine-cz42
Empty Lists With -o yaml
nctl get ... -o yaml now prints an empty list when nothing is found, the same as -o json already did.
What's Changed
- feat(create): retry in another location by @9marco in #443
- fix: return empty list for -o yaml when nothing is found by @SaadAssaf in #444
- build(deps): update github.com/ninech/apis by @9marco in #437
- chore: update dependencies and specifically the ninech/apis package by @shieldwed in #446
Full Changelog: v1.19.0...v1.20.0
v1.19.0
Changelog
Debian 13 (trixie) for CloudVMs
CloudVMs can now be created with Debian 13:
nctl create cloudvm my-vm --os=debian13SSH Key Flags
The SSH public key flags of the CloudVM and database commands now share the same
spelling, --ssh-keys and --ssh-keys-from-files:
| Command | Before | Now |
|---|---|---|
create cloudvm |
--public-keys--public-keys-from-files |
--ssh-keys--ssh-keys-from-files |
update cloudvm |
--rescue-public-keys--rescue-public-keys-from-files |
--rescue-ssh-keys--rescue-ssh-keys-from-files |
create/update mysql, postgres |
--ssh-keys--ssh-keys-file |
--ssh-keys--ssh-keys-from-files |
The old flag names keep working but are hidden from the help output and print a
deprecation warning.
Alongside the rename:
- Keys from flags and from files can be combined, they are no longer mutually exclusive.
Repeat either flag to pass more than one key or file. - Keys are validated to be in SSH format as defined in RFC4253 before the resource is sent to the API,
instead of failing later on. - Rescue keys can be cleared by passing an empty value:
nctl update cloudvm my-vm --rescue-ssh-keys=""
Updates Without Changes
nctl update no longer exits with an error when the resource is already in the requested state,
it reports that no changes were made and exits with 0:
nctl update cloudvm --on cloudvm-veeZoop4
ℹ no changes made to CloudVirtualMachine "cloudvm-veeZoop4"What's Changed
- feat(cloudvm): add support for Debian 13, codenamed trixie by @thde in #438
- fix(update): do not error for unchanged resources by @thde in #440
- fix(update): do not try to guess if flags were provided by @thde in #442
- build(deps): bump actions/setup-go from 6 to 7 by @dependabot[bot] in #431
- build(deps): bump github.com/alecthomas/kong from 1.14.0 to 1.16.0 by @dependabot[bot] in #433
- build(deps): bump github.com/crossplane/crossplane-runtime from 1.20.0 to 1.20.10 by @dependabot[bot] in #434
- build(deps): bump github.com/prometheus/common from 0.67.5 to 0.70.1 by @dependabot[bot] in #432
- build(deps): update dependencies by @thde in #436
- build(deps): bump github.com/grafana/loki/v3 from 3.6.5 to 3.7.4 by @dependabot[bot] in #435
Full Changelog: v1.18.2...v1.19.0
v1.18.2
Changelog
This release contains various fixes for nctl.
What's Changed
- fix: return non-zero exit code if project is not found by @rnestler in #417
- detect no-op updates and return error instead of silent success by @SaadAssaf in #418
- update brew instructions by @thirdeyenick in #419
- fix: pass existing git auth secret to validator before constructing it by @thirdeyenick in #420
- build(deps): bump crate-ci/typos from 1.47.0 to 1.48.0 by @dependabot[bot] in #421
- build(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in #422
- build(deps): bump github.com/int128/kubelogin from 1.36.1 to 1.36.2 by @dependabot[bot] in #424
- build(deps): bump k8s.io/client-go from 0.36.1 to 0.36.2 by @dependabot[bot] in #426
- fix: reject -f flag combined with a resource kind on create by @SaadAssaf in #430
Full Changelog: v1.18.1...v1.18.2
v1.18.1
Changelog
This release contains various fixes for nctl.
What's Changed
- enable docker client auto-negotiation by @thirdeyenick in #415
- fix:
nctllogin suggestion text by @thirdeyenick in #401 - fix: skip authentication for non-interactive commands by @thde in #402
- fix(exec): avoid panic when redirecting application exec output by @thde in #404
- fix(update): support unpausing applications with --no-pause by @thirdeyenick in #405
- change the help text for default buildpack stack by @thirdeyenick in #406
- fix(application): set default replicas on create, allow unsetting on update by @thirdeyenick in #407
- build(deps): bump crate-ci/typos from 1.46.0 to 1.47.0 by @dependabot[bot] in #409
- build(deps): bump k8s.io/client-go from 0.36.0 to 0.36.1 by @dependabot[bot] in #410
- build(deps): bump k8s.io/kubectl from 0.36.0 to 0.36.1 by @dependabot[bot] in #411
Full Changelog: v1.18.0...v1.18.1
v1.18.0
Changelog
nctl exec for On-Demand Services
Adds nctl exec sub-commands for connecting directly to on-demand services: PostgreSQL instances and databases, MySQL instances and databases, and KeyValueStore. Using their native CLI clients.
❯ nctl exec postgresdatabase test
psql (18.3, server 17.9 (Ubuntu 17.9-1.pgdg24.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
Type "help" for help.
05571f2_e4416af=>
The following commands have been added:
nctl exec postgres <name>connects to a Postgres instance viapsqlnctl exec postgresdatabase <name>connects to a PostgresDatabase viapsqlnctl exec mysql <name>connects to a MySQL instance viamysqlnctl exec mysqldatabase <name>connects to a MySQLDatabase viamysqlnctl exec keyvaluestore <name>connects to a KeyValueStore viaredis-cli
Access Management
For instance-level resources (Postgres, MySQL, KeyValueStore), the command detects the caller's public IP via ip.nine.ch, checks whether it is already in the allowed CIDR list, and if not prompts the user for confirmation before adding it.
The resource is then patched and connectivity is awaited before launching the CLI.
Import from stdin
The command also supports importing using stdin like so:
mysqldump -h source.example.com -u user -ppass mydb | nctl exec mysqldatabase mydb
pg_dump -h source.example.com -U user mydb | nctl exec postgresdatabase mydbFollowing Logs
Previously, following logs for older apps could fail or be very slow. With the default 30-day window, apps with a lot of logs could force Loki to establish a live tail over a large historical range. This puts pressure on queriers and query frontends.
Now, we first fetch the requested backlog with the range query API, then start the WebSocket tail from the end of that range.
What's Changed
- feat(exec): add exec support for on-demand services by @thde in #369
- feat: avoid historical Loki live-tail queries by @pawelkuc in #397
- fix: use maps instead of golang.org/x/exp/maps by @SaadAssaf in #399
- build(deps): bump github.com/int128/kubelogin from 1.36.0 to 1.36.1 by @dependabot[bot] in #394
- build(deps): bump github.com/mattn/go-isatty from 0.0.20 to 0.0.22 by @dependabot[bot] in #393
- build(deps): bump crate-ci/typos from 1.45.0 to 1.46.0 by @dependabot[bot] in #391
- build(deps): bump k8s.io/kubectl from 0.35.2 to 0.36.0 by @dependabot[bot] in #395
Full Changelog: v1.17.1...v1.18.0
v1.17.1
v1.17.0
What's Changed
- fix: rebuild on language change by @thirdeyenick in #373
- refactor: PostgresDatabase Collation Hint by @sislr in #374
- build(deps): bump docker/login-action from 3 to 4 by @dependabot[bot] in #375
- build(deps): bump crate-ci/typos from 1.44.0 to 1.45.0 by @dependabot[bot] in #376
- build(deps): bump golang.org/x/oauth2 from 0.35.0 to 0.36.0 by @dependabot[bot] in #378
- build(deps): bump k8s.io/api from 0.35.2 to 0.35.3 by @dependabot[bot] in #380
- build(deps): bump k8s.io/client-go from 0.35.2 to 0.35.3 by @dependabot[bot] in #379
- build(deps): bump github.com/int128/kubelogin from 1.35.2 to 1.36.0 by @dependabot[bot] in #381
- refactor: rename config to project-config and add config as alias by @SaadAssaf in #383
- refactor: make help output more readable by @SaadAssaf in #386
- feat(grafana): add command by @thirdeyenick in #387
- add service linking for deploio apps by @gajicdev in #388
Full Changelog: v1.16.0...v1.17.0