This demo project is created to reproduce a KCP bug.
I have run this setup for some hours and the measurements kept their trendency.
-
I used OperatorSDK to scaffold the content of this repo
- created a single
Fooresource with its controller
- created a single
-
downloaded the KCP binary, run locally
The controller could not be simpler.
The CRD that it works on:
type FooSpec struct {
Foo string `json:"foo,omitempty"`
}
type FooStatus struct {
Message string `json:"message,omitempty"`
}It sets the status message to the foo field's value.
The simplified code:
func (r *FooReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
var instance demov1alpha1.Foo
r.Get(ctx, req.NamespacedName, &instance)
instance.Status.Message = instance.Spec.Foo
r.Update(ctx, &instance)
return ctrl.Result{}, nil
}Prerequsites:
- place a KCP binary under:
./bin/kcp
Hint: tmux helps
-
run KCP:
make start-kcp -
export KUBECONFIG=$(pwd)/kcp/admin.kubeconfig -
run the operator:
make run -
run some stimulus:
./apply-loop.sh
- place a Prometheus binary under:
./bin/prometheus - run it:
make promprocess_resident_memory_bytes/1024/1024go_goroutines

