Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Auto-generated Creation Form for Operator Managed Services

Auto-generated Creation Form for Operator Managed Services

Auto-generated Creation Form for Operator Managed Services

Red Hat Livestreaming

November 12, 2020
Tweet

More Decks by Red Hat Livestreaming

Other Decks in Technology

Transcript

  1. Auto-generated Creation Form
    for Operator Managed Services
    1
    Tony Wu
    OpenShift Product Management
    [email protected]

    View Slide

  2. In addition to enhanced YAML UX, a new
    and richer GUI UX to help reduce friction
    when deploying operator backed services with:
    1. basic data validation
    2. field description as help text
    3. highlights required fields
    4. user-friendly display name
    5. customizable help text
    6. custom UI widgets to assist inputs
    7. tailored form field ordering
    8. mark advanced fields
    9. exclude non-user facing fields
    10. markdown support for richer info
    Console Provides Richer GUI UX: for Operator-backed services
    Auto-generated Creation Form for Operator Managed Services

    View Slide

  3. In addition to enhanced YAML UX, a new
    and richer GUI UX to help reduce friction
    when deploying operator backed services with:
    1. basic data type validation
    2. field description as help text
    3. highlights required fields
    4. user-friendly display name
    5. customizable help text
    6. custom UI widgets to assist input
    7. tailored form field ordering
    8. mark advanced fields
    9. exclude non-user facing fields
    10. markdown support for richer info
    UI Building Blocks + Automated Process: Creation Form for Operator Managed Services
    Auto-generated Creation Form for Operator Managed Services
    CRD
    structural schema
    CSV
    OLM descriptors
    CSV
    markdown
    See more in later slides

    View Slide

  4. 1. OpenShift console automates the creation form
    generation for Operator managed services:
    ○ Auto-generates a basic "Creation Form" using
    Operand's structural schema in CRD’s YAML file.
    ○ Schema properties are mapped to appropriate UI
    components based on their types:
    i. type: string
    ii. type: string, with enum
    iii. type: integer
    iv. type: boolean
    v. type: object New in 4.5
    vi. type: array, with items New in 4.5
    ○ Check out Operator SDK for how to provide a “structural
    schema” for your CRD with API markers.
    2. Operator authors can further enhance the UI with OLM
    add-on to set them apart from the crowd:
    ○ The console overwrites the basic form fields with enhanced
    widgets associated to the added OLM descriptors in
    Operator’s CSV YAML file.
    i. Check out the reference guide for details and examples of
    how to use OLM descriptors.
    ○ Highlighted changes in 4.6 (see examples in the links):
    i. New: “hidden” - Exclude “non user facing” properties.
    ii. Improved: “advanced” - Advanced section “within schema
    object properties/group”.
    iii. Deprecated: “fieldGroup” and “arrayFieldGroup”
    → Now auto-generated per schema
    ○ Check out Operator SDK for how to generate OLM
    Descriptors using API markers when working on the CRD.
    4
    Auto-generated Creation Form for Operator Managed Services
    Declarative UI with OpenShift Console
    CRD
    structural schema
    CSV
    OLM descriptors

    View Slide

  5. Enhanced “Create Operand Form”: for Operator-backed services
    Now default to the “Form View”, but you
    can always switch back to the YAML editor
    like a Pro.
    ● Reduces friction when deploying operator
    backed services.
    ● All data is stored when switching between
    the “Form” and “YAML” view.
    Auto-generated form now supports
    “nested schema properties”.
    ● CRD's nested “type: object/array”
    schema properties are mapped to
    appropriate form field UI components.
    ● Exclude “non user facing” schema
    properties from the auto generated form
    with a new “hidden” OLM descriptor.
    Auto-generated Creation Form for Operator Managed Services

    View Slide

  6. 6
    Enhanced “Create Operand Form”
    = CRD schema + OLM Descriptors
    ● StorageCluster storageclusters.core.libopenstorage.org
    by Portworx
    Auto-generated Creation Form for Operator Managed Services

    View Slide

  7. 7
    In CustomResourceDefinition manifest
    OCP Console maps spec properties
    under schema stanza to form fields:
    ■ type: string
    ■ type: integer
    ■ type: boolean
    ■ type: string, with enum
    ■ type: object New in 4.5
    ■ type: array, with items New in 4.5
    ■ renders property description as
    help text for each field New in
    4.6

    View Slide

  8. OCP Console maps spec properties
    under schema stanza to form fields:
    ■ type: string
    ■ type: integer
    ■ type: boolean
    ■ type: string, with enum
    ■ type: object New in 4.5
    ■ type: array, with items New in 4.5
    ■ renders property description as
    help text for each field New in
    4.6
    Auto-generated Form - based on CRD schema (no OLM Descriptors involved)

    View Slide

  9. ● Complex fields need more than
    OpenAPI validation info:
    ○ Needs a k8s object (e.g.
    Secret for pulling image) as a
    prerequisite.
    ○ Deeply nested fields, such as
    ResourceRequirements,
    UpdateStrategy,
    nodeAffinity, etc.
    ○ Exclude “non user facing”
    properties from the auto
    generated form with “hidden”
    x-descriptor.
    Customized Creation Form with OLM Descriptors - Richer UI Widgets

    View Slide

  10. Customized Creation Form with OLM Descriptors - Ordering of Form Fields
    ● The ordering of form fields
    depends on whether a field:
    1. has a specDescriptor (sorted
    based on specDescriptors
    array order),
    2. is "required" (a ‘required:’
    property in the schema),
    3. "optional",
    4. or "advanced" (assigned with
    an advanced x-descriptor).
    ● In general, “fields with
    specDescriptors” will be sorted
    higher than those without, and
    “required fields” will be sorted
    higher than optional fields.
    ○ See full set of sorting rules.

    View Slide

  11. ● OCP Console now provides
    markdown support for owned
    CRD’s description
    ○ In Operator CSV file’s
    spec.customresourcedefi
    nitions.owned[].descrip
    tion field. See in Portworx’s
    CSV file.
    ○ Provides instructions,
    prerequisites, or tutorials with
    external links to guide users
    how to create and manage an
    Operand instance.
    ○ CRD markdown will be shown
    in both “Admin” and “Dev”
    perspective in OCP Console.
    Customized Creation Form - CRD description markdown in CSV

    View Slide

  12. ● Auto-generated Creation Form for Operator managed services
    ● Customized Creation Form with specDescriptors
    ○ x-descriptors reference
    ● OperatorFramework.io
    ○ Operator SDK
    ■ Provide a “structural schema” for your CRD with API markers.
    ■ Generate OLM Descriptors using API markers when working on the CRD.
    ○ Operator Lifecycle Manager
    12
    Auto-generated Creation Form for Operator Managed Services
    Useful Links

    View Slide

  13. linkedin.com/company/red-hat
    youtube.com/user/RedHatVideos
    facebook.com/redhatinc
    twitter.com/RedHat
    13
    Red Hat is the world’s leading provider of
    enterprise open source software solutions.
    Award-winning support, training, and consulting
    services make
    Red Hat a trusted adviser to the Fortune 500.
    Thank you

    View Slide