storage.googleapis.com/tekton-releases/latest/release.yaml 查看Tekton Pipelines组件是否运行正常: $ kubectl -n tekton-pipelines create -f git-pipeline-resource.yaml $ kubectl -n tekton-pipelines create -f registry-pipeline-resource.yaml 查看已创建的 pipeline resource 资源 $ kubectl -n tekton-pipelines get PipelineResource NAME tekton-basic-user-pass-git - name: tekton-basic-user-pass-registry 创建 serviceaccount $ kubectl -n tekton-pipelines $ kubectl -n tekton-pipelines create -f tekton-git-and-registry.yaml 查看 secret 以及 sa $ kubectl -n tekton-pipelines
storage.googleapis.com/tekton-releases/latest/release.yaml 查看Tekton Pipelines组件是否运行正常: $ kubectl -n tekton-pipelines create -f git-pipeline-resource.yaml $ kubectl -n tekton-pipelines create -f registry-pipeline-resource.yaml 查看已创建的 pipeline resource 资源 $ kubectl -n tekton-pipelines get PipelineResource NAME tekton-basic-user-pass-git - name: tekton-basic-user-pass-registry 创建 serviceaccount $ kubectl -n tekton-pipelines $ kubectl -n tekton-pipelines create -f tekton-git-and-registry.yaml 查看 secret 以及 sa $ kubectl -n tekton-pipelines
apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: gcp-git-resource namespace: tekton-pipelines 指定了将此账号密码信息应用于哪个域名下的git仓库 apiVersion: v1 kind: Secret metadata: name: gcp-git-secret namespace: tekton-pipelines mvn test 命令 apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: gcp-maven-test namespace: tekton-pipelines $(xxx) apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: gcp-kubectl-deploy namespace: tekton-pipelines spec: params: - name: release_namespace default: "tekton-pipelines" - name: charts_dir
apiVersion: tekton.dev/v1alpha1 kind: PipelineResource metadata: name: gcp-git-resource namespace: tekton-pipelines 指定了将此账号密码信息应用于哪个域名下的git仓库 apiVersion: v1 kind: Secret metadata: name: gcp-git-secret namespace: tekton-pipelines mvn test 命令 apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: gcp-maven-test namespace: tekton-pipelines $(xxx) apiVersion: tekton.dev/v1beta1 kind: Task metadata: name: gcp-kubectl-deploy namespace: tekton-pipelines spec: params: - name: release_namespace default: "tekton-pipelines" - name: charts_dir
Tekton 安装 kubectl create ns tekton-pipelines kubens tekton-pipelines kubectl apply --filename https:/ tekton-role.yaml kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: tekton-role namespace: tekton-pipelines : rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: tekton-role-binding namespace: tekton-pipelines
--from-literal=storageClassName=rook-ceph-block \ -o yaml -n tekton-pipelines ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: tekton-dashboard namespace: tekton-pipelines serviceName: tekton-dashboard servicePort: 9097 kubectl apply -f ingress.yaml -n tekton-pipelines 校验 kubectl get pods --namespace tekton-pipelines Dashboard 页面 HelloWorld 该示例执行一个命令行输出 Hello World 定义
mkdir -vp /storage/dev/webapp/tekton-pipelines/Tekton cd /storage/dev/webapp/tekton-pipelines/Tekton Step 3.部署 Tekton-Pipelines # 部署 Tekton-Pipelines kubectl apply -f TektonCD-Pipelines.yaml # 查看Pod状态( 默认创建 tekton-pipelines 与 tekton-pipelines-resolvers 两个名称空间 ) kubectl get pods --namespace tekton-pipelines -l app.kubernetes.io/part-of=tekton-pipelines # NAME READY # 若没有其他错误及tekton-pipelines名称空间下pod均已全部启动,并且显示如下提示则表示安装成功。 Congratulations!
tektoncd/pipeline/blob/master/docs/install.md #登录okd oc login -u system:admin #创建projects oc new-project tekton-pipelines filename https://storage.googleapis.com/tekton-releases/latest/release.yaml #验证 oc get pods --namespace tekton-pipelines
--from-literal=storageClassName=rook-ceph-block \ -o yaml -n tekton-pipelines ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: tekton-dashboard namespace: tekton-pipelines serviceName: tekton-dashboard servicePort: 9097 kubectl apply -f ingress.yaml -n tekton-pipelines 校验 kubectl get pods --namespace tekton-pipelines Dashboard 页面 HelloWorld 该示例执行一个命令行输出 Hello World 定义
: $ kubectl apply -f \ https://storage.googleapis.com/tekton-releases/latest/release.yaml namespace/tekton-pipelines created podsecuritypolicy.policy/tekton-pipelines created clusterrole.rbac.authorization.k8s.io/tekton-pipelines-admin created ... $ kubectl get pods -n tekton-pipelines NAME READY
/releases/download/v0.1.1/openshift-tekton-dashboard.yaml --validate=false 4.验证 访问openshift web页面,进入tekton-pipelines
kubectl apply -f \ https://storage.googleapis.com/tekton-releases/latest/release.yaml namespace/tekton-pipelines created podsecuritypolicy.policy/tekton-pipelines created clusterrole.rbac.authorization.k8s.io/tekton-pipelines-admin created ... $ kubectl get pods -n tekton-pipelines NAME READY
--from-literal=storageClassName=manual \ -o yaml -n tekton-pipelines --from-literal=default-service-account=YOUR-SERVICE-ACCOUNT \ -o yaml -n tekton-pipelines
kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml namespace/tekton-pipelines policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+ podsecuritypolicy.policy/tekton-pipelines service/tekton-pipelines-webhook created #首次安装,等待拉取镜像 [developer@localhost ~]$ kubectl get pods -n tekton-pipelines
raw.githubusercontent.com/cnych/qikqiak.com/master/data/manifests/tekton/release.yaml 上面的资源清单文件安装后,会创建一个名为 tekton-pipelines 在该命名空间下面会有大量和 tekton 相关的资源对象,我们可以通过在该命名空间中查看 Pod 并确保它们处于 Running 状态来检查安装是否成功: $ kubectl get pods -n tekton-pipelines
apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml namespace/tekton-pipelines created podsecuritypolicy.policy/tekton-pipelines created clusterrole.rbac.authorization.k8s.io/tekton-pipelines-controller-cluster-access tekton-pipelines-webhook created service/tekton-pipelines-webhook created 检查下,发现也没有起来 % kubectl -n tekton-pipelines
Nodeport 暴露端口,这里采用 port-forward 的形式将端口映射到本地: $ kubectl port-forward svc/tekton-dashboard 8097:9097 -n tekton-pipelines
后续有时间再优化脚本,实现自动更新release.yaml) 手动更新tekton-dashboard-release.yaml中的镜像;然后部署; [root@master ~]# kubectl -n tekton-pipelines dashboard: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: tekton-service namespace: tekton-pipelines
部署 Tekton 部署 Tekton pipeline kubectl create namespace tekton-pipelines kubectl apply -f tekton-pipeline-release.yaml dashboard: kubectl apply -f tekton-dashboard-release.yaml 检查 pod 的状态: kubectl get pods --namespace tekton-pipelines 可以看到如下的输出 pod 正常 running 之后,转发集群端口到本地,即可通过本地访问: kubectl --namespace tekton-pipelines port-forward svc
运行起来后可以在Tekton-pipelines namespace下看到两个deployment: # kubectl -n Tekton-pipelines get deploy NAME