start kexpand

This commit is contained in:
Jeffrey Regan 2017-09-28 11:58:22 -07:00
parent 7eba50ae0f
commit 09309e13a9
2 changed files with 67 additions and 0 deletions

42
cmd/kexpand/README.md Normal file
View File

@ -0,0 +1,42 @@
# kexpand
_TODO: flesh out this placeholder documentation_
`kexpand` is a kubernetes cluster configuration utility,
a prototype of ideas discussed in [this doc][DAM].
It accepts one or more file system path arguments,
reads the content thereof, and emits kubernetes
[resource] yaml to stdout, suitable for piping
into [kubectl] for [declarative] application to a
kubernetes cluster.
For example, if your current working directory contained
> ```
> mycluster/
> Kube-Manifest.yaml
> deployment.yaml
> service.yaml
> instances/
> testing/
> Kube-Manifest.yaml
> deployment.yaml
> prod/
> Kube-Manifest.yaml
> deployment.yaml
> ...
> ```
then the command
```
kexpand ./mycluster/instances | kubectl apply -f -
```
would modify your cluster per the resources
generated from the manifests and associated
resource files found in `mycluster`.
[resource]: https://kubernetes.io/docs/api-reference/v1.7/
[DAM]: https://goo.gl/T66ZcD
[yaml]: http://www.yaml.org/start.html
[kubectl]: https://kubernetes.io/docs/user-guide/kubectl-overview/
[declarative]: https://kubernetes.io/docs/tutorials/object-management-kubectl/declarative-object-management-configuration/

25
cmd/kexpand/main.go Normal file
View File

@ -0,0 +1,25 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello world.")
}