소스 정보
- 저장소
- pluginagentmarketplace/custom-plugin-go
- 최근 소스 활동
- 2025년 12월 30일 12:44
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-go --skill go-kubernetes명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | go-kubernetes |
| description | Kubernetes operators and client-go development |
| sasmp_version | 1.3.0 |
| bonded_agent | 08-go-devops |
| bond_type | PRIMARY_BOND |
Build Kubernetes operators and controllers with client-go.
Develop custom Kubernetes controllers, operators, and CRDs using client-go and controller-runtime.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | yes | - | Type: "operator", "controller", "crd" |
| framework | string | no | "controller-runtime" | Framework |
import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
)
func NewClient() (*kubernetes.Clientset, error) {
config, err := rest.InClusterConfig()
if err != nil {
// Fallback to kubeconfig
kubeconfig := filepath.Join(os.Getenv("HOME"), ".kube", "config")
config, err = clientcmd.BuildConfigFromFlags("", kubeconfig)
if err != nil {
return nil, err
}
}
return kubernetes.NewForConfig(config)
}
func WatchPods(ctx context.Context, client *kubernetes.Clientset, namespace string) error {
watcher, err := client.CoreV1().Pods(namespace).Watch(ctx, metav1.ListOptions{})
if err != nil {
return err
}
defer watcher.Stop()
for event := range watcher.ResultChan() {
pod := event.Object.(*corev1.Pod)
switch event.Type {
case watch.Added:
fmt.Printf("Pod added: %s\n", pod.Name)
case watch.Modified:
fmt.Printf("Pod modified: %s (phase: %s)\n", pod.Name, pod.Status.Phase)
case watch.Deleted:
fmt.Printf("Pod deleted: %s\n", pod.Name)
}
}
return nil
}
type MyReconciler struct {
client.Client
Scheme *runtime.Scheme
Log logr.Logger
}
func (r *MyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
log := r.Log.WithValues("resource", req.NamespacedName)
var myResource myv1.MyResource
if err := r.Get(ctx, req.NamespacedName, &myResource); err != nil {
if apierrors.IsNotFound(err) {
return ctrl.Result{}, nil
}
return ctrl.Result{}, err
}
// Reconciliation logic
if myResource.Status.Phase == "" {
myResource.Status.Phase = "Pending"
if err := r.Status().Update(ctx, &myResource); err != nil {
return ctrl.Result{}, err
}
}
return ctrl.Result{RequeueAfter: time.Minute}, nil
}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: myresources.example.com
spec:
group: example.com
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
replicas:
type: integer
status:
type: object
properties:
phase:
type: string
scope: Namespaced
names:
plural: myresources
singular: myresource
kind: MyResource
| Symptom | Cause | Fix |
|---|---|---|
| RBAC denied | Missing permissions | Check ServiceAccount |
| CRD not found | Not installed | kubectl apply CRD |
| Leader election fail | Lease conflict | Check replicas |
Skill("go-kubernetes")
SOC 직업 분류 기준