70 Commits

Author SHA1 Message Date
Dalton Hubble
94db98d854 *: Rename k8s-master to k8s-controller 2016-09-09 11:16:56 -07:00
Dalton Hubble
95b18ba8b9 bootstrap/http: Format nested metadata in env file
* Serve /metadata including group metadata, selectors, and
query variables in KEY=value "env file" format lines
* Recurse into nested maps (e.g. OUTER_INNER=val)
2016-07-19 16:36:04 -07:00
Dalton Hubble
07751a4bba bootcfg/http: Add request query params to template variables
* Add query parameters to template variables, referenced by
 {{.request.query.param}}
* Render Ignition/Fuze, cloud-config, and generic templates and
metadata with collected variables
* Replace template variable {{.query}} with {{.request.raw_query}}
(breaking)
2016-07-19 16:25:01 -07:00
Dalton Hubble
c3645d22d3 CHANGES.md,README.md: Update changelog, links, and fix typos 2016-07-19 10:54:36 -07:00
Dalton Hubble
8e3d4b4547 bootcfg/cli: Organize imports 2016-07-19 10:06:14 -07:00
Dalton Hubble
5575590393 bootcfg/http: Cleanup handler chains and source organization
* Simplify common http request handling chains
* Separate github.com/dghubble/ctxh source so we can move
it to a separate CoreOS package or vendor upstream
* Remove unused requireGET
2016-07-19 10:06:14 -07:00
Dalton Hubble
46c8820c69 bootcfg/client: Accept a gRPC DialTimeout option 2016-07-15 10:45:38 -07:00
Dalton Hubble
10cfa59970 bootcfg/http: Chain handlers with a simple chain func 2016-07-12 17:59:52 -07:00
Dalton Hubble
8404e34b9a bootcfg/http: Add structured info/debug logging
* Add info logs for errors matching machine groups
or resolving profiles, or supported templates
* Add debug logs with successful match info
2016-07-12 14:00:01 -07:00
Dalton Hubble
63e48160f6 bootcfg/http: Replace capnslog with logrus 2016-07-11 14:43:33 -07:00
Dalton Hubble
29f277f001 bootcfg/http: Replace store field with core Server
* Remove the bootcfg/http/server.Server store field
to enforce handlers use the core Server, not the Store
directly
2016-07-11 14:43:33 -07:00
Dalton Hubble
f2a89a6168 bootcfg/http: Convert logging handlers to methods
* Convert handlers which log to bootcfg/http/server.Server
methods to allow a Server instance scoped logger to be used
to replace the package logger
2016-07-11 14:43:33 -07:00
Dalton Hubble
62e0ec1976 bootcfg/http/ignition: Just warn for raw Ignition errors
* When raw Ignition (.ign/.ignition) content is provided, Parse
the contents with ignition, but return the contents as JSON
regardless of the result to respect user pass-through expectations
* Warn on parse errors which can occur if a newer Ignition format
is used than the version of Ignition that bootcfg was compiled
with
2016-07-05 10:46:32 -07:00
Dalton Hubble
235ebf6f62 bootcfg/http: Upgrade from Ignition v1 to 2.0.0 and Fuze
* By default, templates for Ignition are rendered and
parsed as github.com/coreos/fuze YAML configs, which
formalize the transform from YAML to Ignition JSON
* Ignition files (.ign/.ignition) should be validated and
served directly, without template rendering
* Remove support for Ignition v1
* This change is breaking! Users need to tweak any YAML
Ignition templates to the very similar Fuze YAML format
2016-07-05 10:46:32 -07:00
Curtis Gagliardi
7ef89e5f60 Add a newline to versionHandler output. 2016-06-24 13:48:08 -07:00
Adam Schaub
5bac35cc54 *: Add /generic docs and revert NetBoot protobuf id
* Revert NetBoot id in storage.proto for compatibility
* Add URL.RawQuery to data for generic templates
* Add generic directory to scripts/setup-data-dir
* Add documentation for generic templates.
2016-06-15 11:09:45 -07:00
Adam Schaub
95db4cba61 bootcfg/http: Added genericHandler + tests to the http server
genericHandler uses a Profile.GenericId to locate and render a "generic" go template using group metadata and selectors.

Partially addresses #224
2016-06-15 11:06:11 -07:00
Adam Schaub
d49d9f25b4 bootcfg/{storage,server}: Added function GetGeneric to storage interface and implementations. Added GenericID to Profile protobuf.
Profiles now have GenericId which can be used to render a "generic" go template file (neither ignition nor cloud-init) using group metadata and selectors. The storage interface and it's implementations use GetGeneric to retrieve this template.

Partially addresses #224
2016-06-15 11:06:11 -07:00
Dalton Hubble
d738880a46 *: Read-only TLS credentials and limit CipherSuites
* Group changelog bullet points for readability
2016-06-09 17:02:11 -07:00
Dalton Hubble
baa7f5e025 bootcfg/*: Require TLS client auth for gRPC API
* gRPC API server requires a CA certificate to verify
and authenticate clients (passed via -ca-file)
* gRPC clients must authenticate with a client certificate
and key (passed via -cert-file and -key-file)
2016-06-09 17:02:11 -07:00
Dalton Hubble
af76aa6951 bootcfg:/*: Add gRPC client-to-server TLS and verify
* A CA certificate (e.g. ca.crt) should be used to sign a server
certificate (server.crt for a private key server.key)
* gRPC API server requires a server certificate and key to be enabled
(passed via -cert-file and -key-file)
* gRPC client bootcmd tool must verify the server identity using a
known CA (passed to bootcmd via -ca-file)
* This provides transport security, it does not provide client
authentication
2016-06-09 17:02:10 -07:00
Dalton Hubble
ba78c1291b bootcfg/http/server: Log requests for bootcfg assets 2016-05-26 14:14:47 -07:00
Dalton Hubble
3d27e7f051 bootcfg/http: Error for missing template metadata
* Rendering an Ignition config or cloud-config template
with machine group metadata will error and log if a metadata
value is missing.
* Previously, the default missing value was "no value"
2016-05-25 10:55:25 -07:00
Dalton Hubble
e2c066d750 vendor: Bump protobuf, grpc, and generated code 2016-05-13 11:19:19 -07:00
Dalton Hubble
16bc87c70a bootcfg/storage: Add Copy methods to Profile and Group 2016-05-10 15:37:03 -07:00
Dalton Hubble
53a97f2d17 bootcfg/version: Don't show version at / path
* Stop showing version hash at / path. If bootcfg were deployed
at a public endpoint, the version could be used by attackers to
find out-of-date deployments.
2016-05-10 15:03:15 -07:00
Dalton Hubble
1a41114ccc bootcfg/client: Add gRPC client Close 2016-05-10 13:19:41 -07:00
Dalton Hubble
1ef3a57371 bootcfg/client: Return an error if no endpoints provided
* Client package's New should return an error if no endpoints
are provided when creating a gRPC client
2016-05-10 13:07:09 -07:00
Dalton Hubble
682bb72dde bootcfg/http: Allow Ignition 2.0.0 YAML
* Ignition 2.0.0 became available in CoreOS 1010.1.0
2016-05-05 14:59:15 -07:00
Dalton Hubble
d6e2d14560 bootcfg/http: Allow Ignition 2.0.0 JSON and arbitrary extensions
* Allow Ignition 2.0.0 JSON documents to be served
* Stop requiring Ignition templates to use file extensions to
specify their rendered format for parsing
2016-05-05 14:58:39 -07:00
Dalton Hubble
c2c29bb7ff examples/k8s: Remove k8s_version from machine metadata
* Setting k8s_version via metadata gives the impression
it can be bumped and the cluster will operate with the
desired version. In reality, the k8s profiles change in
minor but important ways which we validate between k8s
releases. It should be part of the k8s profile Ignition.
2016-05-03 15:54:46 -07:00
Dalton Hubble
3525abf84f bootcfg/version: Add version package and HTTP version output
* bootcfg/version package provides the linker's GIT SHA based
version to bootcfg components
* Display the bootcfg version via the HTTP server / path for
convenience and for validating a deployed version easily
* Log requests to the / rooted subtree paths to surface machines
which are making requests containing typos and mistakes that do
not match HTTP API endpoints
2016-04-26 18:21:59 -07:00
Dalton Hubble
f654879195 bootcfg/http: Fix http package log messages
* Package bootcfg/http logs show "api" which was the old
package name
2016-04-26 18:21:59 -07:00
Dalton Hubble
3c222f11f3 bootcfg/server/serverpb: Fix package name to be serverpb
* Use the same Go package name and import directory name
'serverpb'. The messagepb package inside serverpb folder
caused confusion.
2016-04-26 11:07:30 -07:00
Dalton Hubble
8a846d2765 bootcfg/rpc: Add IgnitionPut endpoint to gRPC API
* Add `bootcmd ignition create -f file` CLI command
2016-04-20 13:27:33 -07:00
Joe Bowers
997064215d bootcmd: Fix index-out-of-range on describe subcommands 2016-04-20 13:18:57 -07:00
Dalton Hubble
94ead0a1af bootcfg/http: Add selectors to template data
* Ignition and Cloud config templates can reference selector
key/value pairs by lowercase key name
* Metadata endpoint will provide metadata and selector key/val
pairs for the matching machine group
2016-04-12 16:51:44 -07:00
Dalton Hubble
0ffa17c12d Rename Group field requirements to selector
* Use label/selector terms for machine attribute labels and group
selectors requirements since it is familiar to many users
2016-04-12 13:32:46 -07:00
Dalton Hubble
9e5955e600 cmd/bootcfg: Allow bootcfg asset serving to be disabled
* Pass -assets-path="" to disable asset serving. Defaults to
/var/lib/bootcfg/assets.
2016-04-12 13:28:57 -07:00
Dalton Hubble
3e5115a6e0 bootcfg/: Rename and document packages with their purpose (#145) 2016-04-12 11:25:17 -07:00
Dalton Hubble
79fd3bf51a bootcfg/storage/storagepb: Add Group Normalize method
* All Groups retrieved from FileStore's GroupGet (via ParseGroup)
should have normalized selectors since end-users may write Group
definitions with MAC addresses which don't match Go's format
2016-04-07 15:07:57 -07:00
Dalton Hubble
eaaf3ac599 bootcfg/storage: Improve Group validation and tests 2016-04-07 14:13:13 -07:00
Dalton Hubble
9d5692c823 bootcfg/rpc: Add GroupPut to gRPC API and group create cmd
* Use hardcoded Group Id's for example groups so repeated
group creation overrides
2016-04-07 11:01:33 -07:00
Dalton Hubble
300291780e tests: Fix marshal/unmarhal errors for Groups without metadata
* Expand the use of testfakes to decrease test fixture duplication
* Add test coverage for numbers and booleans in Group metadata
2016-04-05 17:14:38 -07:00
Dalton Hubble
373d27760a bootcfg/storage: Read groups from groups directory
* Split config.yaml files into JSON groups files
* Update examples to use folders of mountable groups files
* Stop reading groups from a -config config.yaml file
* Add RichGroup JSON <-> Protobuf Serialize Group
2016-04-05 14:10:44 -07:00
Dalton Hubble
b3110f9548 tests: Improve storage test coverage 2016-04-04 14:39:46 -07:00
Dalton Hubble
e5acb77c49 bootcfg/rpc: Convert errors to gRPC canonical errors in rpc pkg 2016-04-01 11:24:34 -07:00
Dalton Hubble
2647f4cb7c bootcfg/rpc: Move protobuf rpc services to rpcpb package
* Defining protobuf messages with protobuf rpc services resulted
in generated code which depended upon the gRPC package. This meant
the core server lib depended on gPRC and thus, so did the HTTP
server.
* Move rpc service protobuf definitions under bootcfg/rpc, so the
bootcfg/server package no longer depends on grpc.
2016-04-01 03:33:39 -07:00
Dalton Hubble
70fce2739b bootcft/server: Simplify responses from server lib
* Simplify server lib responses so HTTP server components don't
have to unwrap protobuf Response types intended for gRPC uses
* Wrap server lib responses in protobuf Response types in the
rpc package
2016-04-01 03:10:05 -07:00
Dalton Hubble
618ab7b969 bootcfg/api: Update HTTP server to use bootcfg shared server
* HTTP and gRPC servers share a core server lib, HTTP server should
not access the store directly
2016-03-31 17:01:05 -07:00