npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

uucloud-k8s-cli

v2.7.6

Published

An amazing command line tool allowing you to verify your k8s deployments.

Downloads

851

Readme

uucloud-k8s-cli

ume-deployment-checker becomes uucloud-k8s-cli with the v2 release 🙌

ume-deployment-checker is no longer maintained as uucloud-k8s-cli project is its direct successor and extends the feature pallet to not only provide check features, but much more.

Installation

npm install -g uucloud-k8s-cli

Usage

uucloud-k8s <command> <command parameters>

Commands

help      Display help
check     Performs checks based on given parameters and configuration.
print     Performs print based on given parameters and configuration. Result is printed into the defined bookkit page.
update    Performs update of the node selectors based on the configuration right in the k8s cluster.
scaleUp   Scale uuApps up according to configuration.
scaleDown Scale uuApps down according to configuration.
overview  Performs overview of multiple environments at once.
version   Show tool version.

Parameters

--command string

check, help commands. All these can be used as default commands without providing --command argument.

-c, --config string

Base configuration folder path containing env.json files with contexts.json for each environment.

-e, --environment string

Environment name defined in the base configuration folder unde the filename [env].json.

-v, --version

Display version of all uuApps deployed in the given environment.

-r, --rts

Display runtime stack of all uuApps deployed in the given environment.

-d, --deployment

Display and verify number and status of deployed uuApps in the given environment.

-u, --uri

Display uuApp deployment URI of all uuApps deployed in the given environment.

-n, --nodesize

Display uuApp node size of all uuApps deployed in the given environment.

--memory

Display uuApp RAM of all uuApps deployed in the given environment.

--cpu

Display uuApp CPU of all uuApps deployed in the given environment.

--status

Display container uuApp status.

--volume

Display and verify uuApp volume mount.

-t, --table

Diplay the ouput in the table form.

--problemReportToBookkit

Flag applicable for the print task only. Task prints problems only to the specific bookkit page.

--problemReportToEmail

Flag applicable for the print task only. Task reports problems via e-mail notification. Can be used for both, print and check task.

Configuration

Starting the 2.4.2 release, the format of the configuration files is in JS instead of JSON

[env].js, i.e. env1.js

module.exports = {
  "uu-app-name": {
    "required": true, // identify whether should be checked by the tool at all
    "count": 1, // how many instances of the given uuApp with "uu-app-name" expected 
    "nodeSelectors": [ // expected node selectors, verified with deep equality
      {
        "key": "kind",
        "operator": "In",
        "values": [
          "app-mpls1"
        ],
        "nodeSize": "NODESIZE_NAME"  
      },
      {
        "key": "archive",
        "operator": "NotIn",
        "values": [
          "not"
        ]
      }
    ]
  },
  ...

contexts.js

module.exports = [
  {
    "environment": "env1", // environment name, with same name the env1.json file must exist in the same folder
    "context": "env1-context-name", // k8s cluster name to which the tool will switch context via kubectl
    "nameSpace": "env1-namespace-name" // cluster namespace where the environment lives
  },
  ...
]

nodesizes.js

module.exports = {
  "NODESIZE_NAME": {
    "cpu": "1",
    "memory": "512Mi"
  },
  ...
}

// Another option is to define array of values. This might get handy if different representations are used for the same value.
{
  "NODESIZE_NAME": {
    "cpu": ["1", "1000m"],
    "memory": ["512Mi", "512"]
  },
  ...
}

bookkit-config.js

module.exports = {
  "accessCode1": "...", // login credentials to bookkit (user must have privileges to mannipulate with the book content)
  "accessCode2": "...", // login credentials to bookkit (user must have privileges to mannipulate with the book content)
  "oidcHost": "...", // oidc/grantToken uri
  "uri": "...", // book base uri
  "overview": {
    "page": "...", // page coge
    "sections": {
       // section codes 
      "DEPLOYMENT": "...",
      "NODE_SIZE": "...",
      "SUM": "..."
    }
  },
  "environment": {
    "env1": { // environment name, with same name the env1.json file must exist in the same folder
      // page and sections codes must already exist in the book. Sections will be updated with content from the uucloud-k8s-cli
      "page": "env1-page-code",
      "sections": {
        // section codes for each check in the given bookkit page.
        "DEPLOYMENT": "",
        "NODE_SIZE": "...",
        "VERSION": "...",
        "RUNTIME_STACK": "...",
        "UUAPP_DEPLOYMENT_URI": "...",
        "MEMORY": "...",
        "CPU": "...",
        "CONTAINER_STATUS": "..."
      },
      // page for reporting the problems only - with this configuration you can have all problems from all environments in one place
      "problemReport": {
        "page": "...",
        "section": "..."
      }
    },
    ...
  }
}

email-config.js

module.exports = {
    "transportsConfiguration": {
        "auth": {
            "pass": "password",
            "user": "username"
        },
        "host": "email server address",
        "port": 465, 
        "secure": true
    },
    "recipients": [
        "recepient list email addresses"
    ]
}

Logs

logs are automatically stored to the %HOME%/.uucloud-k8s/logs folder