当前位置:网站首页>Is TCP reliable?Why?
Is TCP reliable?Why?
2022-08-02 00:06:00 【JavaMonsterr】

Tektoncd Operator 是一个 Kubernetes 的扩展,用于在 Kubernetes 集群上安装、升级和管理 TektonCD Pipelines、Dashboard、Triggers 等.We just need to write the individual components yaml can be managed directly Tekton 的各种组件.
CRD | 描述 |
| Configure what to install and manage Tekton 组件. |
| Configure installation management Tekton Pipeline 组件. |
| Configure installation management Tekton Trigger 组件. |
| Configure installation management Tekton Dashboard 组件. |
| Configure installation management Tekton Result 组件. |
| Configure the installation management plugin,目前仅支持 Openshift. |
安装
安装 Tektoncd Operator 有多种方式.
从 Operator Hub 安装
可以直接前往 Operator Hub 页面 https://operatorhub.io/operator/tektoncd-operator 进行安装,Its life cycle will be determined by Operator Lifecycle Manager (OLM) 进行管理.

Install using a resource manifest file
可以直接从 Github Release 页面 https://github.com/tektoncd/operator/releases Get the resource manifest file,使用这种方式安装,需要自己管理 Operator 的生命周期.
Just use the following command to install it.
$ kubectl apply -f https://storage.googleapis.com/tekton-releases/operator/latest/release.yaml由于官方使用的镜像是 gcr 的镜像,所以正常情况下我们是获取不到的,如果你的集群由于某些原因获取不到镜像,可以使用下面的资源清单文件:
$ kubectl apply -f https://my-oss-testing.oss-cn-beijing.aliyuncs.com/k8s/tekton/operator/release.v0.60.0.yml默认情况下 Tektoncd Operator The created object will be used gcr 的镜像,比如 Tekton Pipelines Mirror of the controller,可以通过环境变量 IMAGE_PIPELINES_TEKTON_PIPELINES_CONTROLLER to specify the corresponding mirror,The environment variables shown below are to override the default gcr How the mirror is configured:
- name: IMAGE_PIPELINES_PROXY
value: cnych/tekton-operator-proxy-webhook:v0.60.0
- name: IMAGE_JOB_PRUNER_TKN
value: cnych/tekton-operator-pruner-tkn:v0.60.0
- name: IMAGE_PIPELINES_TEKTON_PIPELINES_CONTROLLER
value: cnych/tekton-controller:v0.37.2
- name: IMAGE_PIPELINES_WEBHOOK
value: cnych/tekton-webhook:v0.37.2
- name: IMAGE_PIPELINES_ARG__ENTRYPOINT_IMAGE
value: cnych/tekton-entrypoint:v0.37.2
- name: IMAGE_PIPELINES_ARG__GIT_IMAGE
value: cnych/tekton-git-init:v0.37.2
- name: IMAGE_PIPELINES_ARG__IMAGEDIGEST_EXPORTER_IMAGE
value: cnych/tekton-imagedigestexporter:v0.37.2
- name: IMAGE_PIPELINES_ARG__KUBECONFIG_WRITER_IMAGE
value: cnych/tekton-kubeconfigwriter:v0.37.2
- name: IMAGE_PIPELINES_ARG__NOP_IMAGE
value: cnych/tekton-nop:v0.37.2
- name: IMAGE_TRIGGERS_TEKTON_TRIGGERS_CONTROLLER
value: cnych/tekton-triggers-controller:v0.20.1
- name: IMAGE_TRIGGERS_WEBHOOK
value: cnych/tekton-triggers-webhook:v0.20.1
- name: IMAGE_TRIGGERS_TEKTON_TRIGGERS_CORE_INTERCEPTORS
value: cnych/tekton-triggers-interceptors:v0.20.1
- name: IMAGE_TRIGGERS_ARG__EL_IMAGE
value: cnych/tekton-triggers-eventlistenersink:v0.20.1The above method will create a file named tekton-operator 的命名空间,其中包含一个 Operator 和一个 Webhook 的 Pod:
$ kubectl get pods -n tekton-operator
NAME READY STATUS RESTARTS AGE
tekton-operator-9d747548b-67t7m 2/2 Running 0 9m42s
tekton-operator-webhook-6cc769b85d-fssq9 1/1 Running 0 9m42s安装 Operator 后,You can install what you need Tekton 组件,例如 Tekton Pipeline、Tekton Triggers.
每个 Tekton Components have a custom resource,Used to install and manage components.
$ kubectl get crd |grep tekton |grep operator
tektonchains.operator.tekton.dev 2022-07-25T00:51:07Z
tektonconfigs.operator.tekton.dev 2022-07-25T00:51:07Z
tektondashboards.operator.tekton.dev 2022-07-25T00:51:07Z
tektonhubs.operator.tekton.dev 2022-07-25T00:51:07Z
tektoninstallersets.operator.tekton.dev 2022-07-25T00:51:07Z
tektonpipelines.operator.tekton.dev 2022-07-25T00:51:07Z
tektonresults.operator.tekton.dev 2022-07-25T00:51:07Z
tektontriggers.operator.tekton.dev 2022-07-25T00:51:07Z其中 TektonConfig is the top level for creating other components CRD.So we just create the one with the required configuration TektonConfig 对象即可,It will help us install the corresponding other components.
TektonConfig Will be created based on the config file passed to it TektonPipeline、TektonTriggers 和其他组件 CR 对象,其中有一个 profile 的字段,Can be used to determine all components to install.

Tektoncd Operator 内置了 3 个 profile:lite、all、basic.
- all:This configuration file will install all components.
- basic:This profile will only be installed TektonPipeline 和 TektonTrigger 组件.
- lite:This profile will only be installed TektonPipeline 组件.
比如我们要安装 pipelines、triggers 和 dashboard,可以使用 all 这个 profile 进行安装,如下资源清单所示:
# tekton-operator-profile-all.yaml
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonConfig
metadata:
name: config
spec:
profile: all
targetNamespace: tekton-pipelines
pruner:
resources:
- pipelinerun
- taskrun
keep: 100
schedule: "0 8 * * *"其中 targetNamespace Used to specify installation Tekton 组件的命名空间,默认为 tekton-pipelines,pruner 为 Tekton Resources provide automatic cleanup.
- resources:Specifies resources that can be cleaned up automatically.
- keep:The maximum number of resources to keep when cleaning.
- schedule:How often to clean up resources.
You can directly install the above resource objects:
$ kubectl apply -f tekton-operator-profile-all.yaml
$ kubectl get tektonconfig
NAME VERSION READY REASON
config v0.60.0 True上面的 TektonConfig The object we configured profile 为 all,会自动为我们创建 tektonpipelines、tektontriggers、tektondashboard 组件对象:
$ kubectl get tektonpipelines
NAME VERSION READY REASON
pipeline v0.37.0 True
$ kubectl get tektontriggers
NAME VERSION READY REASON
trigger v0.20.1 True
$ kubectl get tektondashboard
NAME VERSION READY REASON
dashboard v0.27.0 Truethe above cr After the object is created, the corresponding component is automatically created,如下所示:
$ kubectl get pods -n tekton-pipelines
NAME READY STATUS RESTARTS AGE
tekton-dashboard-84dc6f966b-g8flx 0/1 ImagePullBackOff 0 3m48s
tekton-operator-proxy-webhook-7587596c79-ld8vm 1/1 Running 0 30m
tekton-pipelines-controller-78bc48896b-sd9fk 1/1 Running 0 30m
tekton-pipelines-webhook-5f48c855b4-js54q 1/1 Running 0 30m
tekton-triggers-controller-668b94cb5b-ggbk7 1/1 Running 0 27m
tekton-triggers-core-interceptors-66b7ddd78c-pq7gb 1/1 Running 0 27m
tekton-triggers-webhook-c8fd7755d-rknch 1/1 Running 0 27m由于 dashboard Component images do not have corresponding overridden environment variables,So we need to modify it manually:
$ kubectl edit deploy tekton-dashboard -n tekton-pipelines
......
image: cnych/tekton-dashboard:v0.28.0
......Dashboard The service is passed by default ClusterIP 方式进行暴露,我们可以手动创建一个 Ingress object or modification Service 为 NodePort 方式进行暴露.
$ kubectl get svc -n tekton-pipelines
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
tekton-dashboard ClusterIP 10.102.221.101 <none> 9097/TCP 28m
tekton-operator-proxy-webhook ClusterIP 10.96.175.155 <none> 443/TCP 33m
tekton-pipelines-controller ClusterIP 10.99.0.85 <none> 9090/TCP,8008/TCP,8080/TCP 33m
tekton-pipelines-webhook ClusterIP 10.106.195.14 <none> 9090/TCP,8008/TCP,443/TCP,8080/TCP 33m
tekton-triggers-controller ClusterIP 10.99.84.154 <none> 9000/TCP 30m
tekton-triggers-core-interceptors ClusterIP 10.97.83.136 <none> 8443/TCP 30m
tekton-triggers-webhook ClusterIP 10.108.88.140 <none> 443/TCP 30m
测试
Tekon After the components are installed,Next let's run a simple one Pipeline.
首先创建一个如下所示的 Task 任务,in the following tasks bash run in the container echo "Hello, world!" 的命令.
# hello-task.yaml
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: hello
spec:
steps:
- name: hello
image: bash:latest
command:
- echo
args:
- "Hello, world!"Create another one in the same way goodbye 的任务,只需要将上面的 echo 内容修改为 goodbye 即可.
然后就可以定义一个 Pipeline 流水线了,如下所示:
# hello-goodbye-pipeline.yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: hello-goodbye-pipeline
spec:
tasks:
- name: hello
taskRef:
name: hello
- name: goodbye
runAfter:
- hello
taskRef:
name: goodbye通过 taskRef 引用对应的 Task 对象.
直接创建上面的资源对象即可:
$ kubectl get pipeline
NAME AGE
hello-goodbye-pipeline 24s
$ kubectl get task
NAME AGE
goodbye 101s
hello 107sTo execute the pipeline,我们还需要创建一个 PipelineRun object will actually execute.
# hello-goodbye-pipeline-run.yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
generateName: hello-goodbye-pipeline-
spec:
pipelineRef:
name: hello-goodbye-pipelineCreate the above resource,Note what we use here generateName 属性,需要使用 kubectl create 命令进行创建.It will follow the above shortly after normal creation Pipeline The description goes to perform two tasks.

要想卸载 Tekton We also only need to define TektonConfig 对象删除即可.
如果不想使用 TektonCD Operator 内置的几个 profile ,We can also manually configure different components by ourselves CR 实例,另外 TektonCD Operator There are not many configurable ways available at this stage,Especially for domestic users, the problem of mirroring is a long-standing problem,It can only be overridden globally through environment variables Operator,Some mirrors are not covered at all,If it is used domestically and cannot be used gcr If mirroring, the experience may not be so smooth.
边栏推荐
- 在CentOS下安装MySQL
- 工作5年,测试用例都设计不好?来看看大厂的用例设计总结
- 类型“FC<Props>”的参数不能赋给类型“ForwardRefRenderFunction<unknown, Props>”的参数。 属性“defaultProps”的类型不兼容。 不
- 分享一份接口测试项目(非常值得练手)
- 在MySQL中使用MD5加密【入门体验】
- 带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
- color transparency parameter
- DVWA靶场环境搭建
- CDH6 Hue to open a "ASCII" codec can 't encode characters
- Spark Sql之union
猜你喜欢

yay 报错 response decoding failed: invalid character ‘<‘ looking for beginning of value;

带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
![[LeetCode304 Weekly Competition] Two questions about the base ring tree 6134. Find the closest node to the given two nodes, 6135. The longest cycle in the graph](/img/63/16de443caf28644d79dc6e6889e5dd.png)
[LeetCode304 Weekly Competition] Two questions about the base ring tree 6134. Find the closest node to the given two nodes, 6135. The longest cycle in the graph

Get piggy homestay (short-term rental) data

中职网络安全竞赛B7比赛部署流程

DOM 基础操作

solidity

使用Jenkins做持续集成,这个知识点必须要掌握

企业防护墙管理,有什么防火墙管理工具?

机器学习文本分类
随机推荐
numpy.isclose
程序员还差对象?new一个就行了
Architecture basic concept and nature of architecture
FAST-LIO2 code analysis (2)
Thymeleaf简介
如何进行数据库备份
DOM 基础操作
Bean的生命周期
thinkphp漏洞总结
@Scheduled注解详解
在linux下MySQL的常用操作命令
深度学习基础-基于Numpy的循环神经网络(RNN)实现和反向传播训练
cmd command
【MySQL系列】 MySQL表的增删改查(进阶)
numpy.hstack
学习笔记:机器学习之回归
类型“FC<Props>”的参数不能赋给类型“ForwardRefRenderFunction<unknown, Props>”的参数。 属性“defaultProps”的类型不兼容。 不
Artifact XXXwar exploded Artifact is being deployed, please wait...(已解决)
YOLO等目标检测模型的非极大值抑制NMS和评价指标(Acc, Precision, Recall, AP, mAP, RoI)、YOLOv5中[email protected]与
CDH6 Hue to open a "ASCII" codec can 't encode characters