当前位置: 首页 > news >正文

一种删除 KubeSphere 中一直卡在 Terminating 的 Namespace--KubeSphere Logging System的简单方法

文章目录

    • 一、问题提出
    • 二、删除方法
      • 1,获取kubesphere-logging-syste的详细信息json文件
      • 2,编辑kubesphere-logging-system.json
      • 3,执行清理命令
    • 三、检查结果

一、问题提出

在使用 KubeSphere 的时候发现有一个日志服务KubeSphere Logging System,它被创建命名空间为kubesphere-logging-system下。当我们不想使用它,需要删除它时,确一直在 Terminating中,怎么也删除不掉。

kubectl delete ns kubesphere-logging-system  --force --grace-period=0

在这里插入图片描述

二、删除方法

1,获取kubesphere-logging-syste的详细信息json文件

首先 通过以下命令获取 namespace 的详情信息并转为 json。

kubectl get namespace kubesphere-logging-system -o json > kubesphere-logging-system.json

在这里插入图片描述

2,编辑kubesphere-logging-system.json

vim kubesphere-logging-system.json
{"apiVersion": "v1","kind": "Namespace","metadata": {"creationTimestamp": "2023-12-24T23:13:34Z","deletionTimestamp": "2023-12-27T07:49:27Z","labels": {"kubesphere.io/namespace": "kubesphere-logging-system","kubesphere.io/workspace": "system-workspace"},"name": "kubesphere-logging-system","resourceVersion": "2878899","selfLink": "/api/v1/namespaces/kubesphere-logging-system","uid": "dd01ee56-2dee-40ba-b63e-5fc71e27507b"},"spec": {"finalizers": ["kubernetes" # 将此行删除]},"status": {"conditions": [{"lastTransitionTime": "2023-12-27T07:49:35Z","message": "All resources successfully discovered","reason": "ResourcesDiscovered","status": "False","type": "NamespaceDeletionDiscoveryFailure"},{"lastTransitionTime": "2023-12-27T07:49:35Z","message": "All legacy kube types successfully parsed","reason": "ParsedGroupVersions","status": "False","type": "NamespaceDeletionGroupVersionParsingFailure"},{"lastTransitionTime": "2023-12-27T08:47:05Z","message": "All content successfully deleted, may be waiting on finalization","reason": "ContentDeleted","status": "False","type": "NamespaceDeletionContentFailure"},{"lastTransitionTime": "2023-12-27T07:49:35Z","message": "Some resources are remaining: exporters.events.kubesphere.io has 1 resource instances, fluentbits.logging.kubesphere.io has 1 resource instances, rulers.events.kubesphere.io has 1 resource instances","reason": "SomeResourcesRemain","status": "True","type": "NamespaceContentRemaining"},{"lastTransitionTime": "2023-12-27T07:49:35Z","message": "Some content in the namespace has finalizers remaining: exporters.finalizer.events.kubesphere.io in 1 resource instances, fluentbit.logging.kubesphere.io in 1 resource instances, rulers.finalizer.events.kubesphere.io in 1 resource instances","reason": "SomeFinalizersRemain","status": "True","type": "NamespaceFinalizersRemaining"}],"phase": "Terminating"}
}

找到 spec 将 finalizers 下的 kubernetes 删除。

3,执行清理命令

现在我们只需要一条命令 就可以彻底删除这个 Namespace。

kubectl replace --raw "/api/v1/namespaces/kubesphere-logging-system/finalize" -f ./kubesphere-logging-system.json

在这里插入图片描述

三、检查结果

查看namespace kubesphere-logging-system,

kubectl get ns kubesphere-logging-system

已经找不到命名空间kubesphere-logging-system了。
在这里插入图片描述

查看所有命名空间:

kubectl get ns

在这里插入图片描述
再次查看的时候,它已经不存在了!!

http://www.lryc.cn/news/268869.html

相关文章:

  • Flink1.17实战教程(第七篇:Flink SQL)
  • nest定时任务调用service报错
  • [Angular] 笔记 11:可观察对象(Observable)
  • 【论文阅读】Resource Allocation for Text Semantic Communications
  • VMware16 pro 安装openEuler-23.09-x86_64,详细操作流程+详图。
  • Mybatis 动态 SQL - script,bind,多数据库支持
  • Scikit-Learn线性回归(一)
  • Mybatis 动态 SQL - choose, when, otherwise
  • idea Spring Boot项目使用JPA创建与数据库链接
  • redis基础知识
  • 最短路径(数据结构实训)(难度系数100)
  • 基于SSM实现的电动汽车充电网点管理系统
  • Android ImageView如何使用.svg格式图片
  • 力扣热题100道-子串篇
  • day3--Shell
  • 【数据结构】插入排序、选择排序、冒泡排序、希尔排序、堆排序
  • TiDB 7.5 LTS 发版丨提升规模化场景下关键应用的稳定性和成本的灵活性
  • 服务器数据恢复-误操作导致xfs分区数据丢失的数据恢复案例
  • 安装Kubernetes1.23、kubesphere3.4、若依项目自动打包部署到K8S记录
  • (三) `MaterializedMySQL`同步机制解读
  • 使用 stream 流构建树(不使用递归)
  • docker 部署 个人网页版 wps office
  • windows进行udp端口转发,解决项目中服务器收不到组播数据的问题
  • 抖音、小红书、视频号是如何判定是否限流的?
  • frida native hook 技术( frida hook so层函数)
  • SpringBoot运维(三)-- 多环境开发(yml多文件版)
  • Vue 修饰符有哪些
  • 哈希桶的模拟实现【C++】
  • 磁盘相关知识
  • FTP原理与配置