Skip to content
Cloud & Infrastructure
Skill

/kubesphere-devops-credentials

Use when managing credentials in KubeSphere DevOps, including repository credentials, kubeconfig, and API tokens

From plugin
kubesphere
17k32 skills

Claude Code

$ npx -y skills add kubesphere/kubesphere --skill kubesphere-devops-credentials --agent claude-code

SKILL.md

kubesphere-devops-credentials.SKILL.md
name: kubesphere-devops-credentials
description: Use when managing credentials in KubeSphere DevOps, including repository credentials, kubeconfig, and API tokens

KubeSphere DevOps Credentials

Overview

Credentials in KubeSphere DevOps are Kubernetes Secrets with specific labels and annotations. They are synced to Jenkins for use in pipelines. Supported types include SSH keys, username/password, and secret tokens.

When to Use

  • Creating credentials for Git repositories
  • Setting up deployment credentials (kubeconfig, registry)
  • Managing API tokens for external services
  • Troubleshooting credential access issues
  • Migrating credentials between DevOps projects

Credential Types

| Type | Use Case | Secret Key | |------|----------|------------| | **SSH** | Git repositories | `username`, `privatekey` | | **Basic** | Username/password | `username`, `password` | | **Secret** | API tokens, secrets | `secret` | | **Kubeconfig** | Kubernetes clusters | `kubeconfig` (v1.1.x only) | | **SSH Username/Pass** | Git with user/pass | `username`, `password` | | **String** | Generic text/tokens | `secret` |

Resource Structure

Credentials are stored as Kubernetes Secrets with DevOps labels:

apiVersion: v1
kind: Secret
metadata:
  name: my-credential
  namespace: project-xxx  # DevOps project namespace
  labels:
    devops.kubesphere.io/credential: "true"
  annotations:
    credential.devops.kubesphere.io/syncstatus: successful
    credential.devops.kubesphere.io/type: ssh|basic-auth|secret-text
stringData:
  username: git-user
  privatekey: |
    -----BEGIN OPENSSH PRIVATE KEY-----
    ...
    -----END OPENSSH PRIVATE KEY-----
type: credential.devops.kubesphere.io/ssh  # CRITICAL: Must use credential.devops.kubesphere.io/* type, NOT Opaque!

**โš ๏ธ CRITICAL: Secret Type Must Be `credential.devops.kubesphere.io/*`**

The `type` field must be one of:

  • `credential.devops.kubesphere.io/basic-auth`
  • `credential.devops.kubesphere.io/ssh-auth`
  • `credential.devops.kubesphere.io/secret-text`
  • `credential.devops.kubesphere.io/kubeconfig`

**Using `type: Opaque` will result in:**

  • Credential sync status stuck at "pending"
  • Jenkins cannot find the credential
  • Pipeline builds fail with "CredentialId could not be found"

**Controller Logic:** The credential controller only watches secrets with types starting with `credential.devops.kubesphere.io/` (see `devopscredential_controller.go` line 102). Secrets with `type: Opaque` are completely ignored.

API Endpoints

| Operation | Method | Endpoint | |-----------|--------|----------| | List Credentials | GET | `/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials` | | Create Credential | POST | `/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials` | | Get Credential | GET | `/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials/{credential}` | | Update Credential | PUT | `/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials/{credential}` | | Delete Credential | DELETE | `/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials/{credential}` | | Get Usage | GET | `/kapis/devops.kubesphere.io/v1alpha2/namespaces/{devops}/credentials/{credential}/usage` |

Common Operations

List Credentials

curl "https://kubesphere-api/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials" \
  -H "Authorization: Bearer $TOKEN"

Create SSH Credential

curl -X POST "https://kubesphere-api/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "apiVersion": "v1",
    "kind": "Secret",
    "metadata": {
      "name": "github-ssh-key",
      "annotations": {
        "credential.devops.kubesphere.io/type": "ssh"
      }
    },
    "stringData": {
      "username": "git",
      "privatekey": "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----"
    },
    "type": "credential.devops.kubesphere.io/ssh-auth"
  }'

Create Basic Auth Credential

curl -X POST "https://kubesphere-api/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "apiVersion": "v1",
    "kind": "Secret",
    "metadata": {
      "name": "docker-registry",
      "annotations": {
        "credential.devops.kubesphere.io/type": "basic-auth"
      }
    },
    "stringData": {
      "username": "docker-user",
      "password": "docker-password"
    },
    "type": "credential.devops.kubesphere.io/basic-auth"
  }'

Create Basic Auth for Git Access Token (GitHub/GitLab)

**Best Practice:** Use `basic-auth` type for Git access tokens:

# For GitHub/GitLab access tokens
curl -X POST "https://kubesphere-api/kapis/devops.kubesphere.io/v1alpha3/namespaces/{devops}/credentials" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "apiVersion": "v1",
    "kind": "Secret",
    "metadata": {
      "name": "github-token",
      "annotations": {
        "credential.devops.kubesphere.io/type": "basic-auth"
      }
    },
    "stringData": {
      "username": "git",           # Can be any value for token auth
      "password": "ghp_xxxxxxxxxx"  # Your GitHub/GitLab access token
    },
    "type": "credential.devops.kubesphere.io/basic-auth"
  }'

**Why basic-auth for tokens?**

  • Git access tokens are used like passwords in HTTPS Git URLs
  • ArgoCD and Jenkins both support basic-auth for Git authentication
  • Username can be any value (often 'git' or your username)
  • Password field holds the actual token

**Supported Git Providers:**

  • GitHub Personal Access Token: `ghp_xxxxxxxxxxxx`
  • GitLab Personal Access Token: `glpat-xxxxxxxxxx`
  • Bitbucket App Password
  • Gitea/Forgejo Access Token

Create Secret Text Credential

curl -X POST "https://kubesphere-api/kapis/devops.kub
Read more
@kubesphere
Ships withkubesphere

The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management โŽˆ ๐Ÿ–ฅ โ˜๏ธ

Stars on GitHub

Momentum

stars in total
17.1k
Star history of kubesphere/kubesphere on GitHub, a chart by star-history.com

Other skills on kubesphere.

kubeeye

kubeeye

Use when deploying KubeEye for cluster inspection, creating InspectRule/InspectPlan resources, or retrieving inspection results.โ€ฆ

kubesphere-core

kubesphere-core

KubeSphere central controller Skill. Routes to specific Skills based on user requests: multi-cluster managementโ€ฆ

More skills from other plugins.

container

container

Use when running, building, or managing Linux containers on macOS, or when a task involves Docker, docker compose, Lima, Colima,โ€ฆ

@apple@appleInstall Skill
agent-advisor

agent-advisor

Entry point for AI-agent work on AWS: pick a runtime, plan a migration for existing workloads, and build an executable POC โ€” oneโ€ฆ

@aws@awsInstall Skill
agents-sdk
Auto-invoked

agents-sdk

Build, debug, or review Cloudflare Agents SDK applications using the agents package.

cloudflare10d3.2k
@cloudflare@cloudflareInstall Skill

Questions about kubesphere-devops-credentials.

Which coding agents can use kubesphere-devops-credentials?
kubesphere-devops-credentials installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.