• 周五. 12月 2nd, 2022

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

Tke experience upgrade: 24 tips for getting started with k8s faster

[db:作者]

1月 6, 2022

Wang Xiaowei , Tencent cloud container product manager , Keen to provide customers with efficient Kubernetes Usage mode , Reduce cost and increase efficiency for customers .

background

“ function “ The solution is whether the product has or does not have a capability , With “ function ” after , How to guide through good 、 Tips , And interaction to help users more “ Fluent ” The use of products is a problem worth thinking about .

for example : LEGO has more than 3700 Two different modules , These modules can spell out an infinite number of models . However , The presentation of different models is completely different , It’s possible that just changing the position of a few small modules can bring unexpected results .

Efforts in recent years ,TKE A large number of new features have been proposed at the functional level : for example : adopt LB Direct connection Pod Lifting performance [1], Cluster upgrade in place [2], Virtual node [3], Dynamic scheduler [4], For more information Container service product trends [5].

Besides ,TKE Also pay attention to the overall user experience , I visited a number of companies for this purpose , Collected a lot of requirements , And according to the importance of users , Optimization and tool development , Users can take advantage of these optimization tips , Experience container services more smoothly , more “ Grounding gas ” Lower the threshold of product use , Enhance product experience .

Promotion list

colony / Node related

recommend : Node search capability is enhanced

Node search support through Label/IP/ Whether to block / Node status And so on .

  • Label Search format and native Kubernetes identical :”k1=v1,k2=v2″
  • IP Only precise query is supported in multi value search , single IP Search supports fuzzy queries

Usage mode : Node management -> node -> Search for perhaps Node pool details page  -> Drop down to the node list -> Search for

recommend : Node initialization error display optimization

  • 【CVM Shipment failed Detailed display of related errors 】 If because CVM Delivery failure leads to node purchase failure , Except for the newspaper LAUNCH_FAILED( The delivery failed ), It will also show the detailed reasons for the failure of delivery : such as VPC subnet IP Insufficient / Insufficient disk resources / Lack of balance / Insufficient quota for placement groups wait .
  • 【 Node initialization Detailed display of related errors 】 The node initialization failure steps and corresponding information will be displayed in detail in the node list : such as Failed to hang up 、 Core component exception wait .

Usage mode : Node management -> node -> Click View Status in the status bar to view the error

Node pool node operation standardization : Support the blockade / deportation

Node operations in the node pool support blocking / deportation , Fully synchronized with the node list operation within the cluster , You can efficiently manage nodes in the node pool .

Usage mode : Node pool details page  -> Drop down to the node list -> Operate on a single node in the operation column perhaps Select the batch node and perform batch operation ( Click on the above 【 More operations 】 Buttons can be blocked in batches / Unblock node )

Delete Protection Logic Optimization

Customer feedback : If the delete by mistake option is turned on when creating a cluster , If creation fails after opening , Customers can’t delete .

Now you can go to 【 Cluster list page 】 Turn off delete Protection for the cluster .

Usage mode : Cluster management -> Cluster operation list -> more -> Turn off cluster deletion protection

Public network IP Show optimization

Some customers reported that the public network IP The configuration entry of is too hidden , The default bandwidth value is too small , Unable to meet business needs .

We take a graphical form ( Drag bar ) Instead of the input box , Enhance the display effect .

Usage mode : The new node / New node pool -> Choose a model -> Drag to the bottom -> Set the bandwidth of the public network

Node pool shows information structure / Advanced parameter display

  1. Add node pool core definition / Overview of functions , Let customers quickly understand the usage scenarios of node pool
  1. Structured display of node pool information ( Aggregate by module , It also shows more advanced parameters , Improved observability )
    • Node pool basic information ( Elastic scaling related configuration 、 The number of nodes )
    • Node configuration details ( Node template related configuration 、 Node pool expansion node automatically inherited configuration )

Nodes jump directly CVM Optimize

The old version of jump CVM The button display is not stable , And the entrance doesn’t stand out .

Usage mode : Hover over the node ID It’s about ( If you click directly on the node ID, Will jump to Node Details page ) -> Click on “ Jump to CVM Example details page ” -> Will jump to CVM Example details page .

The container network is added when creating nodes IP check

