Skip to content

Commit 2fce407

Browse files
committed
Revise api
Signed-off-by: Tamal Saha <[email protected]>
1 parent 5a6e69e commit 2fce407

29 files changed

+10253
-6
lines changed

apis/apps/v1/placementpolicy_types.go

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package v1
1919
import (
2020
v1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
kmapi "kmodules.xyz/client-go/api/v1"
2223
)
2324

2425
const (
@@ -86,10 +87,57 @@ type ClusterSpreadConstraint struct {
8687
}
8788

8889
type DistributionRule struct {
89-
ClusterName string `json:"clusterName"`
90-
ReplicaIndices []int32 `json:"replicaIndices"`
91-
StorageClassName string `json:"storageClassName,omitempty"`
92-
PrometheusSecretName string `json:"prometheusSecretName,omitempty"`
90+
ClusterName string `json:"clusterName"`
91+
ReplicaIndices []int32 `json:"replicaIndices"`
92+
StorageClassName string `json:"storageClassName,omitempty"`
93+
Monitoring *Monitoring `json:"monitoring,omitempty"`
94+
}
95+
96+
type Monitoring struct {
97+
Prometheus *PrometheusSpec `json:"prometheus,omitempty"`
98+
}
99+
100+
type PrometheusSpec struct {
101+
AppBindingRef *kmapi.ObjectReference `json:"appBindingRef,omitempty"`
102+
*ConnectionSpec `json:",inline,omitempty"`
103+
}
104+
105+
// ConnectionSpec is the spec for app
106+
type ConnectionSpec struct {
107+
// ClientConfig defines how to communicate with the app.
108+
// Required
109+
ClientConfig `json:",inline"`
110+
111+
// Secret is the name of the secret to create in the AppBinding's
112+
// namespace that will hold the credentials associated with the AppBinding.
113+
AuthSecret *kmapi.ObjectReference `json:"authSecret,omitempty"`
114+
115+
// TLSSecret is the name of the secret that will hold
116+
// the client certificate and private key associated with the AppBinding.
117+
TLSSecret *kmapi.ObjectReference `json:"tlsSecret,omitempty"`
118+
}
119+
120+
// ClientConfig contains the information to make a connection with an app
121+
type ClientConfig struct {
122+
// `url` gives the location of the app, in standard URL form
123+
// (`[scheme://]host:port/path`). Exactly one of `url` or `service`
124+
// must be specified.
125+
// +optional
126+
URL string `json:"url"`
127+
128+
// InsecureSkipTLSVerify disables TLS certificate verification when communicating with this app.
129+
// This is strongly discouraged. You should use the CABundle instead.
130+
InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
131+
132+
// CABundle is a PEM encoded CA bundle which will be used to validate the serving certificate of this app.
133+
// +optional
134+
CABundle []byte `json:"caBundle,omitempty"`
135+
136+
// ServerName is used to verify the hostname on the returned
137+
// certificates unless InsecureSkipVerify is given. It is also included
138+
// in the client's handshake to support virtual hosting unless it is
139+
// an IP address.
140+
ServerName string `json:"serverName,omitempty"`
93141
}
94142

95143
type KubeSliceConfig struct {

apis/apps/v1/zz_generated.deepcopy.go

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crds/apps.k8s.appscode.com_placementpolicies.yaml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,89 @@ spec:
9696
properties:
9797
clusterName:
9898
type: string
99-
prometheusSecretName:
100-
type: string
99+
monitoring:
100+
properties:
101+
prometheus:
102+
properties:
103+
appBindingRef:
104+
description: ObjectReference contains enough information
105+
to let you inspect or modify the referred object.
106+
properties:
107+
name:
108+
description: |-
109+
Name of the referent.
110+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
111+
type: string
112+
namespace:
113+
description: |-
114+
Namespace of the referent.
115+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
116+
type: string
117+
required:
118+
- name
119+
type: object
120+
authSecret:
121+
description: |-
122+
Secret is the name of the secret to create in the AppBinding's
123+
namespace that will hold the credentials associated with the AppBinding.
124+
properties:
125+
name:
126+
description: |-
127+
Name of the referent.
128+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
129+
type: string
130+
namespace:
131+
description: |-
132+
Namespace of the referent.
133+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
134+
type: string
135+
required:
136+
- name
137+
type: object
138+
caBundle:
139+
description: CABundle is a PEM encoded CA bundle
140+
which will be used to validate the serving certificate
141+
of this app.
142+
format: byte
143+
type: string
144+
insecureSkipTLSVerify:
145+
description: |-
146+
InsecureSkipTLSVerify disables TLS certificate verification when communicating with this app.
147+
This is strongly discouraged. You should use the CABundle instead.
148+
type: boolean
149+
serverName:
150+
description: |-
151+
ServerName is used to verify the hostname on the returned
152+
certificates unless InsecureSkipVerify is given. It is also included
153+
in the client's handshake to support virtual hosting unless it is
154+
an IP address.
155+
type: string
156+
tlsSecret:
157+
description: |-
158+
TLSSecret is the name of the secret that will hold
159+
the client certificate and private key associated with the AppBinding.
160+
properties:
161+
name:
162+
description: |-
163+
Name of the referent.
164+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
165+
type: string
166+
namespace:
167+
description: |-
168+
Namespace of the referent.
169+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
170+
type: string
171+
required:
172+
- name
173+
type: object
174+
url:
175+
description: |-
176+
`url` gives the location of the app, in standard URL form
177+
(`[scheme://]host:port/path`). Exactly one of `url` or `service`
178+
must be specified.
179+
type: string
180+
type: object
181+
type: object
101182
replicaIndices:
102183
items:
103184
format: int32

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,7 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
33753375
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
33763376
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
33773377
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
3378+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
33783379
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
33793380
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
33803381
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

vendor/github.com/imdario/mergo/.gitignore

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/imdario/mergo/.travis.yml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)