Browse Source

Add man pages and adjust Makefile

master
Maxim Likhachev 5 years ago
parent
commit
03320dfbbc
  1. 124
      Makefile
  2. 10
      README.md
  3. 185
      man/kubectl-compare.1
  4. 165
      man/kubectl-http.1
  5. 151
      man/kubectl-ingress.1
  6. 158
      man/kubectl-secret.1
  7. 158
      man/kubectl-secrets.1
  8. 92
      scripts/kubectl-compare
  9. 46
      scripts/kubectl-http
  10. 24
      scripts/kubectl-ingress
  11. 35
      scripts/kubectl-secret
  12. 0
      scripts/kubectl-secrets

124
Makefile

@ -1,36 +1,108 @@
path = ~/.shellrc/bin/scripts install_path = /usr/local/bin
links_path = ~/.shellrc/bin/scripts
local_man_path = ~/.shellrc/var/man/man1
system_man_path = /usr/local/share/man/man1
SRC := scripts
MAN := man
find := $(shell { command -v gfind || command -v find; } 2>&-) find := $(shell { command -v gfind || command -v find; } 2>&-)
all: install SCRIPTS := $(wildcard $(SRC)/kubectl-*)
MAN_PAGES := $(subst $(SRC),$(MAN),$(basename $(wildcard $(SRC)/kubectl-*)))
MAN_FILES := $(addsuffix ".1", $(MAN_PAGES))
# --------------------------------------------------------------------------------------------------
# copy_files [FILES] TO/
define copy_files
@for file in $(1); do \
cp -v $$(realpath -- $$file) $(2)/$$(basename $$file); \
done
endef
# link_files [FILES] TO/
define link_files
@for file in $(1); do \
ln -f -s -v $$(realpath -- $$file) $(2)/$$(basename $$file); \
done
endef
# delete_files [FILES] FROM/
define delete_files
@for file in $(1); do \
rm -v $(2)/$$(basename $$file) || :; \
done
endef
# --------------------------------------------------------------------------------------------------
help: ## Display this help.
@awk 'BEGIN { \
FS = ":.*##"; \
printf "\nUsage:\n make \033[36m<target>\033[0m\n\nTargets:\n" \
} \
/^[a-zA-Z_-]+:.*?##/ { \
printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 \
} \
END { \
print \
}' \
$(MAKEFILE_LIST)
# --------------------------------------------------------------------------------------------------
man: $(MAN_PAGES) ## Generate man pages.
links: man make_local_dirs make_links link_man_pages ## Install kubectl scripts by creating links.
install: man copy_bin copy_man_pages ## Install kubectl scripts to /usr/local/bin.
uninstall: rm_bin rm_links rm_man_pages rm_man_links rm_local_dirs ## Uninstall kubectl scripts.
# --------------------------------------------------------------------------------------------------
%: $(BIN)/%
$(MAN)/%: $(SRC)/%
pod2man --section 1 --release "1.0.0" --center "KUBECTL EXTENSIONS" $< > $@.1
# --------------------------------------------------------------------------------------------------
make_man_directory:
@mkdir -p $(system_man_path)
copy_bin:
$(call copy_files, $(SCRIPTS), $(install_path))
rm_bin:
$(call delete_files, $(SCRIPTS), $(install_path))
copy_man_pages: make_man_directory
$(call copy_files, $(MAN_FILES), $(system_man_path))
rm_man_pages: make_man_directory
$(call delete_files, $(MAN_FILES), $(system_man_path))
# --------------------------------------------------------------------------------------------------
make_local_dirs:
mkdir -p -v $(links_path)
mkdir -p -v $(local_man_path)
mkdir: rm_local_dirs:
@mkdir -p $(path) rmdir $(links_path) 2>&-; :
rmdir $(local_man_path) 2>&-; :
rmdir: make_links:
@rmdir $(path) 2>&-; : $(call link_files, $(SCRIPTS), $(links_path))
install: mkdir rm_links:
@$(find) . \ $(call delete_files, $(SCRIPTS), $(links_path))
-maxdepth 1 \
\( -type f -o -type l \) \
-executable \
-exec basename {} \; \
| while read -r line; do \
ln -v -s $$(realpath -- $$line) $(path)/$$line 2>&-; \
done; \
true
rmlinks: link_man_pages:
@$(find) . \ $(call link_files, $(MAN_FILES), $(local_man_path))
-maxdepth 1 \
\( -type f -o -type l \) \
-executable \
-exec basename {} \; \
| xargs -IF rm -fv $(path)/F
uninstall: rmlinks rmdir rm_man_links:
$(call delete_files, $(MAN_FILES), $(local_man_path))
clean: uninstall # --------------------------------------------------------------------------------------------------
.PHONY: all mkdir rmdir install uninstall clean .PHONY: all make_local_dirs rm_local_dirs links install uninstall

10
README.md

@ -10,11 +10,15 @@ otherwise is specified.
## Installing ## Installing
A command To install scripts in the `/usr/local/bin` directory run the following command:
$ make install <path> $ make install
will create the symbolic link for each script in the \<path> directory. The command
$ make links
will create the symbolic link for each script in the `links_path` directory.
# Index # Index

185
man/kubectl-compare.1

@ -0,0 +1,185 @@
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "KUBECTL-COMPARE 1"
.TH KUBECTL-COMPARE 1 "2020-10-26" "1.0.0" "KUBECTL EXTENSIONS"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
kubectl\-compare allows to juxtapose kubernetes resources with any diff\-like utilities.
.SH "USAGE"
.IX Header "USAGE"
.Vb 5
\& kubectl compare [\-n|\-\-namespace NAMESPACE] [\-t|\-\-type] [\-e|\-\-edit|\-v|\-\-visual] name1 name2
\&or
\& kubectl compare [\-e|\-\-edit|\-v|\-\-visual] namespace/type/name1 namespace/type/name2
\&or
\& kubectl compare [\-e|\-\-edit|\-v|\-\-visual] namespace/type/name1 namespace/type/name2 namespace/type/name3 ...
.Ve
.SH "OPTIONS"
.IX Header "OPTIONS"
.Vb 3
\& \-n \-\-namespace Kubernetes namespace for search (\*(Aqdefault\*(Aq by default).
\& \-t \-\-type Kubernetes resource\*(Aqs type, e.g. pod, svc, configmap, etc (\*(Aqpod\*(Aq by default).
\& \-e \-\-edit, \-v \-\-visual Open diff in visual editor (e.g. vimdiff).
.Ve
.PP
Set \fB\s-1VISUAL_DIFF_CMD\s0\fR environment variable or provide its value in script's
file (kubectl-compare) to specify utility which will be used.
.PP
To specify main diff program set \fB\s-1DIFF_CMD\s0\fR variable (its default value is \fI'diff
\&\-u \-\-color=always'\fR).
.PP
Use something like \fIdiff3\fR to compare 3 manifests.
.SH "EXAMPLE"
.IX Header "EXAMPLE"
.Vb 7
\& $ kubectl compare \-n zookeeper \-t pod zookeeper\-0 zookeeper\-1
\& $ kubectl compare \-n zookeeper pod/zookeeper\-0 pod/zookeeper\-1
\& $ kubectl compare zookeeper/pod/zookeeper\-0 zookeeper/pod/zookeeper\-1
\& ^ ^ ^
\& [namespace]\-\-\-+ | |
\& [type]\-\-\-\-+ |
\& [name]\-\-+
\&
\& $ kubectl compare zookeeper/pod/zookeeper\-{0,1,2}
.Ve
.SH "BUGS"
.IX Header "BUGS"
If you find a bug, please report it at \fB<https://code.envrm.info/src/scripts\-kubernetes>\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
envrm \fB<https://code.envrm.info>\fR.

165
man/kubectl-http.1

@ -0,0 +1,165 @@
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "KUBECTL-HTTP 1"
.TH KUBECTL-HTTP 1 "2020-10-26" "1.0.0" "KUBECTL EXTENSIONS"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
kubectl\-http is a wrapper for `kubectl proxy' command which shows links to resources.
.SH "USAGE"
.IX Header "USAGE"
kubectl http [all|pods|services] [standard kubectl selectors]
.SH "OPTIONS"
.IX Header "OPTIONS"
.Vb 2
\& \-h \-\-help = show this help
\& \-hl \-\-hyperlinks = use terminal emulator\*(Aqs hyperlinks feature
.Ve
.PP
Basic selectors:
.PP
.Vb 3
\& all pods and services
\& po pod pods pods
\& svc service services services
.Ve
.SH "BUGS"
.IX Header "BUGS"
If you find a bug, please report it at \fB<https://code.envrm.info/src/scripts\-kubernetes>\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
envrm \fB<https://code.envrm.info>\fR.

151
man/kubectl-ingress.1

@ -0,0 +1,151 @@
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "KUBECTL-INGRESS 1"
.TH KUBECTL-INGRESS 1 "2020-10-26" "1.0.0" "KUBECTL EXTENSIONS"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
kubectl\-ingress is a wrapper for `kubectl get ingress' command which makes links clickable.
.SH "USAGE"
.IX Header "USAGE"
kubectl ingress [standard kubectl selectors]
.SH "BUGS"
.IX Header "BUGS"
If you find a bug, please report it at \fB<https://code.envrm.info/src/scripts\-kubernetes>\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
envrm \fB<https://code.envrm.info>\fR.

158
man/kubectl-secret.1

@ -0,0 +1,158 @@
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "KUBECTL-SECRET 1"
.TH KUBECTL-SECRET 1 "2020-10-26" "1.0.0" "KUBECTL EXTENSIONS"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
kubectl\-secret is a wrapper for `kubectl get secret' to decoding secrets automatically.
.SH "USAGE"
.IX Header "USAGE"
kubectl secret [\-h|\-d|\-s] [standard kubectl selectors]
.SH "OPTIONS"
.IX Header "OPTIONS"
.Vb 3
\& \-h \-\-help = show this help
\& \-s \-\-simple = show only secrets
\& \-d \-\-decode = show decoded data as plain text (by default it shows under the link)
.Ve
.SH "BUGS"
.IX Header "BUGS"
If you find a bug, please report it at \fB<https://code.envrm.info/src/scripts\-kubernetes>\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
envrm \fB<https://code.envrm.info>\fR.

158
man/kubectl-secrets.1

@ -0,0 +1,158 @@
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "KUBECTL-SECRETS 1"
.TH KUBECTL-SECRETS 1 "2020-10-26" "1.0.0" "KUBECTL EXTENSIONS"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
kubectl\-secret is a wrapper for `kubectl get secret' to decoding secrets automatically.
.SH "USAGE"
.IX Header "USAGE"
kubectl secret [\-h|\-d|\-s] [standard kubectl selectors]
.SH "OPTIONS"
.IX Header "OPTIONS"
.Vb 3
\& \-h \-\-help = show this help
\& \-s \-\-simple = show only secrets
\& \-d \-\-decode = show decoded data as plain text (by default it shows under the link)
.Ve
.SH "BUGS"
.IX Header "BUGS"
If you find a bug, please report it at \fB<https://code.envrm.info/src/scripts\-kubernetes>\fR.
.SH "AUTHORS"
.IX Header "AUTHORS"
envrm \fB<https://code.envrm.info>\fR.

92
kubectl-compare → scripts/kubectl-compare

@ -16,65 +16,77 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
set -o pipefail : <<'MAN'
if [ -z "$DIFF_CMD" ]; then =head1 NAME
DIFF_CMD="diff -u --color=always"
fi
if [ -z "$VISUAL_DIFF_CMD" ]; then kubectl-compare allows to juxtapose kubernetes resources with any diff-like utilities.
VISUAL_DIFF_CMD="vim -d --cmd 'autocmd BufRead * set filetype=yaml'"
fi
# Default Kubernetes namespace =head1 USAGE
NAMESPACE=default
# Default Kubernetes resource kubectl compare [-n|--namespace NAMESPACE] [-t|--type] [-e|--edit|-v|--visual] name1 name2
TYPE=pod or
kubectl compare [-e|--edit|-v|--visual] namespace/type/name1 namespace/type/name2
or
kubectl compare [-e|--edit|-v|--visual] namespace/type/name1 namespace/type/name2 namespace/type/name3 ...
usage() { =head1 OPTIONS
cat <<EOF
$(basename "$0") allows to juxtapose kubernetes resources with any diff-like utilities. -n --namespace Kubernetes namespace for search ('default' by default).
-t --type Kubernetes resource's type, e.g. pod, svc, configmap, etc ('pod' by default).
-e --edit, -v --visual Open diff in visual editor (e.g. vimdiff).
USAGE: Set B<VISUAL_DIFF_CMD> environment variable or provide its value in script's
file (kubectl-compare) to specify utility which will be used.
$(basename "$0") [-n|--namespace NAMESPACE] [-t|--type] [-e|--edit|-v|--visual] name1 name2 To specify main diff program set B<DIFF_CMD> variable (its default value is I<'diff
or -u --color=always'>).
$(basename "$0") [-e|--edit|-v|--visual] namespace/type/name1 namespace/type/name2
or
$(basename "$0") [-e|--edit|-v|--visual] namespace/type/name1 namespace/type/name2 namespace/type/name3 ...
OPTIONS: Use something like I<diff3> to compare 3 manifests.
-n --namespace Kubernetes namespace for search («default» by default).
-t --type Kubernetes resource's type, e.g. pod, svc, configmap, etc («pod» by default). =head1 EXAMPLE
-e --edit, -v --visual Open diff in visual editor (e.g. vimdiff). $ kubectl compare -n zookeeper -t pod zookeeper-0 zookeeper-1
Set VISUAL_DIFF_CMD environment variable or $ kubectl compare -n zookeeper pod/zookeeper-0 pod/zookeeper-1
provide its value in script's file ($(basename "$0")) to $ kubectl compare zookeeper/pod/zookeeper-0 zookeeper/pod/zookeeper-1
specify utility which will be used. ^ ^ ^
[namespace]---+ | |
[type]----+ |
[name]--+
To specify main diff program set DIFF_CMD variable (its default value is «diff -u --color=always»). $ kubectl compare zookeeper/pod/zookeeper-{0,1,2}
Use something like diff3 to compare 3 manifests. =head1 BUGS
EXAMPLE: If you find a bug, please report it at B<L<https://code.envrm.info/src/scripts-kubernetes>>.
$ $(basename "$0") -n zookeeper -t pod zookeeper-0 zookeeper-1 =head1 AUTHORS
$ $(basename "$0") -n zookeeper pod/zookeeper-0 pod/zookeeper-1
$ $(basename "$0") zookeeper/pod/zookeeper-0 zookeeper/pod/zookeeper-1
^ ^ ^
[namespace]───┘ │ │
[type]────┘ │
[name]──┘
$ $(basename "$0") zookeeper/pod/zookeeper-{0,1,2} envrm B<L<https://code.envrm.info>>.
EOF =cut
MAN
exit "${1:0}"
set -o pipefail
if [ -z "$DIFF_CMD" ]; then
DIFF_CMD="diff -u --color=always"
fi
if [ -z "$VISUAL_DIFF_CMD" ]; then
VISUAL_DIFF_CMD="vim -d --cmd 'autocmd BufRead * set filetype=yaml'"
fi
# Default Kubernetes namespace
NAMESPACE=default
# Default Kubernetes resource
TYPE=pod
usage() {
sed -E -n '/^.*MAN/,/^MAN$/{//!p;}; /^MAN$/q' "$0" | sed -E 's/=head. |[LIBC]<|\b>*//g; /=cut/d'
exit "${1:0}"
} }
die() { die() {

46
kubectl-http → scripts/kubectl-http

@ -16,6 +16,38 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
: <<'MAN'
=head1 NAME
kubectl-http is a wrapper for I<`kubectl proxy'> command which shows links to resources.
=head1 USAGE
kubectl http [all|pods|services] [standard kubectl selectors]
=head1 OPTIONS
-h --help = show this help
-hl --hyperlinks = use terminal emulator's hyperlinks feature
Basic selectors:
all pods and services
po pod pods pods
svc service services services
=head1 BUGS
If you find a bug, please report it at B<L<https://code.envrm.info/src/scripts-kubernetes>>.
=head1 AUTHORS
envrm B<L<https://code.envrm.info>>.
=cut
MAN
rstc="\033[00m" rstc="\033[00m"
blue="\033[1;36m" blue="\033[1;36m"
green="\033[1;32m" green="\033[1;32m"
@ -52,20 +84,8 @@ hr() {
} }
usage() { usage() {
echo -e "$(basename "$0") is a wrapper for \`kubectl proxy' command which shows links to resources.\n" sed -E -n '/^.*MAN/,/^MAN$/{//!p;}; /^MAN$/q' "$0" | sed -E 's/=head. |[LIBC]<|\b>*//g; /=cut/d'
echo -e "USAGE: $(basename "$0" | tr '-' ' ') [all|pods|services] [standard kubectl selectors]\n"
echo -e "Command line arguments:"
echo -e " -h --help show this help"
echo -e " -hl --hyperlinks use terminal emulator's hyperlinks feature"
echo
echo -e "Basic selectors:"
echo -e " all pods and services"
echo -e " po pod pods pods"
echo -e " svc service services services"
echo
exit "${1:-0}" exit "${1:-0}"
} }

24
kubectl-ingress → scripts/kubectl-ingress

@ -16,10 +16,26 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
## : <<'MAN'
## kubectl-ingress is a wrapper for 'kubectl get ingress` command which
## makes links clickable. =head1 NAME
##
kubectl-ingress is a wrapper for I<`kubectl get ingress'> command which makes links clickable.
=head1 USAGE
kubectl ingress [standard kubectl selectors]
=head1 BUGS
If you find a bug, please report it at B<L<https://code.envrm.info/src/scripts-kubernetes>>.
=head1 AUTHORS
envrm B<L<https://code.envrm.info>>.
=cut
MAN
echo -e "$(sed 's!(([[:alpha:]](-?[[:alnum:]])*)\.)+[[:alpha:]]{2,}!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g; echo -e "$(sed 's!(([[:alpha:]](-?[[:alnum:]])*)\.)+[[:alpha:]]{2,}!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g;
s!((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g s!((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])!\\e]8;;http://\0\\e\\\\\0\\e]8;;\\e\\!g

35
kubectl-secret → scripts/kubectl-secret

@ -16,15 +16,34 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
: <<'MAN'
=head1 NAME
kubectl-secret is a wrapper for I<`kubectl get secret'> to decoding secrets automatically.
=head1 USAGE
kubectl secret [-h|-d|-s] [standard kubectl selectors]
=head1 OPTIONS
-h --help = show this help
-s --simple = show only secrets
-d --decode = show decoded data as plain text (by default it shows under the link)
=head1 BUGS
If you find a bug, please report it at B<L<https://code.envrm.info/src/scripts-kubernetes>>.
=head1 AUTHORS
envrm B<L<https://code.envrm.info>>.
=cut
MAN
usage() { usage() {
echo -e "$(basename "$0") is a wrapper for \`kubectl get secret' to decoding secrets automatically.\n" sed -E -n '/^.*MAN/,/^MAN$/{//!p;}; /^MAN$/q' "$0" | sed -E 's/=head. |[LIBC]<|\b>*//g; /=cut/d'
echo -e "USAGE: $(basename "$0" | tr '-' ' ') [-h|-d|-s] [standard kubectl selectors]\n"
echo -e "Command line arguments:"
echo -e " -h --help show this help"
echo -e " -s --simple show only secrets"
echo -e " -d --decode show decoded data as plain text"
echo -e " (by default it shows under the link)\n"
exit "${1:-0}" exit "${1:-0}"
} }

0
kubectl-secrets → scripts/kubectl-secrets

Loading…
Cancel
Save