Skillpedia
النشر والسحابة (DevOps)17k · #10772

kubesphere-devops-tenant

ما الذي تفعله

تساعد هذه المهارة وكيلك على تنفيذ مهام DevOps لمستخدم على مستوى مساحة الأسماء دون صلاحيات مشرف المجموعة. وهي موجهة إلى مديري المشاريع والمشغلين الذين يحتاجون إلى عمل خطوط الأنابيب دون وصول كامل للمجموعة.

متى تستخدمها

  • ✓عندما تكون مدير مشروع في KubeSphere ولا تملك صلاحيات مشرف المجموعة.
  • ✓عندما تحتاج إلى عرض مشاريع DevOps التي تستطيع الوصول إليها، وتشغيل خط أنابيب عبر واجهة KubeSphere البرمجية.
  • ✓عندما تبني أداة صغيرة لأعضاء الفريق الذين يملكون صلاحية الوصول إلى مساحة أسمائهم فقط.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-devops-tenant/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“لدي صلاحية على مستوى المشروع فقط. هل يمكنك عرض مشاريع DevOps التي أستطيع استخدامها وتشغيل خط أنابيب البيئة التجريبية لدينا؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يستخدم وكيلك مسارات واجهة KubeSphere البرمجية التي تعمل مع مستخدمي مساحات الأسماء. يعرض مساحات الأسماء التي تستطيع الوصول إليها كمشاريع DevOps، ثم ينفذ إجراءات خط الأنابيب عبر الواجهة نفسها.

المحتوى التقني (ملف 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 بهذه المهارة؟

لا. تنص المهارة على أن مستخدمي مساحات الأسماء لا يستطيعون الوصول إلى أسرار Jenkins في مساحة أسماء نظام DevOps.

كيف يعرض مشاريع DevOps الخاصة بي؟

يعرض مساحات الأسماء التي لديك صلاحية عليها في مساحة العمل الخاصة بك، لأن مشاريع DevOps هي مساحات أسماء.

هل يستطيع المستأجر استدعاء Jenkins مباشرة؟

لا. تنص المهارة على أن على المستأجرين استخدام واجهات KubeSphere البرمجية بدلاً من استدعاء Jenkins.

التفاصيل

الوصف الأصلي من المؤلف

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

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة