mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-07 10:17:51 +00:00
Add vendor folder to git
This commit is contained in:
parent
66cf5eaafb
commit
183585f56f
6916 changed files with 2629581 additions and 1 deletions
44
vendor/k8s.io/client-go/examples/third-party-resources/README.md
generated
vendored
Normal file
44
vendor/k8s.io/client-go/examples/third-party-resources/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Third Party Resources Example
|
||||
|
||||
This particular example demonstrates how to perform basic operations such as:
|
||||
|
||||
* How to register a new ThirdPartyResource (custom Resource type)
|
||||
* How to create/get/list instances of your new Resource type (update/delete/etc work as well but are not demonstrated)
|
||||
* How to setup a controller on Resource handling create/update/delete events
|
||||
|
||||
## Running
|
||||
|
||||
```
|
||||
# assumes you have a working kubeconfig, not required if operating in-cluster
|
||||
go run *.go -kubeconfig=$HOME/.kube/config
|
||||
```
|
||||
|
||||
## Use Cases
|
||||
|
||||
ThirdPartyResources can be used to implement custom Resource types for your Kubernetes cluster.
|
||||
These act like most other Resources in Kubernetes, and may be `kubectl apply`'d, etc.
|
||||
|
||||
Some example use cases:
|
||||
|
||||
* Provisioning/Management of external datastores/databases (eg. CloudSQL/RDS instances)
|
||||
* Higher level abstractions around Kubernetes primitives (eg. a single Resource to define an etcd cluster, backed by a Service and a ReplicationController)
|
||||
|
||||
## Defining types
|
||||
|
||||
Each instance of your ThirdPartyResource has an attached Spec, which should be defined via a `struct{}` to provide data format validation.
|
||||
In practice, this Spec is arbitrary key-value data that specifies the configuration/behavior of your Resource.
|
||||
|
||||
For example, if you were implementing a ThirdPartyResource for a Database, you might provide a DatabaseSpec like the following:
|
||||
|
||||
``` go
|
||||
type DatabaseSpec struct {
|
||||
Databases []string `json:"databases"`
|
||||
Users []User `json:"users"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
Name string `json:"name"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue