Commit Graph

10 Commits

Author SHA1 Message Date
Andrey Smirnov
edb40437ec feat: add support for osctl logs -f
Now default is not to follow the logs (which is similar to `kubectl logs`).

Integration test was added for `Logs()` API and `osctl logs` command.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-12-05 13:58:52 -08:00
Andrey Smirnov
5b7bea2471 feat: use grpc-proxy in apid
This replaces codegen version of apid proxying with
talos-systems/grpc-proxy based version. Proxying is transparent, it
doesn't require exact information about methods and response types. It
requires some common layout response to enhance it properly with node
metadata or errors.

There should be no signifcant changes to the API with the previous
version, but it's worth mentioning a few changes:

1. grpc.ClientConn is established just once per upstream (either local
service or remote apid instance).

2. When called without `-t` (`targets`), apid proxies immediately down
to local service skipping proxying to itself (as before), which results
in empty node metadata in response (before it had local node IP). Might
revert this later to proxy to itself (?).

3. Streaming APIs are now fully supported with multiple targets, but
message definition doesn't contain `ResponseMetadata`, so streaming APIs
are broken now with targets (needs a fix).

4. Errors are now returned as responses with `Error` field set in
`ResponseMetadata`, this requires client library update and `osctl` to
handle it properly.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-11-29 22:57:25 +03:00
Andrew Rynhard
ac089dc330 feat: add read API
This adds an API for reading arbitrary files.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-11-25 10:46:50 -08:00
Brad Beam
28ee910899 chore: Fix formatting ( make fmt )
Not sure if there was an update in the fmt code path, but these are the
results after running `make fmt`.

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-11-23 13:50:52 -08:00
Andrey Smirnov
63212ab17e test: fix integration test for k8s version
Push versions to constants, introduce 'platform' to version API to
discover node mode. Check kernel version for non-containers.

A bit of refactoring on version package to expose something closer to a
single response.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2019-11-11 13:42:21 -08:00
Brad Beam
41a4741bca refactor: Move logs to machined
This moves Logs endpoint to machined to reduce the mount footprint of osd.

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-11-04 15:04:13 -08:00
Brad Beam
a4e1479b07 refactor: Move kubeconfig to machined
This moves the Kubeconfig api endpoint to machined and consolidates the
"read a file" code into machined. This also changes Kubeconfig to
use the CopyOut method which changes Kubeconfig to a streaming grpc call.

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-11-04 14:45:23 -08:00
Brad Beam
6de32dd30b fix: Fix osctl version output
This broke when we introduced the apid changes.

```
Client:
Tag:         v0.3.0-alpha.3-3-gc3e353aa-dirty
SHA:         c3e353a-dirty
Built:
Go version:  go1.13.3
OS/Arch:     linux/amd64

Server:
NODE:        10.5.0.3
Tag:         v0.3.0-alpha.3-3-gc3e353aa-dirty
SHA:         c3e353a-dirty
Built:
Go version:  go1.13.3
OS/Arch:     linux/amd64

NODE:        10.5.0.2
Tag:         v0.3.0-alpha.3-3-gc3e353aa-dirty
SHA:         c3e353a-dirty
Built:
Go version:  go1.13.3
OS/Arch:     linux/amd64
```

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-10-25 15:41:06 -05:00
Brad Beam
573cce8d18 feat: Add APId
This PR introduces APId. This service replaces the frontend functionality
previously provided by OSD. The main driver for this is two fold:

1. Create a single purpose application to expose the talos api

2. Make use of code generation to DRY api changes

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-10-25 13:02:33 -05:00
Brad Beam
251ab16e07 feat: Add node metadata wrapper to machine api
- Added common.proto to host NodeMetadata
- go_package names were fixed up so imports are generated with the proper
  package names
- fixed up build work (dockerfile) to prevent copying the previously
  generated go proto files. This fixes a bug where we could incorrectly
  copy the previously generated protobuf instead of a new one generated
  at an incorrect location/name/etc.

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-10-22 14:42:34 -05:00