Before you create a node , According to your container network configuration ( Network mode 、 Segments, etc ) To determine whether the container network can meet the requirements of creating these nodes . Considering some special scenarios, you may not need to verify the container network , We provide the parameters skip You can skip the check .( For detailed description of parameters, please refer to API file [6]

Usage mode : The new node / Add existing nodes / New node pool -> More Settings -> Set up skip Parameters

When adding an existing node to a cluster, you can fill in the mount partition /LVM name

When adding an existing node, if you partition the disk /LVM, Please fill in the name of the partition you want to mount /LVM name , If the disk is not partitioned or LVM, No need to fill in the mount partition , Just fill in the mount point .

Usage mode : Add existing nodes  -> Select node -> Check data disk mount -> Fill in the mount area and mount point

Kubernetes Object related

recommend : Batch import key value pairs : Configuration Management & Environment variable optimization

Support importing batch key value pairs from the cutting board at one time . When the variable name is null , Paste one or more lines in the variable name key=value or key: value The key value pair of can realize fast batch input .

Usage mode 1: The workload -> New load -> Instance content -> environment variable

Usage mode 2: Configuration Management -> newly build ConfigMap/Secret -> Content

recommend :CronJob Support to reserve quantity / Pause / Manual trigger / Show by   Cronjob   Generated   Job   list

  • Keep success Job Count : prevent Job Infinite generation , Impact on cluster performance
  • Retention failed Job Count : prevent Job Infinite generation , Impact on cluster performance
  • Pause : Will stop Cronjob Operation of , No longer will new Job. Support recovery
  • Manual trigger : No need to wait Cronjob Set up Crontab Time supports the use of Cronjob Inside Job The template generates a new Job

Usage mode : The workload -> Cronjob -> newly build -> Keep success Job Count / Retention failed Job Count

Usage mode : The workload -> Cronjob list -> more -> Manual trigger / Pause

Click on the image above CronJob The name of , You can see that the CronJob Generated, running Job list :

HostAliases Commercialization

HostAliases[7] Used to Pod Of /etc/hosts Add an entry to the file , Can be in Pod Level override resolution of the host name . In order to increase Pod Of DNS To configure .

Usage mode : The workload -> New load -> Advanced settings -> Host alias

lifecycle Commercialization

lifecycle[8] : The container’s life cycle event hook handler . The container can specify a handler for each event , When a container starts ,Kubernetes Will be sent immediately postStart event ; Before the container is terminated , Kubernetes Will send a preStop event .

Usage mode : The workload -> New load -> Instance content -> Life cycle

Service Default “ Access is within the cluster only ”;Service Type explanation adds corresponding English nouns

  1. “ Access is within the cluster only ” The access mode is in line with the usage habit
  2. Comparing Chinese and English nouns to reduce the cost of understanding , accord with Kubernetes Original usage habit

Onekey “ Redeployment ” stay Deployment、StatefulSet and DaemonSet Upper support

and Deployment equally ,StatefulSet and DaemonSet Now it supports one click redeployment , Remove the trouble of reconfiguration after deletion .

Usage mode : The workload -> Load list -> more -> Redeployment

Ingress Certificates support inheritance LB Certificate

Support direct use CLB Automatically create a certificate for Ingress Of HTTPS certificate , Save the tedious Secret Create a process .

Usage mode : Services and routing -> Ingress -> newly build Ingress -> Monitor port check Https:443 -> New key -> Select the server certificate

Secret Support TLS type

except CLB certificate , You sometimes use your own certificate , Saving the certificate requires using TLS Type of Secret

Usage mode 1: Configuration Management -> Secret -> newly build Secret -> TLS certificate

Usage mode 2: Services and routing -> Ingress -> newly build Ingress -> Nginx Load Balancer -> Monitor port check Https:443 -> New key

subPathExpr Support configuration on the console

subPathExpr[9], Support will environment variable Mapping to Volume A subpath in

Usage mode : New load -> Working with data volumes -> Add environment variables -> Use mount point -> choice subPathExpr

kube-system、kube-node-lease、kube-public The resource support in the console supports modification

In the past, in order to prevent users from touching , The console limits the modification of resources in these namespace , But in fact, some users themselves have the resource management rights of these namespace , So the new version removes these restrictions from the console , The authority logic is handed over to the background for judgment , If you don’t have permissions for the relevant namespace , Modifying resources will also report errors .

Usage mode : New load -> Select a namespace -> Modify resource allocation

Usage mode : Authorization management -> Choose any entry -> RBAC Policy generator -> Select a sub account -> Select a namespace / jurisdiction

Add multiple suspension tips

Add floating prompt to the field names of all resource list pages , Better for users with smaller screens

Add floating prompt to the log entry container name in the workload , Better for users with smaller screens

Operation and maintenance capability

recommend : Log collection supports automatic extraction of regular expressions based on log samples

When you select single line full regular in log collection rules 、 When extracting patterns from multiline completely regular patterns , Regular expressions can be generated automatically according to the user’s own log samples , And automatically extract the corresponding key value pairs , There is no need for users to learn and configure regular expressions themselves

Usage mode :1. Cluster operation and maintenance -> 2. Log rules -> 3. newly build -> 4. Enter the name of the log collection rule -> 5. Extraction method selection “ A single – Completely regular ” -> 6. Sample input log -> 7. Click regular expression to automatically generate -> 8. Move the cursor to select the string that needs to be regularized -> 9. Input key -> 10. confirm

recommend : Log collection supports automatic verification of whether the log can be extracted normally according to the log sample

For user filled regular expressions 、 Separator, etc , Support verification according to user log sample , Automatically extract all value, To verify whether the log can be parsed normally , Avoid finding expression configuration errors when retrieving logs .

Usage mode :1. Cluster operation and maintenance -> 2. Log rules -> 3. newly build -> 4. Enter the name of the log collection rule -> 5. Extraction method selection “ A single – Completely regular ” -> 6. Sample input log -> 7. Enter regular expressions manually -> 8. verification

Log collection supports multi line regular extraction mode

Support multiline regular parsing pattern ( Apply to java Programs and other multi line logs need to retrieve logs with key values )

Be careful : To use the multi row regular extraction mode, you need to contact the back end to upgrade the collection component version

Usage mode : New log collection rule -> The second step is to select “ Multiple lines – Completely regular patterns ”

trusteeship Prometheus Support Singapore 、 Virginia and other places

Cloud native monitoring [10]( trusteeship Prometheus) It’s Singapore / Virginia and other places , Welcome to use .

summary

Kubernetes It’s powerful , But the modules are complex , It costs a lot to start with .TKE Focus on the upgrade of function and experience , If you have any suggestions on function and experience , Welcome to comment on , We’re going to randomly pick three people to leave a message , Send a little cowboy around Tencent .

Reference material

[1]

adopt LB Direct connection Pod Lifting performance : 【https://cloud.tencent.com/document/product/457/41897】

[2]

Cluster upgrade in place : 【https://cloud.tencent.com/document/product/457/32192】

[3]

Virtual node :【 https://cloud.tencent.com/document/product/457/53027】

[4]

Dynamic scheduler : 【https://cloud.tencent.com/document/product/457/50843】

[5]

Container service product trends : 【https://cloud.tencent.com/document/product/457/41088】

[6]

API file : 【https://cloud.tencent.com/document/product/457/36707】

[7]

HostAliases: 【https://kubernetes.io/zh/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/】

[8]

lifecycle: 【https://kubernetes.io/zh/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/】

[9]

subPathExpr:【 https://kubernetes.io/zh/docs/concepts/storage/volumes/#using-subpath-expanded-environment】

[10]

Cloud native monitoring : 【https://cloud.tencent.com/document/product/457/49889】

  Recommended in the past   

  • An article will take you to understand etcd 3.5 The core feature of
  • On the cloud 618, Tencent cloud container helps 1.3 Fold up
  • tencent TencentOS Ten years of cloud based iterative evolution
  • kubernetes Standard Guide for cost reduction and efficiency enhancement | Resource utilization improvement tools
  • stay TKE Use in Velero Migrating and replicating cluster resources

This article is from WeChat official account. –
Tencent cloud native (gh_faa30cb2ba5b)
, author : Wang Xiaowei

The source and reprint of the original text are detailed in the text , If there is any infringement , Please contact the
[email protected]
Delete .

Original publication time :
2021-06-22

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注