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)
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)
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)
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)
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)
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)
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)
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
Labels
should be able to add and removeSubset Example:
Section Title: Traffic Policy Section Description: Will apply policies for a specific destination, across all destination ports.
Standard load balancing algorithms
is selected, show the following values Field Name ( Header/Label of the field)Algorithm
dropdown values:If
Consistent hash-based load balancing
is selected show the following value and do not show theStandard load balancing algorithms
values:Hash based on specific HTTP header
selected Field Name ( Header/Label of the field)Hash based on HTTP cookie
selected Field Name ( Header/Label of the field)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)TLS Mode
selection values:SIMPLE
selected show additional options Field Name ( Header/Label of the field)Subject Alternative Names
should have the ability to add and remove manyMUTUAL
selected show additional options Field Name ( Header/Label of the field)Subject Alternative Names
should have the ability to add and remove manyExample :
Example :
Overall type info can be found here
Example of form from old UI: