<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>kubectl on Shaowen Chen's Website</title><link>https://www.chenshaowen.com/en/tags/kubectl/</link><description>Recent content in kubectl on Shaowen Chen's Website</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&amp;copy;2016 - {year}, All Rights Reserved.</copyright><lastBuildDate>Wed, 08 Dec 2021 00:00:00 +0000</lastBuildDate><sy:updatePeriod>weekly</sy:updatePeriod><atom:link href="https://www.chenshaowen.com/en/tags/kubectl/atom.xml" rel="self" type="application/rss+xml"/><item><title>Common Commands for Cleaning Up Kubernetes Cluster Resources</title><link>https://www.chenshaowen.com/en/blog/common-commands-for-cleaning-up-kubernetes-cluster-resources.html</link><pubDate>Wed, 08 Dec 2021 00:00:00 +0000</pubDate><atom:modified>Wed, 08 Dec 2021 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/common-commands-for-cleaning-up-kubernetes-cluster-resources.html</guid><description>Clusters that run for a long time often face various kinds of resource exhaustion. On top of that, when disk space runs low, Kubelet will proactively clean up images on its own, adding another source of uncertainty. This article provides some command snippets for cleanup work.
1. Cleaning Up Basic Kubernetes Objects Clean up Pods in Evicted state 1 sudo kubectl get pods --all-namespaces -o wide | grep Evicted | awk &amp;#39;{print $1,$2}&amp;#39; | sudo xargs -L1 kubectl delete pod -n Clean up Pods in Error state 1 sudo kubectl get pods --all-namespaces -o wide | grep Error | awk &amp;#39;{print $1,$2}&amp;#39; | sudo xargs -L1 kubectl delete pod -n Clean up Pods in Completed state 1 sudo kubectl get pods --all-namespaces -o wide | grep Completed | awk &amp;#39;{print $1,$2}&amp;#39; | sudo xargs -L1 kubectl delete pod -n Clean up unused PVs 1 sudo kubectl describe -A pvc | grep -E &amp;#34;^Name:.</description><dc:creator>微信公众号</dc:creator><category>Kubernetes</category><category>Practice</category><category>Cleanup</category><category>Operations</category><category>Learning</category><category>kubectl</category><category>Troubleshooting</category><category>Resource Management</category></item><item><title>Kubernetes Cluster Operations in Practice</title><link>https://www.chenshaowen.com/en/blog/kubernetes-cluster-operations-practices.html</link><pubDate>Thu, 22 Aug 2019 00:00:00 +0000</pubDate><atom:modified>Thu, 22 Aug 2019 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/kubernetes-cluster-operations-practices.html</guid><description>Compiled from the &amp;ldquo;Development Tips&amp;rdquo; series, gathering the common problems and solutions from day-to-day Kubernetes cluster operations.
1. Configuring Multiple Clusters with Kubectl When doing Kubernetes-related development you usually end up managing several clusters. Kubectl provides multi-cluster context management.
Kubectl&amp;rsquo;s configuration usually lives in $HOME/.kube/config or /etc/kubernetes/admin.conf. Log into the machine, look at the cluster configuration, and edit it using the format below.</description><dc:creator>微信公众号</dc:creator><category>Kubernetes</category><category>Operations</category><category>R&amp;D</category><category>kubectl</category><category>Helm</category></item><item><title>A Practical Guide to kubectl</title><link>https://www.chenshaowen.com/en/blog/practice-guide-to-kubectl.html</link><pubDate>Fri, 19 Jul 2019 01:00:00 +0000</pubDate><atom:modified>Fri, 19 Jul 2019 01:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/practice-guide-to-kubectl.html</guid><description>1. What Is kubectl kubectl is the command-line tool for Kubernetes. It interacts with the cluster through the API server.
2. Configuring kubectl kubectl can be configured through ~/.kube/config to connect to one or more clusters.
For details on how to configure it, see: Configure Access to Multiple Clusters. If you need to configure a remote cluster, see: Building a Remote Kubernetes Development Environment.</description><dc:creator>微信公众号</dc:creator><category>Kubernetes</category><category>kubectl</category><category>Practice</category><category>Learning</category><category>Operations</category></item><item><title>Enabling Kubernetes Monitoring and Stress Testing</title><link>https://www.chenshaowen.com/en/blog/open-k8s-monitoring-and-stress-testing..html</link><pubDate>Mon, 24 Sep 2018 00:00:00 +0000</pubDate><atom:modified>Mon, 24 Sep 2018 00:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/open-k8s-monitoring-and-stress-testing..html</guid><description>1. Kubectl Basic Commands 1.1 Creating Objects 1 2 3 4 5 6 7 8 # Create resources; a remote URL also works kubectl create -f ./my.yaml # Create resources from multiple files kubectl create -f ./my1.yaml -f ./my2.yaml # Create resources using all manifest files in a directory kubectl create -f .</description><dc:creator>微信公众号</dc:creator><category>Kubernetes</category><category>Testing</category><category>Monitoring</category><category>Operations</category><category>Learning</category><category>kubectl</category><category>Stress Testing</category><category>Observability</category></item></channel></rss>