Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/superbrothers/ksort
Sort manfest files in a proper order by Kind
https://github.com/superbrothers/ksort
kubectl-plugins kubernetes
Last synced: 8 days ago
JSON representation
Sort manfest files in a proper order by Kind
- Host: GitHub
- URL: https://github.com/superbrothers/ksort
- Owner: superbrothers
- License: other
- Created: 2018-01-17T08:51:58.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T02:34:28.000Z (5 months ago)
- Last Synced: 2024-10-15T13:59:11.579Z (24 days ago)
- Topics: kubectl-plugins, kubernetes
- Language: Go
- Homepage:
- Size: 7.7 MB
- Stars: 59
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-kubectl-plugins - ksort
README
# ksort
[![Build Status](https://travis-ci.org/superbrothers/ksort.svg?branch=master)](https://travis-ci.org/superbrothers/ksort)
This is a tool which does in-place sort of Kubernetes manifests by Kind.
## Description
When installing manifests, they should be sorted in a proper order by Kind. For example, Namespace object must be in the first place when installing them.
ksort sorts manfest files in a proper order by Kind.
## Usage
Sort manifest files in the `deploy` directory in the proper order, and output the result to the stdout.
```
$ ls ./manifests
deployment.yaml ingress.yaml namespace.yaml service.yaml
$ ksort -f ./manifests
```To pass the result into the stdin of `kubectl apply` command is also convenient.
```
$ ksort -f ./manifests | kubectl apply -f -
```Sort manifests contained the manifest file that is specified.
```
$ ksort -f ./app.yaml
```Sort manifests passed into stdin.
```
$ cat app.yaml | ksort -f-
```## Installation
You can download an archive file from [GitHub Releases](https://github.com/superbrothers/ksort/releases), then extract it and install a binary.
Or use `go get` as follows:
```
$ go get github.com/superbrothers/ksort/cmd
```## Installation as kubectl plugin
You can also use ksort as kubectl plugin. The name as kubectl plugin is `sort-manifests`.
1. Install [krew](https://github.com/GoogleContainerTools/krew) that is a plugin manager for kubectl
2. Run:kubectl krew install sort-manifests
3. Try it out
kubectl sort-manifests -h
## License
This software is released under the MIT License and includes the work that is distributed in the Apache License 2.0.