본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)17k · #10771

kubesphere-devops-pipeline

하는 일

이 스킬은 AI 에이전트가 파이프라인 뒤에 있는 Kubernetes 객체를 통해 KubeSphere DevOps의 파이프라인을 관리하도록 돕습니다. 파이프라인을 만들고 실행하는 개발자와 운영자를 위한 스킬입니다.

사용하는 경우

  • ✓프로젝트의 CI/CD 파이프라인을 만들거나 업데이트하고 싶을 때.
  • ✓파이프라인 실행을 시작하고 끝났는지 확인해야 할 때.
  • ✓파이프라인 실행이 실패해서 로그와 산출물을 검토해야 하는 경우.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-pipeline/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 API 프로젝트의 빌드 파이프라인을 실행하고, 실행이 성공했는지 알려 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 파이프라인을 실행하기 전에 매개변수가 필요한지 확인합니다. 그다음 파이프라인 객체를 만들거나 업데이트하고, 실행을 지켜보며, 필요할 때 로그와 산출물을 읽습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

에이전트는 파이프라인 매개변수를 먼저 확인하나요?

네. 스킬에 따르면 어떤 파이프라인이든 실행하기 전에 매개변수를 확인해야 합니다.

에이전트는 파이프라인 상태를 어디에서 읽나요?

Kubernetes의 파이프라인 객체와 실행 객체를 읽습니다. 이 객체는 뒤에 있는 Jenkins 작업과 대응합니다.

실패한 실행도 도와줄 수 있나요?

네. 파이프라인 로그를 읽고 실패한 실행을 문제 해결하는 방법을 다룹니다.

상세 정보

작성자의 원본 설명

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

repo: kubesphere/kubesphere

인기도

GitHub 스타
17k
순위
#10771
라이선스
—
업데이트
2026. 7. 14.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