Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)17k · #10771

kubesphere-devops-pipeline

Ce qu’il fait

Cette skill aide un agent IA à gérer les pipelines de KubeSphere DevOps à travers les objets Kubernetes qui les sous-tendent. Elle s'adresse aux développeurs et aux opérateurs qui construisent et exécutent des pipelines.

Quand l’utiliser

  • ✓Quand vous voulez créer ou mettre à jour un pipeline CI/CD pour un projet.
  • ✓Quand vous devez lancer une exécution de pipeline et vérifier si elle s'est terminée.
  • ✓Quand une exécution de pipeline a échoué et que vous voulez examiner ses journaux et ses artefacts.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-pipeline/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Peux-tu lancer le pipeline de construction de notre projet API et me dire si l'exécution réussit ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent vérifie d'abord si le pipeline a besoin de paramètres avant de le lancer. Il crée ou met à jour l'objet pipeline, suit l'exécution et lit les journaux et les artefacts en cas de besoin.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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

Questions fréquentes

L'agent vérifie-t-il d'abord les paramètres du pipeline ?

Oui. La skill indique de vérifier les paramètres avant de déclencher un pipeline.

Où l'agent lit-il l'état du pipeline ?

Il lit les objets pipeline et exécution dans Kubernetes, qui correspondent aux tâches Jenkins sous-jacentes.

Peut-il aider pour une exécution en échec ?

Oui. La skill couvre la lecture des journaux du pipeline et le dépannage des exécutions en échec.

Détails

Description originale de l’auteur

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

repo: kubesphere/kubesphere

Popularité

Étoiles GitHub
17k
Position au classement
#10771
Licence
—
Mis à jour
14/07/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires