電腦如何設置終端設置代理_如何設置一個嚴肅的Kubernetes終端

電腦如何設置終端設置代理

by Chris Cooney

克里斯·庫尼(Chris Cooney)

如何設置一個嚴肅的Kubernetes終端 (How to set up a serious Kubernetes terminal)

所有k8s書呆子需要的CLI工具 (All the CLI tools a growing k8s nerd needs)

Kubernetes comes pre-packaged with an outstanding CLI. For basic operations, it works wonderfully. Alas, when one needs to do something quickly, complexity increases.

Kubernetes預先打包了出色的CLI。 對于基本操作,它的運行非常出色。 las,當需要快速執行某項操作時,復雜性就會增加。

The Kubernetes community has built all sorts of web based tooling for monitoring your cluster — kube ops view, grafana etc. However, having a fully kitted terminal will rapidly speed up the time it takes to get to the root of an issue. It forms a fundamental part of your Swiss army knife.

Kubernetes社區已經構建了各種基于Web的工具來監視您的集群— kube ops view , grafana等。但是,擁有完整的終端設備將Swift加快解決問題根源的時間。 它構成了瑞士軍刀的基本組成部分。

The following is a very short list of open source tools that I’ve applied to my OSX terminal. When used together, they allow me to skip around my kubernetes cluster, quickly troubleshoot issues, and monitor behaviour. I’ve cut out lots of small little utilities and stuck to the tools that I find myself using every day.

以下是我已應用于OSX終端的開源工具的簡短列表。 一起使用時,它們使我可以跳過kubernetes集群,快速解決問題并監控行為。 我刪除了許多小的實用程序,并堅持使用每天都能使用的工具。

在使用任何工具之前…… (Before any tools…)

Before you go after these tools, I’d strongly recommend installing zsh. It is an outstanding, open source wrapper around the standard OSX terminal. It is more feature rich and intuitive and the plugins you can install are fantastic. Some of these tools listed make the assumption you have ZSH installed.

在使用這些工具之前,我強烈建議您安裝zsh 。 它是圍繞標準OSX終端的出色的開源包裝器。 它具有豐富的功能和直觀的功能,您可以安裝的插件很棒。 列出的其中一些工具假定您已安裝ZSH。

9秒 (k9s)

I’m starting strong. K9s is the momma bear of CLI tools for kubernetes cluster. You can SSH straight into pods with a single key press, view logs, delete resources and more. It provides outstanding access for the most common operations you’ll be performing. This is a staple for any engineer using kubernetes.

我開始堅強。 K9s是用于Kubernetes集群的CLI工具的后盾。 您可以通過一次按鍵直接SSH到pod中,查看日志,刪除資源等等。 它為您將執行的最常見操作提供了出色的訪問權限。 對于使用kubernetes的任何工程師來說,這都是最重要的。

kubectx (kubectx)

But one thing that K9s doesn’t support is switching between various contexts in your kubernetes config. It is very rare that we’ll only have one single cluster. Switching between these is as simple as

但是K9s不支持的一件事是在kubernetes配置中的各種上下文之間切換。 我們只有一個集群是非常罕見的。 這些之間的切換非常簡單

kubectl config use-context my-context

But with this, there are some prerequisites:

但是,這樣做有一些先決條件:

  • You need to know the name of the cluster before you run.

    在運行之前,您需要知道集群的名稱。
  • There is another, similar set-context command that could trip you up.

    還有另一個類似的set-context命令可以使您崩潰。

kubectx presents a simpler alternative to this. If you run kubectx on its own, it will list out all of the contexts in your .kube/config file. You can then provide the name of the context you’re interested in:

kubectx提供了一個更簡單的替代方法。 如果您kubectx運行kubectx ,它將在.kube/config文件中列出所有上下文。 然后,您可以提供您感興趣的上下文的名稱:

kubectx my-context

No need to remember all the contexts, no need to manually check files and no possibility of getting the wrong command. Nice and simple. Combined with k9s, this offers a lot of navigability from your CLI with minimal key presses.

無需記住所有上下文,無需手動檢查文件,也無需獲取錯誤的命令。 漂亮又簡單。 與k9s結合使用k9s ,只需最少的按鍵k9s ,就可以從CLI進行很多導航。

庫本斯 (kubens)

Once you’re flitting around contexts, you may want to dig into a specific namespace. Once again, it’s very common to have more than a few namespaces in your cluster. Well, ahmetb (the gentleman who brought you kubectx) also put together kubens. It’s the same as kubectx, only for namespaces.

一旦在上下文中四處游蕩,您可能想要挖掘特定的名稱空間。 再一次,在集群中擁有多個命名空間是很常見的。 那么, ahmetb (誰把你的紳士kubectx )也放在一起kubens 。 它與kubectx相同,僅適用于名稱空間。

kubens kube-system

Now all of your commands run against the kube-system namespace, by default. You can also run kubens without anything else to see a list of your namespaces.

