मुख्य सामग्री पर जाएँ
Skillpedia
डिप्लॉय और क्लाउड (DevOps)17k · #10772

kubesphere-devops-tenant

यह क्या करती है

यह स्किल AI एजेंट को namespace-स्तर के उपयोगकर्ता के लिए DevOps कार्य चलाने में मदद करती है, जिसके पास cluster admin अधिकार नहीं हैं। यह उन project admins और ऑपरेटरों के लिए है जिन्हें पूरी क्लस्टर पहुँच के बिना pipeline का काम चाहिए।

कब इस्तेमाल करें

  • ✓जब आप KubeSphere में project admin हों और आपके पास cluster admin अधिकार न हों।
  • ✓जब आपको वे DevOps projects देखने हों जिन तक आपकी पहुँच है, और KubeSphere API से pipeline चलाना हो।
  • ✓जब आप छोटा टूल बना रहे हों जो केवल अपने namespace की पहुँच वाले टीम सदस्यों के लिए हो।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-tenant/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे पास केवल project-स्तर की पहुँच है। क्या आप वे DevOps projects दिखा सकते हैं जो मैं इस्तेमाल कर सकता हूँ, और हमारी staging pipeline शुरू कर सकते हैं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट namespace उपयोगकर्ताओं के लिए काम करने वाले KubeSphere API routes इस्तेमाल करता है। वह उन namespaces की सूची देता है जिन तक आप पहुँच सकते हैं, जो DevOps projects हैं, और फिर उसी API से pipeline क्रियाएँ चलाता है।

तकनीकी सामग्री (मूल 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 secrets देख सकता है?

नहीं। स्किल कहती है कि namespace उपयोगकर्ता DevOps system namespace के Jenkins secrets तक नहीं पहुँच सकते।

यह मेरे DevOps projects की सूची कैसे बनाता है?

यह आपके workspace में उन namespaces की सूची देता है जिन तक आपकी पहुँच है, क्योंकि DevOps projects namespaces ही हैं।

क्या कोई tenant सीधे Jenkins को कॉल कर सकता है?

नहीं। स्किल कहती है कि tenants को Jenkins को सीधे कॉल करने के बजाय KubeSphere APIs इस्तेमाल करने चाहिए।

जानकारी

लेखक का मूल विवरण

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
लाइसेंस
—
अपडेट की गई
14/7/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills