当前位置: 首页 > news >正文

台湾域名注册网站百度客户电话

台湾域名注册网站,百度客户电话,wordpress调用文章代码,顺德网站制作案例效果欢迎关注我的公众号: 目前刚开始写一个月,一共写了18篇原创文章,文章目录如下: istio多集群探秘,部署了50次多集群后我得出的结论 istio多集群链路追踪,附实操视频 istio防故障利器,你知道几…

 欢迎关注我的公众号:

 目前刚开始写一个月,一共写了18篇原创文章,文章目录如下:

istio多集群探秘,部署了50次多集群后我得出的结论

istio多集群链路追踪,附实操视频

istio防故障利器,你知道几个,istio新手不要读,太难!

istio业务权限控制,原来可以这么玩

istio实现非侵入压缩,微服务之间如何实现压缩

不懂envoyfilter也敢说精通istio系列-http-rbac-不要只会用AuthorizationPolicy配置权限

不懂envoyfilter也敢说精通istio系列-02-http-corsFilter-不要只会vs

不懂envoyfilter也敢说精通istio系列-03-http-csrf filter-再也不用再代码里写csrf逻辑了

不懂envoyfilter也敢说精通istio系列http-jwt_authn-不要只会RequestAuthorization

不懂envoyfilter也敢说精通istio系列-05-fault-filter-故障注入不止是vs

不懂envoyfilter也敢说精通istio系列-06-http-match-配置路由不只是vs

不懂envoyfilter也敢说精通istio系列-07-负载均衡配置不止是dr

不懂envoyfilter也敢说精通istio系列-08-连接池和断路器

不懂envoyfilter也敢说精通istio系列-09-http-route filter

不懂envoyfilter也敢说精通istio系列-network filter-redis proxy

不懂envoyfilter也敢说精通istio系列-network filter-HttpConnectionManager

不懂envoyfilter也敢说精通istio系列-ratelimit-istio ratelimit完全手册

 

加qq群,请联系:


————————————————

type ScaleOptions struct {//scale结构体FilenameOptions resource.FilenameOptionsRecordFlags     *genericclioptions.RecordFlagsPrintFlags      *genericclioptions.PrintFlagsPrintObj        printers.ResourcePrinterFuncSelector        stringAll             boolReplicas        intResourceVersion stringCurrentReplicas intTimeout         time.DurationRecorder                     genericclioptions.Recorderbuilder                      *resource.Buildernamespace                    stringenforceNamespace             boolargs                         []stringshortOutput                  boolclientSet                    kubernetes.Interfacescaler                       scale.ScalerunstructuredClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)parent                       stringgenericclioptions.IOStreams
}
func NewScaleOptions(ioStreams genericclioptions.IOStreams) *ScaleOptions {return &ScaleOptions{//初始化结构体PrintFlags:      genericclioptions.NewPrintFlags("scaled"),RecordFlags:     genericclioptions.NewRecordFlags(),CurrentReplicas: -1,Recorder:        genericclioptions.NoopRecorder{},IOStreams:       ioStreams,}
}
//创建scale命令
func NewCmdScale(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command {o := NewScaleOptions(ioStreams)//初始化结构体validArgs := []string{"deployment", "replicaset", "replicationcontroller", "statefulset"}cmd := &cobra.Command{//创建cobra命令Use:                   "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)",DisableFlagsInUseLine: true,Short:                 i18n.T("Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job"),Long:                  scaleLong,Example:               scaleExample,Run: func(cmd *cobra.Command, args []string) {cmdutil.CheckErr(o.Complete(f, cmd, args))//准备cmdutil.CheckErr(o.Validate(cmd))//校验cmdutil.CheckErr(o.RunScale())//运行},ValidArgs: validArgs,//有效参数}o.RecordFlags.AddFlags(cmd)//record选项o.PrintFlags.AddFlags(cmd)//打印选项cmd.Flags().StringVarP(&o.Selector, "selector", "l", o.Selector, "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")//selecor选项cmd.Flags().BoolVar(&o.All, "all", o.All, "Select all resources in the namespace of the specified resource types")//all选项cmd.Flags().StringVar(&o.ResourceVersion, "resource-version", o.ResourceVersion, i18n.T("Precondition for resource version. Requires that the current resource version match this value in order to scale."))//resource-version选项cmd.Flags().IntVar(&o.CurrentReplicas, "current-replicas", o.CurrentReplicas, "Precondition for current size. Requires that the current size of the resource match this value in order to scale.")//current-replicas选项cmd.Flags().IntVar(&o.Replicas, "replicas", o.Replicas, "The new desired number of replicas. Required.")//replicas选项cmd.MarkFlagRequired("replicas")//必须有cmd.Flags().DurationVar(&o.Timeout, "timeout", 0, "The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).")//timout选项cmdutil.AddFilenameOptionFlags(cmd, &o.FilenameOptions, "identifying the resource to set a new size")//文件选项return cmd
}
//准备函数
func (o *ScaleOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error {var err erroro.RecordFlags.Complete(cmd)//record completeo.Recorder, err = o.RecordFlags.ToRecorder()//record flag转recorderif err != nil {return err}printer, err := o.PrintFlags.ToPrinter()//printflag转printerif err != nil {return err}o.PrintObj = printer.PrintObj//设置printObj函数o.namespace, o.enforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()//设置namespace和EnforceNamespaceif err != nil {return err}o.builder = f.NewBuilder()//设置buildero.args = args//设置参数o.shortOutput = cmdutil.GetFlagString(cmd, "output") == "name"//判断输出格式是否是nameo.clientSet, err = f.KubernetesClientSet()//设置clientif err != nil {return err}o.scaler, err = scaler(f)//设置scalerif err != nil {return err}o.unstructuredClientForMapping = f.UnstructuredClientForMapping//设置unstructuredClientForMapping o.parent = cmd.Parent().Name()//设置父命令return nil
}//校验函数
func (o *ScaleOptions) Validate(cmd *cobra.Command) error {if o.Replicas < 0 {//replicas不能小于0return fmt.Errorf("The --replicas=COUNT flag is required, and COUNT must be greater than or equal to 0")}return nil
}
//运行
func (o *ScaleOptions) RunScale() error {r := o.builder.Unstructured().ContinueOnError().NamespaceParam(o.namespace).DefaultNamespace().FilenameParam(o.enforceNamespace, &o.FilenameOptions).ResourceTypeOrNameArgs(o.All, o.args...).Flatten().LabelSelectorParam(o.Selector).Do()//构造result对象err := r.Err()if err != nil {return err}infos := []*resource.Info{}err = r.Visit(func(info *resource.Info, err error) error {//visit result 追加info到Infosif err == nil {infos = append(infos, info)}return nil})if len(o.ResourceVersion) != 0 && len(infos) > 1 {//如果资源版本不为空,infos大于1个则报错return fmt.Errorf("cannot use --resource-version with multiple resources")}// only set a precondition if the user has requested one.  A nil precondition means we can do a blind update, so// we avoid a Scale GET that may or may not succeedvar precondition *scale.ScalePreconditionif o.CurrentReplicas != -1 || len(o.ResourceVersion) > 0 {//如果当前副本不等于-1,资源版本有值precondition = &scale.ScalePrecondition{Size: o.CurrentReplicas, ResourceVersion: o.ResourceVersion}//设置precondition }retry := scale.NewRetryParams(1*time.Second, 5*time.Minute)//设置retry var waitForReplicas *scale.RetryParamsif o.Timeout != 0 {//timout不为0waitForReplicas = scale.NewRetryParams(1*time.Second, timeout)//设置waitForReplicas }counter := 0err = r.Visit(func(info *resource.Info, err error) error {//visit resultif err != nil {return err}mapping := info.ResourceMapping()//获取info的Mappingif err := o.scaler.Scale(info.Namespace, info.Name, uint(o.Replicas), precondition, retry, waitForReplicas, mapping.Resource); err != nil {//执行scalereturn err}// if the recorder makes a change, compute and create another patchif mergePatch, err := o.Recorder.MakeRecordMergePatch(info.Object); err != nil {//生成record补丁klog.V(4).Infof("error recording current command: %v", err)} else if len(mergePatch) > 0 {//如果补丁有值client, err := o.unstructuredClientForMapping(mapping)//获取clientif err != nil {return err}helper := resource.NewHelper(client, mapping)//获取helperif _, err := helper.Patch(info.Namespace, info.Name, types.MergePatchType, mergePatch, nil); err != nil {//应用补丁到服务端klog.V(4).Infof("error recording reason: %v", err)}}counter++//counter自增return o.PrintObj(info.Object, o.Out)//打印结果})if err != nil {return err}if counter == 0 {//count等于0报错return fmt.Errorf("no objects passed to scale")}return nil
}
//执行scale
func (s *genericScaler) Scale(namespace, resourceName string, newSize uint, preconditions *ScalePrecondition, retry, waitForReplicas *RetryParams, gvr schema.GroupVersionResource) error {if retry == nil {// make it try only once, immediatelyretry = &RetryParams{Interval: time.Millisecond, Timeout: time.Millisecond}}cond := ScaleCondition(s, preconditions, namespace, resourceName, newSize, nil, gvr)//构造scale 条件if err := wait.PollImmediate(retry.Interval, retry.Timeout, cond); err != nil {//立即整形scalereturn err}if waitForReplicas != nil {return WaitForScaleHasDesiredReplicas(s.scaleNamespacer, gvr.GroupResource(), resourceName, namespace, newSize, waitForReplicas)//等待scale完成}return nil
}

http://www.lbrq.cn/news/2718739.html

相关文章:

  • 昆明公司建设网站今日新闻联播主要内容
  • 陕西省建设厅执业资格注册中心网站报名aso排名优化知识
  • 用个人免费空间快速建立个人网站后方平台百度一下百度首页
  • 申请网站建设经费十大放黄不登录不收费
  • 怎么开发一个微信商城seo优化排名
  • 评价高的企业网站开发网络营销课程学什么
  • 郑州做网站价格爱站网关键词挖掘工具熊猫
  • 建设网站熊掌号惠州自动seo
  • 山东淄博网站建设游戏推广公司怎么接游戏的
  • 建设网站管理规定东莞搜索seo网站关键词优化
  • 做交友网站的前景关键词排名推广公司
  • 安阳seo网站优化如何自己免费制作网站
  • 网站开发提现功能网址收录平台
  • 自助搜优惠券网站怎么做的网站测试的内容有哪些
  • 网络服务顺序seo关键词排名优化怎么样
  • 微商城 网站制作舆情分析报告案例
  • b2c建设网站公司东莞网络优化调查公司
  • 上蔡县做彩票网站开源cms建站系统
  • 创建网站的六个步骤网络游戏推广怎么做
  • 旅游网页设计说明200字百度seo排名培训 优化
  • 中文设计网站站长之家网站查询
  • 什么网站教你做美食360推广联盟
  • 没有网站如何做落地页网络广告案例以及分析
  • 城市建设规划网站app推广代理平台
  • 网站个人空间怎么做今日国内新闻10则
  • 网站内容seo广州seo优化外包公司
  • 暴雪公司现状seo快速排名百度首页
  • 让网站百度不到网络营销的渠道有哪些
  • SEO优化网站建设价格sem网站推广怎么做
  • 哪些网站可以做视频收费汕头网站建设方案优化
  • Java 调用 Python 脚本:实现 HelloWorld
  • 【机器学习深度学习】客观评估训练程度
  • 解锁AI大模型:Prompt工程全面解析
  • Docker部署美化SunPanel导航页
  • Android平台RTSP播放器选型指南:从开源方案到跨平台低延迟专业SDK
  • Docker 在 Linux 中的额外资源占用分析