現在,默認情況下,所有命令都針對kube-system名稱空間運行。 您也可以不帶其他任何內容運行kubens來查看名稱空間列表。

kube-ps1 (kube-ps1)

So, you can switch between contexts and namespaces. But how do you know which one you’re currently aimed at? It’s a pain to keep checking. At the moment, to find out you’d need to run:

因此,您可以在上下文和名稱空間之間切換。 但是,您怎么知道您當前針對的是哪一個呢? 不斷檢查很痛苦。 目前,要找出答案,您需要運行:

kubens
kubectx
kubectl <my-command>

To remove this, ps1 is a zsh plugin that will automatically show you your current context and namespace:

要刪除此問題, ps1是一個zsh插件,它將自動向您顯示您當前的上下文和名稱空間:

Now you can see which namespace and context you’re pointing out without running a single command. It’s also highly configurable too — you can turn off namespace or context, if you’re only interested in one of them, or you can use kubeoff to disable the whole thing entirely.

現在,您無需運行任何命令即可查看要指出的名稱空間和上下文。 它也是高度可配置的-如果您只對名稱空間或上下文之一感興趣,則可以將其關閉,也可以使用kubeoff完全禁用整個對象。

大力水手 (popeye)

Now, onto something a little different. popeye will run automatic scans of the resources in your repository and highlight clear, obvious problems. This is a very new tool and one that I have found very useful. If you’re looking for some spring cleaning to do in your cluster, starting with popeye will give you some clear indications of what needs to be fixed.

現在,到一些不同的地方。 popeye將對存儲庫中的資源進行自動掃描,并突出顯示明顯的明顯問題。 這是一個非常新的工具,我發現它非常有用。 如果您要在集群中進行一些Spring大掃除,那么從popeye開始將為您提供一些需要修復的明確指示。

船尾 (Stern)

Ever used kubectl logs? Noticed you can only follow logs from one pod at one time? Well, worry no more! Stern is a tool that allows you to pull the logs from multiple pods, based on a very flexible query.

曾經使用過kubectl logs嗎? 是否注意到您一次只能跟蹤一個吊艙中的日志? 好吧,不用擔心! Stern是一種工具,可讓您基于非常靈活的查詢從多個Pod中提取日志。

I’m talking regularly about kubernetes, DevOps and much more on my twitter account.

我經常在Twitter帳戶上談論kubernetes,DevOps以及更多內容。

翻譯自: https://www.freecodecamp.org/news/how-to-set-up-a-serious-kubernetes-terminal-dd07cab51cd4/

電腦如何設置終端設置代理

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/391706.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/391706.shtml
英文地址,請注明出處:http://en.pswp.cn/news/391706.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

spring cloud(二)

1. Feign應用 Feign的作用&#xff1b;使用Feign實現consumer-demo代碼中調用服務 導入啟動器依賴&#xff1b;開啟Feign功能&#xff1b;編寫Feign客戶端&#xff1b;編寫一個處理器ConsumerFeignController&#xff0c;注入Feign客戶端并使用&#xff1b;測試 <dependen…

c/c++編譯器的安裝

MinGW(Minimalist GNU For Windows)是個精簡的Windows平臺C/C、ADA及Fortran編譯器&#xff0c;相比Cygwin而言&#xff0c;體積要小很多&#xff0c;使用較為方便。 MinGW最大的特點就是編譯出來的可執行文件能夠獨立在Windows上運行。 MinGW的組成&#xff1a; 編譯器(支持C、…

滲透工具

滲透工具 https://blog.csdn.net/Fly_hps/article/details/89306104 查詢工具 https://blog.csdn.net/Fly_hps/article/details/89070552 轉載于:https://www.cnblogs.com/liuYGoo/p/11347693.html

numpy 線性代數_數據科學家的線性代數—用NumPy解釋

numpy 線性代數Machine learning and deep learning models are data-hungry. The performance of them is highly dependent on the amount of data. Thus, we tend to collect as much data as possible in order to build a robust and accurate model. Data is collected i…

spring 注解方式配置Bean

概要&#xff1a; 再classpath中掃描組件 組件掃描&#xff08;component scanning&#xff09;&#xff1a;Spring可以從classpath下自己主動掃描。偵測和實例化具有特定注解的組件特定組件包含&#xff1a; Component&#xff1a;基本注解。標示了一個受Spring管理的組件&…

主成分分析 獨立成分分析_主成分分析概述

主成分分析 獨立成分分析by Moshe Binieli由Moshe Binieli 主成分分析概述 (An overview of Principal Component Analysis) This article will explain you what Principal Component Analysis (PCA) is, why we need it and how we use it. I will try to make it as simple…

擴展方法略好于幫助方法

如果針對一個類型實例的代碼片段經常被用到&#xff0c;我們可能會想到把之封裝成幫助方法。如下是一段針對DateTime類型實例的一段代碼&#xff1a;class Program{static void Main(string[] args){DateTime d new DateTime(2001,5,18);switch (d.DayOfWeek){case DayOfWeek.…

