Coder Social home page Coder Social logo

kubernetes-scripts's Issues

Command for running a temporary container

Hi there

Fine list of scripts, thank you for these.

I would have one addition. The use of the generator flag throws a warning because it has been deprecated.
kubectl run --generator=run-pod/v1 my-ubuntu --rm -i -t --image ubuntu -- bash

I think we should use the command like this now:
kubectl run my-ubuntu --rm -i -t --image ubuntu -- bash

Not sure if it helps, just an input ;)

kindly, riscie

namespace flag not working for multiple scripts

looks like string interpolation fails, here is the error after enabling set -xv. Error occurs for getPodsTopCSV.sh, getResourcesCSV.sh, and getRestartingPods.sh.

> ./getPodsTopCSV.sh --namespace dev01 --pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x
######### Main #########

main "$@"
+ main --namespace dev01 --pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x
+ processOptions --namespace dev01 --pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x
+ [[ 4 -gt 0 ]]
+ case "$1" in
+ NAMESPACE='--namespace dev01'
+ shift 2
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ POD=dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x
+ shift 2
+ [[ 0 -gt 0 ]]
+ '[' -z dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x ']'
+ '[' false == true ']'
+ echo 'Getting Pod memory and cpu usage'
Getting Pod memory and cpu usage
+ testConnection
+ kubectl cluster-info
+ kubectl get pod '--namespace dev01' dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x
Error: unknown flag: --namespace dev01
See 'kubectl get --help' for usage.
+ errorExit 'Pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x not found in namespace --namespace dev01'
+ echo -e '\nERROR: Pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x not found in namespace --namespace dev01\n'

ERROR: Pod dev01-prometheus-postgres-exporter-7c5bf75df4-rbn7x not found in namespace --namespace dev01

+ exit 1

bash info

> bash --version
GNU bash, version 5.0.18(1)-release (x86_64-apple-darwin18.7.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

system info

> uname -a
Darwin bhutwala-mac 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 18 20:50:10 PDT 2020; root:xnu-4903.278.43~1/RELEASE_X86_64 x86_64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.