rancher / dashboard

The Rancher UI
https://rancher.com
Apache License 2.0
462 stars 261 forks source link

[ Istio V2 ]: CRD View - Destination Rules #1106

Closed brendarearden closed 2 years ago

brendarearden commented 4 years ago

There is a lot of detail below!

The essence of this issue is to add form support for the Istio DestinationRules resource. There is documentation below, but also see: https://istio.io/latest/docs/reference/config/networking/destination-rule/

This is a good task to learn about the resource based approach we have in the UI.

You'll need to create the detail and edit views for the networking.istio.io.destinationrule resource - there are lots of examples of how this works for other resources. There are also lots of examples of port collections and alike that can be leveraged as needed.

See below for how this looks in the old UI.

Note: You don't need to know much about Istio to build this - essentially the UI needs to allow creation of the k8s resource as per the resource defintion (above in the Istio docs and also below in the text).

Page Title: Add Destination Rule

Section Title: (none / na ) Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Name metadata.name string Default Text: mygateway  
Namespace metadata.namespace string Default Text: myapp
Host spec.host string Default Text: myapp
Section Title: Subsets Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Name spec.subsets[x].name string Default Text: v1  
Labels spec.subsets[x].labels map<string, string> Default Text: key:version, value: v3

Labels should be able to add and remove

Subset Example:

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: bookinfo-ratings
spec:
  host: ratings.prod.svc.cluster.local
  trafficPolicy:
    loadBalancer:
      simple: LEAST_CONN
  subsets:
  - name: testversion
    labels:
      version: v3
  - name: testotherversion
    labels:
      version: v2

Section Title: Traffic Policy Section Description: Will apply policies for a specific destination, across all destination ports.

Subsection of Traffic Policy Section Title: Load Balancer If Standard load balancing algorithms is selected, show the following values Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Algorithm spec.trafficPolicy.loadBalancer.simple string DropDown selection Default Text: ROUND_ROBIN  

Algorithm dropdown values:

ROUND_ROBIN
LEAST_CONN
RANDOM
PASSTHROUGH

If Consistent hash-based load balancing is selected show the following value and do not show the Standard load balancing algorithms values:

Field Name Selection Options
Hash Mode Hash based on specific HTTP header, Hash based on HTTP cookie, Hash based on the source IP address
If Hash based on specific HTTP header selected Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
HTTP Header Name spec.trafficPolicy.loadBalancer.consistentHash.httpHeaderName string Default Text: end-user  
Minimum Ring Size spec.trafficPolicy.loadBalancer.consistentHash. minimumRingSize uint64 Default Text: 1024  
If Hash based on HTTP cookie selected Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Cookie Name spec.trafficPolicy.loadBalancer.consistentHash.httpCookie.name string Default Text: username  
Cookie Path spec.trafficPolicy.loadBalancer.consistentHash.httpCookie.path string Default Text: /  
TTL spec.trafficPolicy.loadBalancer.consistentHash.httpCookie.ttl string Default Text: 0s
Minimum Ring Size spec.trafficPolicy.loadBalancer.consistentHash. minimumRingSize uint64 Default Text: 1024  
If Hash based on the source IP address selected This a field itself, yaml: spec.trafficPolicy.loadBalancer.consistentHash. useSourceIp type: bool, default: false Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Minimum Ring Size spec.trafficPolicy.loadBalancer.consistentHash. minimumRingSize uint64 Default Text: 1024  
Subsection of Traffic Policy Section Title: Connection Pool Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
HTTP1 Max Pending Requests spec.trafficPolicy.connectionPool.http.http1MaxPendingRequests int Default Text: 1024  
HTTP2 Max Requests spec.trafficPolicy.connectionPool.http.http2MaxRequests int Default Text: 1024  
HTTP Max Requests Per Connection spec.trafficPolicy.connectionPool.http.maxRequestsPerConnection string Default Text: 1024
HTTP Max Retries spec.trafficPolicy.connectionPool.http.maxRetries int Default Text: 1024
TCP Connection Timeout spec.trafficPolicy.connectionPool.tcp.duration string Default Text: 30ms
TCP Max Connections spec.trafficPolicy.connectionPool.tcp.maxConnections int Default Text: 1024
Subsection of Traffic Policy Section Title: Outlier Detection Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Base Ejection Time spec.trafficPolicy.outlierDetection.baseEjectionTime int Default Text: 30s  
Consecutive Errors spec.trafficPolicy.outlierDetection.consecutiveErrors int Default Text: 5  
Interval spec.trafficPolicy.outlierDetection.interval string Default Text: 10s
Max Ejection Percent spec.trafficPolicy.outlierDetection.maxEjectionPercent int Default Text: 10
Subsection of Traffic Policy Section Title: TLS Field Name Selection Options
TLS Mode spec.trafficPolicy.tls.mode string (some way to select, maybe drop down) Default Text: None or Select One

TLS Mode selection values:

DISABLE
SIMPLE
MUTUAL
ISTIO_MUTUAL
If SIMPLE selected show additional options Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
CA Certificates spec.trafficPolicy.tls.caCertificates string Default Text: /etc/certs/rootcacerts.pem  
SNI spec.trafficPolicy.tls.sni string Default Text: nginx.example.com  
Subject Alternative Names spec.trafficPolicy.tls.mode string[] Default Text: none created

Subject Alternative Names should have the ability to add and remove many

If MUTUAL selected show additional options Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Client Certificate spec.trafficPolicy.tls.clientCertificate string Default Text: /etc/certs/myclientcert.pem  
Private Key spec.trafficPolicy.tls.privateKey string Default Text: /etc/certs/client_private_key.pem  
CA Certificates spec.trafficPolicy.tls.caCertificates string Default Text: /etc/certs/rootcacerts.pem  
SNI spec.trafficPolicy.tls.sni string Default Text: nginx.example.com  
Subject Alternative Names spec.trafficPolicy.tls.mode string[] Default Text: none created

Subject Alternative Names should have the ability to add and remove many

Section Title: Labels: Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Key metadata.labels string Default Text: key1  
Value metadata.labels string Default Text: value1

Example :

metadata:
  labels:
    <key>:<value>
Section Title: Annotations: Field Name ( Header/Label of the field) YAML (where is the field in the yaml) Input Type (Is it string or number, etc?) Default Value/Example Text (What should the default value (value will be passed through on creation) be or the example text (value is not passed through on creation)? Tooltip Text (Text if it can help explain the field)
Key metadata. annotations string Default Text: key1  
Value metadata. annotations string Default Text: value1

Example :

metadata:
  annotations:
    <key>:<value>

Overall type info can be found here

Example of form from old UI:
Screen Shot 2020-08-26 at 1 03 08 AM Screen Shot 2020-08-26 at 1 03 40 AM Screen Shot 2020-08-26 at 1 03 49 AM

catherineluse commented 2 years ago

@neillsom should this go to To Test?

nwmac commented 2 years ago

We don't plan to add support for this in the near future - we will be looking at the Istio UI support in a future version.