随笔分类 -  K8S

K8S相关文档
摘要:K8S-secrets拉取私有镜像##K8S-secrets拉取私有镜像 ```sh #使用docker login登录 [root@test-node1 ~]# docker login -u username -p passwd harbor.com #使用secrets-响应式 kubectl create secret -n 阅读全文
posted @ 2023-06-29 10:49 安生丶 阅读(158) 评论(0) 推荐(0) 编辑
摘要:K8S-SidecarSet详解## K8S-SidecarSet ```sh SidecarSet是Kubernetes的一个CRD(Custom Resource Definition),扩展自Deployments API Group,主要用于在Pod里注入一个或多个辅助容器(sidecar container)。 Side 阅读全文
posted @ 2023-06-12 11:12 安生丶 阅读(563) 评论(0) 推荐(0) 编辑
摘要:kubectl cp案例```sh #从pod到宿主机 kubectl -n flyby-test cp flyby-tmc-corpapi-68db975948-6fh47:/data/webapps/flyby-tmc-corpapi/logs/info.log ./info.log 从宿主机到pod kubectl 阅读全文
posted @ 2023-06-12 11:10 安生丶 阅读(45) 评论(0) 推荐(0) 编辑
摘要:更换k8s-ingress https证书```sh #先删除证书 kubectl delete secret -n h5 www.baidu.com #在用新的证书创建secret kubectl create secret tls h5.flybytrip.com --cert=7726759__baidu.com.pem --key= 阅读全文
posted @ 2023-06-12 11:09 安生丶 阅读(326) 评论(0) 推荐(0) 编辑
摘要:k8s查看资源的api版本```sh #方法1 [root@test-master deployment]# kubectl explain deployment KIND: Deployment VERSION: apps/v1 DESCRIPTION: Deployment enables declarative upd 阅读全文
posted @ 2023-06-12 11:05 安生丶 阅读(174) 评论(0) 推荐(0) 编辑
摘要:K8S secret使用帮助```sh # kubectl create secret docker-registry myregistry --docker-server-私服地址--docker-usename:用护名--docker-passuont-密码--docker-email-部箱 #kubectl get se 阅读全文
posted @ 2023-06-12 10:59 安生丶 阅读(5) 评论(0) 推荐(0) 编辑
摘要:kubectl set image详解```sh [root@woker-cn-hangzhou-172-18-0-106 ]# kubectl set image deployment/flyby-hotel-channel flyby-hotel-channel=registry-vpc.cn-hangzhou.aliyuncs.c 阅读全文
posted @ 2023-06-12 10:58 安生丶 阅读(1582) 评论(0) 推荐(0) 编辑
摘要:K8S节点下线```sh 设置节点不可调度: kubectl cordon node1 驱逐节点上的pod: kubectl drain node1 --ignore-daemonsets --delete-local-data --ignore-daemonsets 如果node节点上存在daemonsets控 阅读全文
posted @ 2023-06-12 10:56 安生丶 阅读(35) 评论(0) 推荐(0) 编辑
摘要:K8S-etcd备份脚本#!/bin/bash #ENDPOINTS="https://192.168.1.207:2379,https://192.168.1.208:2379,https://192.168.1.209:2379" ENDPOINTS="127.0.0.1:2379" CACERT="/etc/kube 阅读全文
posted @ 2023-02-25 14:53 安生丶 阅读(36) 评论(0) 推荐(0) 编辑
摘要:记录一次K8S新节点加入集群报错#问题:新机器加入K8S集群报错 [kubelet-check] The HTTP call equal to ‘curl -sSL http://localhost:10248/healthz’ failed with error: Get“http://localhost:10248/healt 阅读全文
posted @ 2023-02-25 14:51 安生丶 阅读(148) 评论(0) 推荐(0) 编辑
摘要:K8S-hostAliases-配置域名解析##通过服务yaml文件配置 kind: Deployment .... spec: .... spec: hostAliases: - ip: "120.26.68.89" hostnames: - "asrexz.exiaozhi.com" 阅读全文
posted @ 2023-02-25 14:45 安生丶 阅读(122) 评论(0) 推荐(0) 编辑
摘要:K8S污点容忍案例[root@lecode-pre74 ~]# setenforce 0 setenforce: SELinux is disabled [root@lecode-pre74 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux 阅读全文
posted @ 2023-02-25 14:41 安生丶 阅读(28) 评论(0) 推荐(0) 编辑
摘要:zk,kafka,redis哨兵,mysql容器化1. zookeeper,kafka容器化 1.1 zookeeper+kafka单机docker模式 docker pull bitnami/zookeeper:3.6.3-debian-11-r46 docker pull bitnami/kafka:3.1.1-debian-11-r36 do 阅读全文
posted @ 2022-11-17 10:54 安生丶 阅读(484) 评论(0) 推荐(0) 编辑
摘要:K8S之prometheus-operator监控prometheus-operator 1. Prometheus Operator介绍 介绍文章:http://t.zoukankan.com/twobrother-p-11164391.html 2016年年末,CoreOs引入了Operator 模式,并发布了Prometheus Operat 阅读全文
posted @ 2022-11-16 09:41 安生丶 阅读(2524) 评论(0) 推荐(0) 编辑
摘要:修改api-server支持的NodePort端口映射范围创建svc资源报错显示:provided port is not in the valid range. The range of valid ports is 30000-32767 k8s集群默认端口是在30000-32767,我可以通过修改kube-apiserver来修改,apiserver 阅读全文
posted @ 2022-11-11 14:50 安生丶 阅读(140) 评论(0) 推荐(0) 编辑
摘要:K8S节点选择器案例``` 1.标签选择器 #给节点打上标签 [root@lecode-k8s-master deployment]# kubectl label no lecode-dev-001 hostname=lecode-dev-001 [root@lecode-k8s-master deployment]# 阅读全文
posted @ 2022-11-11 14:49 安生丶 阅读(65) 评论(0) 推荐(0) 编辑
摘要:K8S节点配置资源驱逐#参考文章:https://www.cnblogs.com/zhangrui153169/p/15726165.html 当节点内存到达多少时。对节点的pod进行驱逐 [root@lecode-test-001 ~]# cat /var/lib/kubelet/kubeadm-flags.env K 阅读全文
posted @ 2022-11-02 10:27 安生丶 阅读(361) 评论(0) 推荐(0) 编辑
摘要:开发用户K8S授权#开发用户没有K8S权限 [ans@master ~]$ kubectl get po Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypt 阅读全文
posted @ 2022-11-02 10:26 安生丶 阅读(54) 评论(0) 推荐(0) 编辑
摘要:记录一次新节点加入K8S集群新节点初始化 安装docker kubelet kubeadm(指定版本) #先查看当前集群docker版本 [root@lecode-k8s-master manifests]# docker version Client: Docker Engine - Community Version: 2 阅读全文
posted @ 2022-11-02 10:22 安生丶 阅读(169) 评论(0) 推荐(0) 编辑
摘要:安装harbor仓库1.安装docker-compose curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-(unames)(uname -m)" -o /usr/local/bin/docke 阅读全文
posted @ 2022-11-02 10:02 安生丶 阅读(39) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示