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

kubesphere-devops-tenant

하는 일

이 스킬은 AI 에이전트가 클러스터 관리자 권한이 없는 네임스페이스 수준 사용자를 위해 DevOps 작업을 수행하도록 돕습니다. 전체 클러스터 접근 없이 파이프라인 작업이 필요한 프로젝트 관리자와 운영자를 위한 스킬입니다.

사용하는 경우

  • ✓KubeSphere에서 프로젝트 관리자이지만 클러스터 관리자 권한이 없을 때.
  • ✓접근 가능한 DevOps 프로젝트를 나열하고 KubeSphere API로 파이프라인을 실행해야 할 때.
  • ✓자기 네임스페이스에만 접근하는 팀원을 위한 작은 도구를 만드는 경우.

스킬 링크

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

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

사용 방법

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

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

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

AI에게 요청하는 예시

“저는 프로젝트 수준의 접근 권한만 있습니다. 제가 쓸 수 있는 DevOps 프로젝트를 나열하고 스테이징 파이프라인을 시작해 주실 수 있나요?”

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

작동 방식

에이전트는 네임스페이스 사용자에게 맞는 KubeSphere API 경로를 사용합니다. DevOps 프로젝트가 네임스페이스이므로, 접근 가능한 네임스페이스를 나열하고 같은 API로 파이프라인 작업을 실행합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

KubeSphere DevOps Tenant Operations

Overview

This guide covers DevOps operations for namespace-scoped tenants who:

  • Have admin/operator permissions within their DevOpsProject namespace(s)
  • Cannot access kubesphere-devops-system (Jenkins secrets, tokens)
  • Cannot call Jenkins APIs directly
  • Must use KubeSphere APIs (/kapis/devops.kubesphere.io/) for all operations
  • Use KubeSphere authentication (OAuth tokens), not Jenkins tokens

Critical Distinction: DevOps projects are namespaces, not DevOpsProject CRs. To list accessible DevOps projects:

# Correct - lists namespaces (DevOps projects) tenant can access
GET /clusters/{cluster}/kapis/devops.kubesphere.io/v1alpha3/workspaces/{workspace}/namespaces

# Wrong - requires cluster-admin, returns 403 for tenants
GET /clusters/{cluster}/apis/devops.kubesphere.io/v1alpha3/devopsprojects

When to Use

  • Operating as a project admin/operator (not cluster admin)
  • Working within tenant namespace boundaries
  • No access to Jenkins secrets in kubesphere-devops-system
  • Need to trigger pipelines via KubeSphere API
  • Building automation for namespace-scoped users
  • Developing tenant-facing tooling

Tenant vs Admin Permissions

Capability Tenant (Namespace) Admin (Cluster)
Access DevOpsProject ✅ Own namespace(s) ✅ All namespaces
Create/Edit Pipelines ✅ In own namespace ✅ Any namespace
View PipelineRuns ✅ In own namespace ✅ Any namespace
Access Jenkins Secret ❌ No ✅ kubesphere-devops-system
Direct Jenkins API ❌ No ✅ Full access
View Jenkins Console ❌ No ✅ Via NodePort
KubeSphere API ✅ /kapis/ ✅ /kapis/

Authentication

Tenants authenticate via KubeSphere's OAuth, not Jenkins. See kubesphere-core for complete OAuth authentication details.

Quick Reference

# Exchange credentials for OAuth token (see core skill for details)
export KUBESPHERE_API="https://kubesphere-api.example.com"
export USERNAME="tenant-user"
export PASSWORD="tenant-password"

# Get token
export API_TOKEN=$(curl -s -X POST "${KUBESPHERE_API}/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password&username=${USERNAME}&password=${PASSWORD}&client_id=kubesphere&client_secret=kubesphere" \
  | jq -r '.access_token')

# Use token
curl -s "${KUBESPHERE_API}/kapis/devops.kubesphere.io/v1alpha3/namespaces/demo-project/pipelines" \
  -H "Authorization: Bearer ${API_TOKEN}"

Key Points:

  • OAuth token expires in 7200 seconds (2 hours)
  • Use client_id=kubesphere and client_secret=kubesphere
  • Token contains user's RBAC permissions

See kubesphere-core for complete OAuth authentication details including token refresh and common use cases.

Get KubeSphere API Token

Tenants authenticate via KubeSphere's OAuth, not Jenkins:

# Method 1: Using kubeconfig (if configured)
kubectl config view --raw -o jsonpath='{.users[?(@.name=="current-user")].user.token}'

# Method 2: Via KubeSphere OAuth API (Recommended)
export KUBESPHERE_URL="https://kubesphere-api.example.com"
export USERNAME="tenant-user"
export PASSWORD="tenant-password"

# Exchange credentials for token
TOKEN_RESPONSE=$(curl -s -X POST "${KUBESPHERE_URL}/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "grant_type=password" \
  --data-urlencode "username=${USERNAME}" \
  --data-urlencode "password=${PASSWORD}" \
  --data-urlencode "client_id=kubesphere" \
  --data-urlencode "client_secret=kubesphere")

# Extract access token
ACCESS_TOKEN=$(echo "$TOKEN_RESPONSE" | jq -r '.access_token')

# Token expires in 7200 seconds (2 hours)
echo "Token obtained: ${ACCESS_TOKEN:0:50}..."

Using Token with API

export API_TOKEN="<your-kubesphere-token>"
export DEVOPS_PROJECT="demo-project"
export KUBESPHERE_API="https://kubesphere-api.example.com"

# Verify access
curl -s "${KUBESPHERE_API}/kapis/devops.kubesphere.io/v1alpha2/namespaces/${DEVOPS_PROJECT}/pipelines" \
  -H "Authorization: Bearer ${API_TOKEN}"

Complete Working Example

Here's a verified workflow using tenant credentials (stoneshi / P@88w0rd):

Step 1: Authenticate

export KUBESPHERE_API="http://kubesphere-apiserver.kubesphere-system.svc:80"
export USERNAME="stoneshi"
export PASSWORD='P@88w0rd'

# Get
자주 묻는 질문

이 스킬로 Jenkins 비밀 정보를 볼 수 있나요?

아니요. 스킬에 따르면 네임스페이스 사용자는 DevOps 시스템 네임스페이스의 Jenkins 시크릿에 접근할 수 없습니다.

내 DevOps 프로젝트는 어떻게 나열하나요?

작업 공간에서 접근할 수 있는 네임스페이스를 나열합니다. DevOps 프로젝트가 네임스페이스이기 때문입니다.

테넌트가 Jenkins를 직접 호출할 수 있나요?

아니요. 스킬에 따르면 테넌트는 Jenkins를 직접 부르지 않고 KubeSphere API를 사용해야 합니다.

상세 정보

작성자의 원본 설명

Use when operating KubeSphere DevOps as a namespace-scoped tenant with limited permissions, without cluster-admin access, or when accessing DevOps through KubeSphere APIs only

repo: kubesphere/kubesphere

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