分类 Docker/k8s/etcd articles

如何重启pod

A pod can also have one or more containers, one of which is the application container, and the others are the init container, which halts after it completes a job or the application container is ready to perform its function, and the sidecar container, which is affixed to the primary application container. A container or pod will not always leave due to an application failure. In scenarios like this, you will need to restart your Kubernetes Pod explicitly. In this guide, you will explore how to force pods in a deployment to restart using several ways. Pre-requisites To restart the pod using kubectl, make sure you have installed the kubectl tool along with the minikube cluster. Otherwise, you will not be able to implement the prescribed article. Methods to create pods using Kubectl To restart pods using Kubectl, you have……

Continue reading

ks8 a container name must be specified for pod报错处理

在现网的一个系统上通过kubectl logs pod名称查看日志时报错a container name must be specified for pod。出现该问题比较容易解决,一般出现该问题的都是多个container共用一个pod的情况,比如sidecar模式下,这时候查看日志的时候需要指定Pod外,还需要通过-c参数指定container。 kubectl-logs-container……

Continue reading

CCE Turbo集群升级了什么

在2021年4月25的华为HDC cloud开发者大会上,华为云发布了升级版的云容器集群CCE Turbo。其相较于CCE集群,在计算、网络和调度方面全方位加速。本篇就结合一些找到的知识点,总结下CCE Turbo相较于CCE增加了哪些技术关键点。 一、CCE Turbo特性 从华为官方网站……

Continue reading

从kubectl top看K8S监控原理

一、前言 kubectl top 可以很方便地查看node、pod 的实时资源使用情况:如CPU、内存。这篇文章会介绍其数据链路和实现原理,同时借 kubectl top 阐述 k8s 中的监控体系,窥一斑而知全豹。最后会解释常见的一些问题: kubectl top 为什么会报错? kubectl top node 怎么计算,和节点上直接 top 有什么区别? kubectl top pod 怎么计算,包含 pause 吗? kubectl top pod……

Continue reading

k8s以变量形式挂载configmap

ConfigMap 功能在 Kubernetes1.2 版本的时候就有了,许多应用程序会从配置文件、命令行参数或环境变量中读取配置信息。这些配置信息需要与 docker image 解耦,ConfigMap API 给我们提供了向容器中注入配置信息的机制,ConfigMap 可以被用来保存单个属性,也可以用来保存整个配置文件或者 JSON 二进制大对象。 本篇先从环境变……

Continue reading

k8s容器配置环境变量

为k8s容器配置环境变量,在官方文档中有相关说明。本篇就是基于原内容的理解再加工。这里使用华为CCE集群我已准备好了k8s环境。 一、为容器设置一个环境变量 创建 Pod 时,可以为其下的容器设置环境变量。通过配置文件的 env 或者 envFrom 字段来设置环境变量。 基于以下yaml文件可以创建一个pod 1apiVersion: v1 2kind:……

Continue reading

Dockerfile中配置环境变量

Dockerfile中可以通过ENV指令设置环境变量,不过当有多行的环境变量要设置时(比如,JDK环境变量配置),使用ENV再去设置就感觉比较繁琐,想像在Linux下一样通过设置对应的profile文件(或bashrc文件)来配置环境环境变量,这时候就可以通过echo指令进行配置……

Continue reading

k8s总结(三)kubectl命令

kubectl是用来管理Kubernetes集群的指令,平时我们日常对k8s资源所有的操作在命令行都是通过该指令完成的。本篇就总结下kubectl命令的常见使用方法。 一、kubectl语法 1kubectl 2command: 3 create/delete/get/describe/apply 4type: 5 资源对象类型,严格区分大小写 6 daemonsets 缩写ds 7 deployments 8 events 缩写ev 9 endpoints 缩写ep 10 horizontalpodautoscalers 缩写hp……

Continue reading

在Docker中运行带参数的自定义脚本—ENTRYPOINT vs CMD

Use Case: You need to run a custom shell script on your Docker container with arguments passed to the script. These arguments decide how the script runs inside the container. We will look into running custom shell scripts inside a Docker container with command line arguments in this guide. The key Dockerfile instructions used for this use case are ENTRYPOINT: Here you will specify the command that has to be executed when the container starts. The default ENTRYPOINT command is /bin/sh -c CMD: It acts as an argument for ENTRYPOINT. 一、Executing Commands Using CMD Vs ENTRYPOINT Let’s take an example of the following Dockerfile. It installs http-tools and starts the ab (apache benchmark) utility using CMD and Entrypoint. Both do the same job. Using CMD 1FROM……

Continue reading

使用容器部署zabbix5.4

早在zabbix3.4版本左右,其已经支持了容器的方式安装。具体可以查看当时的文档说明: ,在后来新的版本里zabbix更是直接在其主页页面里把容器方式安装和云安装放在同样常见的安装方式,具体为:https://www.zabbix.com/container_images ,当前最……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta