-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a211b1e
commit e09550d
Showing
13 changed files
with
99 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
examples/vib.alexandre.mahdhaoui.com_v1alpha1.expressionset.alias.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: vib.alexandre.mahdhaoui.com/v1alpha1 | ||
kind: ExpressionSet | ||
metadata: | ||
name: alias | ||
spec: | ||
keyValues: | ||
- grep: grep --color=always | ||
- less: less -N | ||
- ls: ls --color=always | ||
- ll: ls -laF | ||
- h: helm | ||
- hi: helm upgrade --install | ||
- hid: h install --dry-run | ||
- hdu: h dependency update | ||
resolverRef: alias |
10 changes: 10 additions & 0 deletions
10
examples/vib.alexandre.mahdhaoui.com_v1alpha1.expressionset.env.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: vib.alexandre.mahdhaoui.com/v1alpha1 | ||
kind: ExpressionSet | ||
metadata: | ||
name: env | ||
spec: | ||
keyValues: | ||
- GOPATH: $(go env GOPATH) | ||
- GOBIN: ${GOPATH}/bin | ||
- PATH: ${PATH}:${GOBIN} | ||
resolverRef: environment-exported |
65 changes: 65 additions & 0 deletions
65
examples/vib.alexandre.mahdhaoui.com_v1alpha1.expressionset.kubectl.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: vib.alexandre.mahdhaoui.com/v1alpha1 | ||
kind: ExpressionSet | ||
metadata: | ||
name: kubectl | ||
spec: | ||
keyValues: | ||
- k: kubectl "${@}" | ||
- ka: kubectl apply -f "${@}" | ||
- kns-current: kubectl config view --minify -o jsonpath='{..namespace}' | ||
- kctx: |- | ||
__err_no_match() { echo Cannot match context with pattern \"${1}\"; } | ||
CONTEXT_PATTERN="${1}" | ||
CONTEXTS="$(kubectl config get-contexts -oname)" | ||
if [ -z "${CONTEXT_PATTERN}" ]; then echo "${CONTEXTS}"; return ;fi | ||
# select between available context from the CONTEXT_MATCH | ||
# - if no match: return err no match | ||
# - if and only if 1 match: don't prompt for selection and use this context | ||
CONTEXT_MATCH=$(echo "${CONTEXTS}" | grep --color=none "${CONTEXT_PATTERN}") | ||
if [ -z "${CONTEXT_MATCH}" ]; then __err_no_match "${CONTEXT_PATTERN}"; return 1; fi | ||
CONTEXT_SELECTED="" | ||
if [ $(echo ${CONTEXT_MATCH} | wc -w) == "1" ]; then | ||
CONTEXT_SELECTED="${CONTEXT_MATCH}" | ||
else | ||
PS3="Please select a context: " | ||
select X in ${CONTEXT_MATCH}; do | ||
CONTEXT_SELECTED="${X}" | ||
break | ||
done | ||
fi | ||
if [ -z "${CONTEXT_SELECTED}" ]; then echo Please select a context; return 1; fi | ||
# Use context on selected context | ||
kubectl config use-context "${CONTEXT_SELECTED}" &&\ | ||
echo Successfully selected context \"${CONTEXT_SELECTED}\" ||\ | ||
echo Failed to select context \"${CONTEXT_SELECTED}\" | ||
- kd: kubectl describe "${@}" | ||
- kdds: kubectl describe daemonset "${@}" | ||
- kdp: kubectl describe pod "${@}" | ||
- kdrs: kubectl describe replicaset "${@}" | ||
- kdsts: kubectl describe statefulset "${@}" | ||
- ke: kubectl edit "${@}" | ||
- kex: kubectl exec -it "${@}" | ||
- kg: kubectl get "${@}" | ||
- kga: kubectl get -A "${@}" | ||
- kgp: kubectl get pods "${@}" | ||
- kgpa: kubectl get pods -A "${@}" | ||
- kgd: kubectl get deployments "${@}" | ||
- kgsts: kubectl get sts "${@}" | ||
- kgrs: kubectl get rs "${@}" | ||
- kgg: kubectl get "${1}" | grep "${2}" | ||
- kgga: kubectl get "${1}" -A | grep "${2}" | ||
- kns: |- | ||
NAMESPACE="${1:-default}" | ||
kubectl config set-context --current --namespace "${NAMESPACE}" && echo Successfully switched to namespace: \"${NAMESPACE}\" | ||
- kl: kubectl logs "${@}" | ||
- kll: kubectl logs -l "${@}" | ||
- klp: kubectl logs --previous "${@}" | ||
- klf: kubectl logs -f "${@}" | ||
- kpf: kubectl port-forward "${@}" | ||
resolverRef: function |
9 changes: 9 additions & 0 deletions
9
examples/vib.alexandre.mahdhaoui.com_v1alpha1.profile.myprofile.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: vib.alexandre.mahdhaoui.com/v1alpha1 | ||
kind: Profile | ||
metadata: | ||
name: myprofile | ||
spec: | ||
setRefs: | ||
- env | ||
- alias | ||
- kubectl |