mirror of
https://github.com/nofusscomputing/kubernetes-manifest-tools.git
synced 2025-08-14 00:37:27 +00:00
28
README.md
28
README.md
@ -22,6 +22,34 @@
|
||||
This repository is for a docker container that contains various tools for working with and manipulating Kubernetes Manifests.
|
||||
|
||||
|
||||
## Using this Container
|
||||
|
||||
This container can be used from the console (requires docker be installed), as a Github Actions or as part of a Gitlab CI/CD Pipeline.
|
||||
|
||||
``` bash
|
||||
|
||||
docker run -ti \
|
||||
-e "KUBECTL_SLICE_INPUT_FILE=k8s-manifest-file.yaml" \
|
||||
-e "KUBECTL_SLICE_OUTPUT_DIR=/split" \
|
||||
-v ${PWD}:/workdir \
|
||||
--rm \
|
||||
harbor.earth.nww/testing/kubectl-slice:test
|
||||
|
||||
```
|
||||
|
||||
### Variables
|
||||
|
||||
The container has variables available for use that are only required if not using this container as part of a github action.
|
||||
|
||||
| ENV variable | Github Action Inputs | Description |
|
||||
|:---:|:---:|:---|
|
||||
| `KUBECTL_SLICE_INPUT_FILE` | _input-file_ | Kubernetes Manifest to process. must be relative path to file from root of repository. If a URL is supplied, the manifest will be downloaded. ||
|
||||
| `KUBECTL_SLICE_OUTPUT_DIR` | _output-dir_ | The directory where the manifests will be saved to. |
|
||||
| `NFC_FORMAT_YAML` | _format-yaml_ | If set, the YAML files will have the yaml header `---` added and have the indentation set to `2`. |
|
||||
| `KUBECTL_SLICE_TEMPLATE` | _filename-format_ | Sets the format of the filename. defaults to `<Kubernetes Kind name in CamelCase>-<manifest name in lowercase>.yaml` |
|
||||
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
As this repository is intended to be a single location for deploying all of your kubernetes services. We encourage collaborataion and welcome All contributions.
|
||||
|
39
action.yml
Normal file
39
action.yml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
|
||||
name: Kubernetes Manifest Tools
|
||||
description: Tools for working with and manipulating kubernetes manifests
|
||||
author: "No Fuss Computing"
|
||||
branding:
|
||||
icon: "activity"
|
||||
color: "blue"
|
||||
|
||||
|
||||
inputs:
|
||||
|
||||
format-yaml:
|
||||
required: false
|
||||
default: 'true'
|
||||
description: 'The message to print'
|
||||
|
||||
input-file:
|
||||
required: false
|
||||
description: 'The message to print'
|
||||
|
||||
output-dir:
|
||||
required: false
|
||||
default: '.'
|
||||
description: 'The message to print'
|
||||
|
||||
filename-format:
|
||||
required: false
|
||||
description: 'The message to print'
|
||||
|
||||
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'python:3.11-slim'
|
||||
env:
|
||||
KUBECTL_SLICE_INPUT_FILE: ${{ inputs.input-file }}
|
||||
KUBECTL_SLICE_OUTPUT_DIR: ${{ inputs.output-dir }}
|
||||
KUBECTL_SLICE_TEMPLATE: ${{ inputs.filename-format }}
|
||||
NFC_FORMAT_YAML: ${{ inputs.format-yaml }}
|
Reference in New Issue
Block a user