Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)17k Β· #10771

kubesphere-devops-pipeline

Fungsinya

Skill ini membantu agent AI mengelola pipeline di KubeSphere DevOps melalui objek Kubernetes di baliknya. Skill ini untuk pengembang dan operator yang membangun dan menjalankan pipeline.

Kapan dipakai

  • βœ“Saat Anda ingin membuat atau memperbarui pipeline CI/CD untuk sebuah proyek.
  • βœ“Saat Anda perlu memulai run pipeline dan memeriksa apakah sudah selesai.
  • βœ“Saat sebuah run pipeline gagal dan Anda ingin log serta artefaknya ditinjau.

Link skill

https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-pipeline/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-pipeline/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBisakah Anda memulai pipeline build untuk proyek API kami dan memberi tahu saya apakah run-nya berhasil?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memeriksa apakah pipeline memerlukan parameter sebelum memulai run. Kemudian agent membuat atau memperbarui objek pipeline, mengawasi run, dan membaca log serta artefak bila diperlukan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

KubeSphere DevOps Pipeline Management

Overview

Pipelines in KubeSphere DevOps are Kubernetes custom resources that integrate with Jenkins. KubeSphere uses a cloud-native, object-reconcile approach where Kubernetes resources are the source of truth.

When to Use

  • Creating or updating CI/CD pipelines
  • Triggering pipeline runs
  • Monitoring pipeline execution
  • Retrieving pipeline logs and artifacts
  • Troubleshooting failed pipeline runs

Architecture Mapping

KubeSphere DevOps maps Kubernetes resources to Jenkins objects:

KubeSphere Resource K8s Resource Jenkins Resource
DevOpsProject DevOpsProject CR + Namespace Folder
Pipeline Pipeline CR WorkflowJob
PipelineRun PipelineRun CR Build Run
Workspace Workspace CR (authorization context)
KubeSphere          Kubernetes                Jenkins
─────────────────────────────────────────────────────────────
Workspace demo
└── DevOpsProject   β†’ demo-project NS          β†’ Folder demo-project
    └── Pipeline    β†’ Pipeline CR              β†’ WorkflowJob
        └── Run     β†’ PipelineRun CR           β†’ Build #1

Triggering Pipeline Runs (Recommended: Object-Reconcile)

CRITICAL: ALWAYS Check for Parameters First!

Before triggering ANY pipeline (regular or multi-branch), you MUST check if the pipeline has parameters defined. Triggering a pipeline without required parameters will cause the build to fail or use incorrect defaults.

For Multi-Branch Pipelines: Query /branches/{branch} endpoint to get .parameters array For Regular Pipelines: Query the Pipeline CR and check .spec.pipeline.jenkinsfile for parameters {} directive

Preferred Approach: Create a PipelineRun custom resource. KubeSphere watches for these resources and triggers the corresponding Jenkins build.

Create a PipelineRun

apiVersion: devops.kubesphere.io/v1alpha3
kind: PipelineRun
metadata:
  name: my-pipeline-run-001
  namespace: demo-project
spec:
  pipelineRef:
    name: my-pipeline
  parameters:
    - name: BRANCH
      value: "main"

Apply with kubectl:

kubectl apply -f pipelinerun.yaml

Check PipelineRun Status

# List all runs
kubectl get pipelineruns -n demo-project

# Get specific run status
kubectl get pipelinerun my-pipeline-run-001 -n demo-project -o yaml

# Watch run progress
kubectl get pipelineruns -n demo-project -w

PipelineRun Status Fields

Field Description
status.phase Current state (Pending, Running, Succeeded, Failed, Unknown)
status.conditions Detailed conditions (Succeeded, Ready)
status.completionTime When run finished
status.startTime When run started

Delete a PipelineRun

kubectl delete pipelinerun my-pipeline-run-001 -n demo-project

Working Pipeline Example

Here's a complete, working pipeline that builds a Go application:

apiVersion: devops.kubesphere.io/v1alpha3
kind: Pipeline
metadata:
  name: go-demo-pipeline
  namespace: demo-project
spec:
  type: pipeline
  pipeline:
    name: go-demo-pipeline
    description: "Build and test Go application"
    jenkinsfile: |
      pipeline {
        agent any

        stages {
          stage('Build, Test and Archive') {
            agent {
              kubernetes {
                yaml '''
                  apiVersion: v1
                  kind: Pod
                  spec:
                    containers:
                    - name: golang
                      image: golang:1.21
                      command: ["sleep"]
                      args: ["99d"]
                '''
              }
            }
            steps {
              container('golang') {
                sh '''
                  export GO111MODULE=on
                  git clone https://github.com/kubesphere-sigs/demo-go-http.git .
                  go mod download
                  go test ./... -v
                  go build -o service main.go
                '''
              }
              archiveArtifacts artifacts: 'service', followSymlinks: false
            }
          }
        }
      }

Key Points:

  • Uses agent { kubernetes { yaml ... } } to define a custom pod with Go container
  • The archiveArtifacts step must be in the same stage as the build (same workspace)
  • Container name in container('golang') must match the container name in the YAML

Pipelin

Pertanyaan umum

Apakah agent memeriksa parameter pipeline terlebih dahulu?

Ya. Skill ini menyatakan untuk memeriksa parameter sebelum memicu pipeline apa pun.

Di mana agent membaca status pipeline?

Agent membaca objek pipeline dan run di Kubernetes, yang terpetakan ke job Jenkins di baliknya.

Bisakah membantu run yang gagal?

Bisa. Skill ini mencakup pembacaan log pipeline dan pemecahan masalah run yang gagal.

Detail

Deskripsi asli dari pembuat

Use when creating, running, or managing CI/CD pipelines in KubeSphere DevOps, including pipeline API operations and run monitoring

repo: kubesphere/kubesphere

Popularitas

Bintang GitHub
17k
Peringkat
#10771
Lisensi
β€”
Diperbarui
14/7/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa