goctl快速创建k8s yaml

news/发布时间2024/5/12 23:24:15

安装goctl

 GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/tal-tech/go-zero/tools/goctl

goctl kube deploy -name nginx -namespace test -image nginx:alpine -replicas 1 -minReplicas 1 -maxReplicas 3 -o nginx-j.yaml -port 80 -nodePort 31330

结果如下

apiVersion: apps/v1
kind: Deployment
metadata:name: nginxnamespace: testlabels:app: nginx
spec:replicas: 1revisionHistoryLimit: 5selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec:containers:- name: nginximage: nginx:alpinelifecycle:preStop:exec:command: ["sh","-c","sleep 5"]ports:- containerPort: 80readinessProbe:tcpSocket:port: 80initialDelaySeconds: 5periodSeconds: 10livenessProbe:tcpSocket:port: 80initialDelaySeconds: 15periodSeconds: 20resources:requests:cpu: 500mmemory: 512Milimits:cpu: 1000mmemory: 1024MivolumeMounts:- name: timezonemountPath: /etc/localtimevolumes:- name: timezonehostPath:path: /usr/share/zoneinfo/Asia/Shanghai---apiVersion: v1
kind: Service
metadata:name: nginx-svcnamespace: test
spec:ports:- nodePort: 31330port: 80protocol: TCPtargetPort: 80type: NodePortselector:app: nginx---apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:name: nginx-hpa-cnamespace: testlabels:app: nginx-hpa-c
spec:scaleTargetRef:apiVersion: apps/v1kind: Deploymentname: nginxminReplicas: 1maxReplicas: 3metrics:- type: Resourceresource:name: cputargetAverageUtilization: 80---apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:name: nginx-hpa-mnamespace: testlabels:app: nginx-hpa-m
spec:scaleTargetRef:apiVersion: apps/v1kind: Deploymentname: nginxminReplicas: 1maxReplicas: 3metrics:- type: Resourceresource:name: memorytargetAverageUtilization: 80

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.ulsteruni.cn/article/38661536.html

如若内容造成侵权/违法违规/事实不符,请联系编程大学网进行投诉反馈email:xxxxxxxx@qq.com,一经查实,立即删除!

相关文章

asp.net core 多个授权策略选择单个策略

首先假设我们依据官方示例有这样一个自定义的授权handlerpublic class FunAuthorizeAttribute : AuthorizeAttribute, IAuthorizationRequirement,IAuthorizationRequirementData{public FunAuthorizeAttribute() : this(null, true) { }public FunAuthorizeAttribute(string f…

揭秘JavaScript数据世界:一文通晓基本类型和引用类型的精髓!

在编程的世界里,数据是构建一切的基础。就像建筑师需要了解不同材料的强度和特性一样,程序员也必须熟悉各种数据类型。 今天,我们就来深入探讨JavaScript中的数据类型,看看它们如何塑造我们的代码世界。 一、JavaScript数据类型简介 数据类型是计算机语言的基础知识,数据类…

如何将本地项目第一次同步到gitee远程

一,Gitee账号的注册/登录 在gitee登录入口输入相关信息进行注册登录https://gitee.com/signup#lang=zh-CN 二,本地安装git客户端并配置用户信息 1.Git - 安装 Git (git-scm.com)根据提示点击下一步,安装完成后,在本地文件夹右键单击出现git相关指令,表示安装成功2.点击git…

faiss简单测试方法

先把仓库克隆到本地,我这边还需要改cmake环境,在project上面加 set(CMAKE_CUDA_COMPILER /usr/local/cuda-11.8/bin/nvcc) 构建 mkdir buildcmake -B build . 编译,只需要编译faiss这部分就可以,(主目录下有很多测试代码,编译很慢,只编译faiss会快很多) cd build make …

一个库帮你轻松的创建漂亮的.NET控制台应用程序

前言 做过.NET控制台应用程序的同学应该都知道原生的.NET控制台应用程序输出的内容都比较的单调,假如要编写漂亮且美观的控制台输出内容或者样式可能需要花费不少的时间去编写代码和调试。今天大姚给大家分享一个.NET开源且免费的类库帮你轻松的创建漂亮、美观的.NET控制台应用…

华为NPU开发流程点滴

华为NPU开发流程点滴 NPU/CPU集成操作流程图介绍了App使用HUAWEI HiAI DDK的集成流程。IR在线模型构建 IR在线模型构建通过IR单算子根据原始模型中的关系级联,配置权重数据,构建IR模型网络。 离线模型转换 离线模型转换需要将Caffe、TensorFlow、ONNX、MindSpore模型转换为HU…