Create Your First Helm Chart

Introduction For a typical cloud-native application with a 3-tier architecture, the diagram below illustrates how it might be described in terms of Kubernetes objects. In this example, each tier consists of a Deployment and Service object, and may additionally define ConfigMap or Secret objects. Each of these objects are typically defined in separate YAML files, and are fed into the kubectl command line tool. A Helm chart encapsulates each of these YAML definitions, provides a mechanism for configuration at deploy-time and allows you to define metadata and documentation that might be useful when sharing the package. Helm can be useful in different scenarios: Find and use popular software packaged as Kubernetes charts Share your own applications as Kubernetes charts Create reproducible builds of your Kubernetes applications Intelligently manage your Kubernetes object definitions Manage releases of Helm packages Let……

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

如何重载Prometheus配置

Reloading Prometheus’ Configuration A common question from new users is if they need to restart Prometheus every time they change the configuration. The good news is that you don’t, allowing your monitoring to continue uninterrupted as your system changes. There are two ways to ask Prometheus to reload it’s configuration, a SIGHUP and the POSTing to the /-/reload handler. To send a SIGHUP, first determine the process id of Prometheus. This may be in a file such as /var/run/prometheus.pid, or you can use tools such as pgrep to find it. Then use the kill command to send the signal: 1kill -HUP 1234 Alternatively, you can send a HTTP POST to the Prometheus web server: 1curl -X POST :9090/-/reload Note that as of……

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

kubectl多集群配置

Kubectl 是一个命令行接口,用于对 Kubernetes 集群运行命令。默认Kubectl 会读取 $HOME/.kube/config 的文件。也可以通过设置环境变量 KUBECONFIG 或设置 –kubeconfig 参数指定其它 kubeconfig 文件。 一、单集群配置 在单集群下配置非常简单: 1mkdir -p $HOME/.kube 2sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config 3sudo chown $(id -u):$(id -g) $HOME/.kube/config 4 5也可以通过环境变量配置 6export KUBECONFIG=/etc/kubernetes/admin.conf 二、多集群配置 1.别名方式 这个是我喜……

Continue reading

k8s总结(四)kubectl应用实例

一、kubectl进行nginx应用测试 这里使用的minikube环境进行测试,可以使用官方版,国内的话可以使用aliyun修改版(https://yq.aliyun.com/articles/221687) 1[root@ecs-255b ~]# cat nginx/deployment.yaml 2apiVersion: apps/v1 3kind: Deployment 4metadata: 5 name: nginx-deployment 6spec: 7 selector: 8 matchLabels: 9 app: nginx 10 replicas: 2 # tells deployment to run 2 pods matching the template 11 template: 12……

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

k8s总结(二)k8s命名空间namespace

一、命名空间作用概述 Kubernetes 支持多个虚拟集群,它们底层依赖于同一个物理集群。 这些虚拟集群被称为命名空间。 二、何时使用命名空间 命名空间适用于存在很多跨多个团队或项目的用户的场景。对于只有几到几十个用户的集群,根本不需要创建或考虑命名空间。当需要名称空间提供的功能时,请开始使用它们。 命名空……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI Alpine Android Anpic Ansible Apache Apm Apparmor Appfog Apr Apt-Get Aria2 Array Atlassian Atop Audit Awk AWS Awstats Axel Azure Backdoor Backup Bamboo Bash Bat Benchmark Bigdata Bin Bind Bitwise Blockchain BMC Book Bootstrap Brocade Bsd C1000 Cache Capistrano Catlog CDH5 Centos Centos7 Chatops Chattr Check_mk Checkinstall Cisco CL210 Clickhouse Cloud Cloud-Desktop Cmdb Cms Cobbler Collectd Comm Compress Confd Conver Corosync Cpu Crontab Crunchbang Css Curl C语言 Date DDOS Decode Dell Desktop Devops Df Dhcp Diff Diskpart DISTINCT Django DNS Docker Dos2unix Dpkg Drupal Duckdb EKS ELK Etcd Excel Fail2ban Fastcgi Fdisk Fiddler Find Firewalld Flask Flvtool Ftp Function Fuser GCP Geek Ghost Gin Git Github Gitlab Glances Glusterfs Go Godaddy Golang Google Gooupadd Grafana Graphviz Gravatra Grep Grub2 Hadoop Haproxy Hardware HBA HCIE Heartbeat Helm Hexdump Hhvm History Hotspot Html Http/Html/Web Http/Html/Web Httplogs Https HttpWatch Huawei Huaweicloud Hugo IBM Icmp Iconv Ifconfig IIS InfluxDB Ingress InnoDB Inotify Iopp IOS Ipmitool Iptables Iredmail Iscsi Isito It-News Java JavaScript Jdk Jenkins Jinja2 Jira Join Joomla K3s K8s Kdump Keepalived Kernel Kingate KVM Lamp Last Leetcode Lib 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 Mplayer Mpm Mrtg Mtr My.cnf Mysql Mysqlbinlog Mysqld_multi MySQLdb Mysqldump Mysqlhotcopy Nagios Nc Nethogs Netlify Nexus Nfs Nginx Nmon Nocatlog Node.js Nrpe Ntfs Ntop Ntp Obs Ocr Open-Falcon Openbox Opencv Openldap OpenResty Openssl Openstack Oracle Oswatch Paas Pacemaker Pam Pandas Parted Pcp Pcre Pdf Percona Perl Pexpect Pgrep Php Php-Fpm Ping Plsql Develope PM Postfix PostgreSQL Powershell Prettify Proc Prometheus Puppeteer Pushd Pwgen Pxe Pyecharts Python Python模块 QoS Radmin Raid Rdesktop Read Redhat Redis Redmine Regex Rh134 RH318 RH442 RHCA RHCE Rhel7 Rhel8 RHEV Rm Rman Rootkit Route Rpm Rpmforge Rrdtool RSA Rsync Rsyslog Safe Saltstack Samba Scapy Screen SecureCRT Sed Selenium Selinux Seo Seq Session Set Shc Sheepdog Shell Shopt Sitemap Skydns Smokeping Snffier Snmp Socket Soft Sort Spider Sql Sqlserver Squid SRE Ss Ssh Sshpass Statuscode Strace Strings Su SublimeText2 Sudo Suse Svn Sysbench Syslog-Ng Sysstat Systemd T Tar TC Tcpcopy Tcpdump Tech Telecom Telnet Tencentcloud Tengine Test Testlink Threads Time Tmux Tomcat Touch Tr Tsar Twisted Ubuntu Udev Ulimit Unix Unixbench User-Agent Useradd Varnish VBA 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