分类 Docker/k8s/etcd articles

How to use probes in k8s

一、Kubernetes probes三种探针 k8s存在存活(Liveness)、就绪(Readiness)和启动(Startup)三种探针,根据k8s官方的描述如下: kubelet 使用存活探针(Liveness)来确定什么时候要重启容器。 例如,存活探针可以探测到应用死锁(应用程序在运行,但是……

Continue reading

Kubeconfig示例及解析

What is a Kubeconfig file? A Kubeconfig is a YAML file with all the Kubernetes cluster details, certificate, and secret token to authenticate the cluster. You might get this config file directly from the cluster administrator or from a cloud platform if you are using managed Kubernetes cluster. Example Kubeconfig File Here is an example of a Kubeconfig. It needs the following key information to connect to the Kubernetes clusters. certificate-authority-data: Cluster CA server: Cluster endpoint (IP/DNS of master node) name: Cluster name user: name of the user/service account. token: Secret token of the user/service account. 1apiVersion: v1 2clusters: 3- cluster: 4 certificate-authority-data: <ca-data-here> 5 server: https://your-k8s-cluster.com 6 name: <cluster-name> 7contexts: 8- context: 9 cluster: <cluster-name> 10 user: <cluster-name-user> 11 name: <cluster-name> 12current-context: <cluster-name> 13kind: Config 14preferences: {} 15users: 16- name: <cluster-name-user> 17 user: 18 token: <secret-token-here> 19</secret-token-here></cluster-name-user></cluster-name></cluster-name></cluster-name-user></cluster-name></cluster-name></ca-data-here> Different Methods……

Continue reading

华为CCE安装isito实现ASM服务网格

华为云在国内上线的有商业版的服务网格产品ASM(基于isito的商业产品),不过在海外regions没有上线,刚好遇的一个项目需要在华为云CCE上使用服务网格,跟同事简单沟通了下客户需求,就手动安装了一个isito实现服务网格。 一、安装istio istio的安装配置需要使用到is……

Continue reading

docker安装gitlab

gitlab-ce开源版docker安装 1mkdir /srv/gitlab 2export GITLAB_HOME=/srv/gitlab 3 4docker run --detach \ 5 --hostname gitlab.example.com \ 6 --publish 443:443 --publish 80:80 --publish 2022:22 \ 7 --name gitlab \ 8 --restart always \ 9 --volume $GITLAB_HOME/config:/etc/gitlab \ 10 --volume $GITLAB_HOME/logs:/var/log/gitlab \ 11 --volume $GITLAB_HOME/data:/var/opt/gitlab \ 12 --shm-size 256m \ 13 gitlab/gitlab-ce:latest 修改hosts文件,并通过域名访问 修改C:\Windows\System32\drivers\etc\hosts 指向 110.238.84.8 gitlab.example.com 访问http://gitl……

Continue reading

K8S HPA扩缩容灵敏度

K8S 1.18 迎来了一次更新,在之前 v2beta2 版本上新增了HPA扩缩容灵敏度的控制,不过版本号依然保持 v2beta2 不变。这次更新实际就是在 HPA Spec 下新增了一个 behavior 字段,下面有 scaleUp 和 scaleDown 两个字段分别控制扩容和缩容的行为,具体可参考 官方 API 文档。其主要可以用于以下场景: 对于有流量突发的关键业务,在需要的时候应该快速扩容 (即……

Continue reading

K8S中使用自定义指标进行HPA扩缩容

k8s的默认扩缩容使用的是metrics-server来实现的,一般自指义指标(custom HPA)通过prometheus和prometheus-adapter来实现的。Prometheus 用于监控应用的负载和集群本身的各种指标,Prometheus Adapter 可以帮我们使用 Prometheus 收集的指标……

Continue reading

解决Docker报错Failed D-Bus: Operation not permitted

在centos docker image里,通过systemctl start httpd这样的指令启动服务,经常会遇到Failed to get D-Bus connection: Operation not permitted这样的报错,这里就结合示例,给出下解决方法。 d-bus-permitted 方法1:前台启用 1[root@ecs-82f5]~# docker run -itd centos:7 2c7b7404702322146e9c53a2fafb89dd4dd2dc7d3996dd4c7d62c9c14dff44961 3[root@ecs-82f5]~# docker ps 4CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 5c7b740470232 centos:7 "/bin/bash" 3 seconds ago Up 2 seconds wizardly_kare 6[root@ecs-82f5]~# docker exec -it c7b740470232 /bin/bash 7或者docke……

Continue reading

如何快速创建k8s yaml文件

一、YAML Autogeneration using Kubernetes Extention One of the easiest ways to create Kubernetes YAML is using the visual studio kubernetes extension. Install the Kubernetes VS code extension, and it will help develop k8s manifests for most kubernetes objects. It also supports deploying apps to local and remote k8s clusters. All you have to do is, start typing the Object name and it will automatically populate the options for you. Then, based on your selection, it will autogenerate the basic YAML structure for you as shown n the following image. This extension supports YAML generation of Pods, Deployment, Statefulset, Replicationset, Persistent Volumes (PV), Persistent Volume Claims (PVC), etc. 二、Create YAML Manifest Using Kubectl Dry Run You can create the manifests using the kubectl imperative commands. There is a flag……

Continue reading

K8S中使用Prometheus监控nginx指标

一、环境描述 K8S中一般使用Prometheus进行指标数据的监控,而对于custom metrics自定义指标,需要满足Prometheus可以识别的格式发送。这时候一般需要写exporter来搞定自定义数据,然后上报。本篇结合nginx示例来配置下自定义指标监控。 为了省于前期复……

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