零元學Expression Blend 4 - Chapter 25 以Text相關功能就能簡單做出具有設計感的登入畫面...

原文:零元學Expression Blend 4 - Chapter 25 以Text相關功能就能簡單做出具有設計感的登入畫面本章將交大家如何運用Blend 4 內的Text相關功能做出有設計感的登入畫面 讓你五分鐘就能快速做出一個登入畫面 ? 本章將教大家如何運用Blend 4 內的Text相關功能做出有設計感的登入…

leetcode 395. 至少有 K 個重復字符的最長子串(滑動窗口)

給你一個字符串 s 和一個整數 k &#xff0c;請你找出 s 中的最長子串&#xff0c; 要求該子串中的每一字符出現次數都不少于 k 。返回這一子串的長度。 示例 1&#xff1a; 輸入&#xff1a;s “aaabb”, k 3 輸出&#xff1a;3 解釋&#xff1a;最長子串為 “aaa” &…

冠狀病毒時代的負責任數據可視化

First, a little bit about me: I’m a data science grad student. I have been writing for Medium for a little while now. I’m a scorpio. I like long walks on beaches. And writing for Medium made me realize the importance of taking personal responsibility ove…

集合_java集合框架

轉載自http://blog.csdn.net/zsw101259/article/details/7570033 Java集合框架圖 簡化圖&#xff1a; Java平臺提供了一個全新的集合框架。“集合框架”主要由一組用來操作對象的接口組成。不同接口描述一組不同數據類型。 1、Java 2集合框架圖 ①集合接口&#xff1a;6個…

顯示隨機鍵盤

顯示隨機鍵盤 1 <!DOCTYPE html>2 <html lang"zh-cn">3 <head>4 <meta charset"utf-8">5 <title>7-77 課堂演示</title>6 <link rel"stylesheet" type"text/css" href"style…

數據特征分析-統計分析

一、統計分析 統計分析是對定量數據進行統計描述&#xff0c;常從集中趨勢和離中趨勢兩個方面分析。 集中趨勢&#xff1a;指一組數據向某一中心靠攏的傾向&#xff0c;核心在于尋找數據的代表值或中心值-統計平均數&#xff08;算數平均數和位置平均數&#xff09; 算術平均數…

心學 禪宗_禪宗宣言,用于有效的代碼審查

心學 禪宗by Jean-Charles Fabre通過讓查爾斯法布爾(Jean-Charles Fabre) 禪宗宣言&#xff0c;用于有效的代碼審查 (A zen manifesto for effective code reviews) When you are coding, interruptions really suck.當您編碼時&#xff0c;中斷確實很糟糕。 You are in the …

leetcode 896. 單調數列

如果數組是單調遞增或單調遞減的&#xff0c;那么它是單調的。 如果對于所有 i < j&#xff0c;A[i] < A[j]&#xff0c;那么數組 A 是單調遞增的。 如果對于所有 i < j&#xff0c;A[i]> A[j]&#xff0c;那么數組 A 是單調遞減的。 當給定的數組 A 是單調數組…

數據eda_銀行數據EDA:逐步

數據edaThis banking data was retrieved from Kaggle and there will be a breakdown on how the dataset will be handled from EDA (Exploratory Data Analysis) to Machine Learning algorithms.該銀行數據是從Kaggle檢索的&#xff0c;將詳細介紹如何將數據集從EDA(探索性…

結構型模式之組合

重新看組合/合成&#xff08;Composite&#xff09;模式&#xff0c;發現它并不像自己想象的那么簡單&#xff0c;單純從整體和部分關系的角度去理解還是不夠的&#xff0c;并且還有一些通俗的模式講解類的書&#xff0c;由于其舉的例子太過“通俗”&#xff0c;以致讓人理解產…

計算機網絡原理筆記-三次握手

三次握手協議指的是在發送數據的準備階段&#xff0c;服務器端和客戶端之間需要進行三次交互&#xff1a; 第一次握手&#xff1a;客戶端發送syn包(synj)到服務器&#xff0c;并進入SYN_SEND狀態&#xff0c;等待服務器確認&#xff1b; 第二次握手&#xff1a;服務器收到syn包…

VB2010 的隱式續行(Implicit Line Continuation)

VB2010 的隱式續行&#xff08;Implicit Line Continuation&#xff09;許多情況下,您可以讓 VB 后一行繼續前一行的語句&#xff0c;而不必使用下劃線&#xff08;_&#xff09;。下面列舉出隱式續行語法的使用情形。1、逗號“&#xff0c;”之后PublicFunctionGetUsername(By…

flutter bloc_如何在Flutter中使用Streams,BLoC和SQLite

flutter blocRecently, I’ve been working with streams and BLoCs in Flutter to retrieve and display data from an SQLite database. Admittedly, it took me a very long time to make sense of them. With that said, I’d like to go over all this in hopes you’ll w…