1: 263 items found.

how to update pod image in Kubernetes

Method 1: Edit Deployment

  1. Find the deployment you want to update:

    kubectl get deployments
    
  2. Edit the deployment with the updated image:

    kubectl edit deployment <deployment-name>
    
  3. In the YAML file, update the image field under the spec.template.spec.containers section with the new image. For example:

    containers:
      - name: my-app
        image: my-app:latest
    
  4. Save and exit the YAML file.

More ~

English Topics: Who is your country's biggest movie star?

Ice Breaking Topics

  • What's the bravest thing you have ever done?
  • How important is dancing in your culture?
  • How does your culture influence your understanding of the world?
  • Which is better? A big party or a small gathering?
  • If you had to rate your current happiness on a scale of 1-10, what would it be?
  • What is the worst advice you have ever heard?
  • When do you usually take your breakfast?
  • What was the happiest time in your life? Why was it so happy?
More ~

Monitor a website with curl command

Hey there, tech enthusiasts! In this blog post, we'll embark on a journey to create a robust website monitoring system using the Bash shell. We'll dive into the intricacies of checking website availability, handling timeouts, and sending notifications via curl when things go awry.

  1. Laying the Foundation:

    Begin by opening your favorite terminal emulator and creating a new Bash script file. We'll call it "website_monitor.sh." This script will serve as the brain of our monitoring system.

More ~

Kubernetes中Service Account的作用是什么

Kubernetes中Service Account的作用是什么

Kubernetes中的Service Account是一个用于访问集群API服务器的虚拟帐户,它允许应用程序和服务在没有访问集群证书或令牌的情况下进行认证和授权。Service Account的作用主要包括:

1. 身份验证(Authentication)

Service Account在创建时会自动生成一个私钥和公钥对,私钥存储在Service Account的Secret中,公钥则存储在Service Account的YAML文件中。当一个Pod或服务尝试访问集群API服务器时,它使用Service Account的私钥来生成一个签名(signature),该签名与Service Account的公钥一起发送给集群API服务器。集群API服务器验证签名后,如果签名有效,则允许Pod或服务访问集群API服务器。

More ~

English Topics: What is the last film you saw in the cinema?

Ice Breaking Topics

  • What games do children play in your country?
  • What's the best concert or live performance you've ever attended?
  • What is your favorite type of sandwich, and what would you name it if it were on a menu?
  • What are the two things you'd like to ask your pet?
  • How important is appearance of a person?
  • What would you do if you could read other people's minds?
  • Who normally does the cooking in your home?
  • Which would you rather have: $1,000,000 today or 1 cent doubled every day for 30 days?
More ~

如何修改microk8s的docker镜像源

适用于 MicroK8s 版本 1.23 或更高版本

MicroK8s 1.23 及更高版本为每个镜像注册表使用单独的 hosts.toml 文件。对于 docker.io,可以在 /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml 中找到它。

编辑该文件,使其内容看起来像这样:


# /var/snap/microk8s/current/args/certs.d/docker.io/hosts.toml
server = "https://my.registry.internal:5000"

[host."my.registry.internal:5000"]
capabilities = ["pull", "resolve"]

然后,重新启动 MicroK8s:

microk8s stop
microk8s start
More ~

何为金丝雀发布

金丝雀发布(Canary Release)是一种常见的软件发布策略,它涉及到将新代码或更新逐渐部署到一小部分用户或服务器(金丝雀),然后逐渐增加暴露的范围,直到所有用户或服务器都收到更新。

金丝雀发布主要有以下几个特点:

  1. 渐进部署: 金丝雀发布通过将新代码或更新逐渐部署到一小部分用户或服务器(金丝雀)来实现,从而降低了潜在的风险。如果新代码或更新存在问题,则只會影响到金丝雀用户或服务器,从而有助于早期发现并解决问题。
  2. 可控性: 金丝雀发布允许开发人员和运维人员对新代码或更新的部署有更多的控制。例如,他们可以设置金丝雀用户或服务器的比例,并在发现问题时暂停或回滚部署。
  3. 快速反馈: 金丝雀发布可以帮助开发人员和运维人员快速获得有关新代码或更新的反馈。通过监控金丝雀用户或服务器的性能和用户体验,开发人员和运维人员可以及时发现问题并采取措施来解决。
  4. 低风险: 金丝雀发布可以降低新代码或更新部署的风险。通过将新代码或更新逐渐部署到一小部分用户或服务器,开发人员和运维人员可以降低因新代码或更新导致严重问题的可能性。
More ~

iptables基础

iptables常用参数

  • -A:将规则添加到当前链的末尾。
  • -D:从当前链中删除规则。
  • -I:将规则插入到当前链中指定的位置。
  • -R:替换当前链中的规则。
  • -L:列出当前链中的规则。
  • -F:清空当前链中的所有规则。
  • -N:创建一个新的链。
  • -X:删除一个链。
  • -P:设置链的默认策略。
  • -s:源地址。
  • -d:目标地址。
  • -p:协议。
  • -m:模块。
  • -j:跳转目标。
More ~

Go的中GMP详解以及GMP的全局队列意义是什么

Go中的GMP

Go中的GMP(Grand Memory Pool)是一个内存池,它提供了一个用于管理内存分配和释放的通用机制。GMP可以提高内存分配和释放的效率,并减少内存碎片。

GMP的组成

GMP由以下部分组成:

  • 内存池: 内存池是一个由固定大小的内存块组成的集合。当需要分配内存时,GMP会从内存池中分配一个内存块。
  • 内存块: 内存块是GMP的基本分配单元。内存块的大小是固定的,并且不能被修改。
  • 分配器: 分配器负责从内存池中分配和释放内存块。
  • 释放器: 释放器负责将内存块归还给内存池。
More ~