kubectl-create-transient_configmap

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 5 Imported by: 0

README

kubectl-create-transient_configmap

CI GitHub release (latest by date) Go Report Card GitHub License

kubectl plugin.
Create a ConfigMap and a Job. And after the job is complete, delete them.

Quick Start

Install
With go install(recommend)
go install github.com/miyamo2/kubectl-create-transient_configmap@latest
Simple Usage

Manifest

apiVersion: batch/v1
kind: CronJob
metadata:
  name: foo-batch
spec:
  timeZone: "Asia/Tokyo"
  schedule: "0 0 * * *"
  startingDeadlineSeconds: 100
  jobTemplate:
    spec:
      completions: 1
      parallelism: 1
      backoffLimit: 0
      template:
        spec:
          containers:
            - name: foo-batch
              image: e2e:latest
              imagePullPolicy: Never
              env:
                - name: NUM
                  valueFrom:
                    configMapKeyRef:
                      name: foo-configmap
                      key: num
                      optional: true
          restartPolicy: Never

command

kubectl create transient_configmap my-config --from-literal=num=1 --job-name=test-job --job-from=cronjob/a-cronjob

Features

Flags
name description
from-env-file Specify the path to a file to read lines of key=val pairs to create a configmap.
from-file Key file can be specified using its file path, in which case file basename will be used as configmap key, or optionally with a key and file path, in which case the given key will be used. Specifying a directory will iterate each named file in the directory whose basename is a valid configmap key.
from-literal Specify a key and literal value to insert in configmap (i.e. mykey=somevalue)
job-name Name of job to be created. required.
job-from The name of the resource to create a Job from (only cronjob is supported).
job-image Image name to run.

Contributing

Feel free to open a PR or an Issue.
However, you must promise to follow our Code of Conduct.

License

kubectl-create-transient_configmap released under the MIT License

Documentation

Overview

Copyright (c) 2024 miyamo2

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
tests
e2e Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL