-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dependencyproxy model, crds, listers, informers #279
Changes from all commits
de63090
3df1ca2
643e762
02fd5ef
6f50180
32c1733
fcb4e97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: dependencyproxies.admiral.io | ||
spec: | ||
group: admiral.io | ||
names: | ||
kind: DependencyProxy | ||
listKind: DependencyProxyList | ||
plural: dependencyproxies | ||
shortNames: | ||
- dp | ||
singular: dependencyproxy | ||
scope: Namespaced | ||
versions: | ||
- additionalPrinterColumns: | ||
- jsonPath: .spec.destination.identity | ||
name: Destination | ||
type: string | ||
- jsonPath: .spec.proxy.identity | ||
name: Proxy | ||
type: string | ||
name: v1alpha1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: 'The below example of DependencyProxy ```yaml apiVersion: | ||
admiral.io/v1alpha1 kind: DependencyProxy metadata: name: dependency-proxy-example | ||
namespace: admiral annotations: admiral.io/env: stage spec: destination: | ||
identity: greeting dns_suffix: "xyz" dns_prefix: - "test0" - "test1" | ||
proxy: identity: nginx-gw ``` The above DependencyProxy will generate | ||
the following VirtualService object ```yaml apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService metadata: name: httpbin-vs spec: hosts: - test0.stage.greeting.xyz | ||
- test1.stage.greeting.xyz - stage.greeting.xyz http: - route: - destination: | ||
host: stage.gateway.global port: number: 80 ```' | ||
properties: | ||
destination: | ||
description: Configuration of the destination identity for which the | ||
requests should be proxied. | ||
properties: | ||
dns_prefixes: | ||
description: An ordered list of all DNS prefixes. | ||
items: | ||
type: string | ||
type: array | ||
dns_suffix: | ||
description: The DNS suffix that should be appended while constructing | ||
the endpoint of the destination service. | ||
type: string | ||
identity: | ||
description: Identifier of the destination workload. | ||
type: string | ||
type: object | ||
proxy: | ||
description: Configuration of the proxy's identity through which the | ||
requests to the destination will be proxied through. | ||
properties: | ||
identity: | ||
description: Identifier of the proxy's workload | ||
type: string | ||
type: object | ||
type: object | ||
required: | ||
- metadata | ||
- spec | ||
type: object | ||
served: true | ||
storage: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,72 @@ | ||||
syntax = "proto3"; | ||||
|
||||
package admiral.global.v1alpha; | ||||
|
||||
option go_package = "model"; | ||||
|
||||
// The below example of DependencyProxy | ||||
//```yaml | ||||
// apiVersion: admiral.io/v1alpha1 | ||||
// kind: DependencyProxy | ||||
// metadata: | ||||
// name: dependency-proxy-example | ||||
// namespace: admiral | ||||
// annotations: | ||||
// admiral.io/env: stage | ||||
// spec: | ||||
// destination: | ||||
// identity: greeting | ||||
// dns_suffix: "xyz" | ||||
// dns_prefix: | ||||
// - "test0" | ||||
// - "test1" | ||||
// proxy: | ||||
// identity: nginx-gw | ||||
//``` | ||||
// The above DependencyProxy will generate the following | ||||
// VirtualService object | ||||
//```yaml | ||||
// apiVersion: networking.istio.io/v1alpha3 | ||||
// kind: VirtualService | ||||
// metadata: | ||||
// name: httpbin-vs | ||||
// spec: | ||||
// hosts: | ||||
// - test0.stage.greeting.xyz | ||||
// - test1.stage.greeting.xyz | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am thinking if these should be test0.greeting.xyz and test1.greeting.xyz because if some one has e2e1 and e2e2, the endpoints will look like e2e1.e2e.greeting.xyz and e2e2.e2e.greeting.xyz. Also this will make the migration later (from gateway to mesh seamless when that happens) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hey @aattuluri , I'm sorry this example I think is a little confusing. So we'll be generating the regular endpoint without the prefix as well as shown here
This should make the migration seamless. Please correct me if I'm wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. |
||||
// - stage.greeting.xyz | ||||
// http: | ||||
// - route: | ||||
// - destination: | ||||
// host: stage.gateway.global | ||||
// port: | ||||
// number: 80 | ||||
//``` | ||||
// | ||||
message DependencyProxy { | ||||
// Configuration of the destination identity for which the | ||||
// requests should be proxied. | ||||
Destination destination = 1; | ||||
|
||||
// Configuration of the proxy's identity through which the requests | ||||
// to the destination will be proxied through. | ||||
Proxy proxy = 2; | ||||
|
||||
} | ||||
|
||||
message Destination { | ||||
// Identifier of the destination workload. | ||||
string identity = 1; | ||||
|
||||
// An ordered list of all DNS prefixes. | ||||
repeated string dns_prefixes = 2; | ||||
|
||||
// The DNS suffix that should be appended while | ||||
// constructing the endpoint of the destination service. | ||||
string dns_suffix = 3; | ||||
} | ||||
|
||||
message Proxy { | ||||
// Identifier of the proxy's workload | ||||
string identity = 1; | ||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a shortName for the CRD, something like
dp
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will do that