-
Go v1.17.9+
-
Docker 17.03+
-
kubectl v1.11.3+
-
訪問Kubernetes v1.11.3+叢集(強烈建議使用kind設定自己的本地叢集,它非常容易使用!)
"3.4.1"
"1.23.5"
"d59d7882ce95ce5de10238e135ddff31d8ede026"
"2022-05-06T13:58:56Z"
"darwin"
"amd64"
for
for
-
main.go是專案入口,負責設定並執行管理器。
-
config/包含在Kubernetes中部署Operator的manifest。
-
Dockerfile是用於構建管理器映象的容器檔案。


for
for
"hack/boilerplate.go.txt"
"./…"
-
api/v1包含Foo CRD
-
controllers包含Foo控制器
"k8s.io/apimachinery/pkg/apis/meta/v1"
type
for
"name"
type
set
trueif
"happy,omitempty"
true
for
type
",inline"
"metadata,omitempty"
"spec,omitempty"
"status,omitempty"
true
type
",inline"
"metadata,omitempty"
"items"
init
"context"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"
"my.domain/tutorial/api/v1"
type
""
which
log
"reconciling foo custom resource"
if
"unable to fetch Foo"
return
if
"unable to update foo's happy status"
"status"
return
"foo's happy status updated"
"status"
"foo custom resource reconciled"
return
return
log
if
"unable to list foo custom resources"
else
for
if
GetName
"pod linked to a foo custom resource issued an event"
"name"
return
"./…"
"./…"
"./…"
"hack/boilerplate.go.txt"
"./…"
"addr"
":8080"
"path"
"/metrics"
"kind"
"metrics"
"addr"
"[::]:8080"
"kind"
"health probe"
"addr"
"[::]:8081"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"source"
"kind source: *v1.Foo"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"source"
"kind source: *v1.Pod"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"worker count"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-1"
"namespace"
"default"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-2"
"namespace"
"default"
"status"
"false"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-2"
"namespace"
"default"
# Just sleep forever
command
"sleep"
"infinity"
"name"
"jack"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-1"
"namespace"
"default"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-1"
"namespace"
"default"
"name"
"jack"
"reconciler group"
"tutorial.my.domain"
"reconciler kind"
"Foo"
"name"
"foo-2"
"namespace"
"default"
"name"
"jack"

