October 2019 unified Azure SDK preview

Welcome back to another release of the unified Azure Data client libraries. For the most part, the API surface areas of the SDKs have been stabilized based on your feedback. Thank you to everyone who has been submitting issues on GitHub and keep the feedback coming.

Please grab the October preview libraries and try them out—throw demanding performance scenarios at them, integrate them with other services, try to debug an issue, or generally build your scenario and let us know what you find.

Our goal is to release these libraries before the end of the year but we are driven by quality and feedback and your participation is key.

Getting started

As we did for the last three releases, we have created four pages that unify all the key information you need to get started and give feedback. You can find them here:

.NET
Java
JavaScript and TypeScript
Python

For those of you who want to dive deep into the content, the release notes linked above and the changelogs they point to give more details on what has changed. Here we are calling out a few high-level items.

APIs locking down

The surface area for Azure Key Vault and Storage Libraries are nearly API-complete based on the feedback you’ve given us so far. Thanks again to everyone who has sent feedback, and if anyone has been waiting to try things out and give feedback, now is the time.

Batch API support in Storage

You can now use batching APIs with the SDKs for Storage to handle manipulating large numbers of items in parallel. In Java and .NET you will find a new batching library package in the release notes while in JavaScript and Python the feature is in the core library.

Unified credentials

The Azure SDKs that depend on Azure Identity make getting credentials for services much easier.

Each library supports the concept of a DefaultAzureCredential and depending on where your code runs, it will select the right credential for logging in. For example, if you’re writing code and have signed into Visual Studio or performed an az login from the CLI, the client libraries can automatically pick up the sign-in token from those tools. When you move the code to a service environment, it will attempt to use a managed identity if one is available. See the language specific READMEs for Azure Identity for more.

Working with us and giving feedback

So far, the community has filed hundreds of issues against these new SDKs with feedback ranging from documentation issues to API surface area change requests to pointing out failure cases. Please keep that coming. We work in the open on GitHub and you can submit issues here:

API design Guidelines
.NET
Java
JavaScript and TypeScript
Python

In addition, we're excited to say we'll be attending Microsoft Ignite 2019, so please come and talk to us in person. Finally, please tweet at us at @AzureSdk.

Get started with Azure for free.

Quelle: Azure

How Standard Industries uses Google Cloud to power homes of the future

Today, about 5 million U.S. homes are re-roofed each year, but only a fraction of those homeowners opt for solar panels. I’ve spoken in the past about how Google Cloud technologies are helping businesses bring solar energy to more customers. Another great organization that aims to close this gap by making solar installation easy for homeowners is Standard Industries. Founded in 1886, Standard Industries is a global holding company focused on building materials. With more than 15,000 employees, operations in over 80 countries, and 180+ manufacturing plants worldwide, Standard’s businesses—including BMI, GAF, GAF Energy, Schiedel, SGI, and Siplast—range from the world’s largest roofing and waterproofing company to aggregates, insulation and industry changing solar solutions, as well as real estate and investment platforms. Given the variety and complexity of these operations, Standard Industries saw an opportunity to streamline operations by moving to the cloud.Replicating its infrastructure to Google Cloud, Standard Industries is able to aggregate manufacturing, supply chain, and sales information into one central place—and make the data available directly within the tools employees already use daily, such as Google Sheets. With Google Cloud AI solutions like Cloud AutoML, Standard Industries is also aiming to become more predictive, building machine learning models to forecast customer demand, shipping needs, and commodity pricing. By automating analytics, data scientists are freed up to focus on advanced machine learning and artificial intelligence work, and engineers spend more time doing their core jobs—writing code—instead of manually managing data. To help protect information across its six operating companies and two related investment businesses, Standard Industries also relies on Google Cloud’s security and identity and access management solutions. By replacing homegrown tools with Google Cloud’s security products, Standard Industries now centrally manages user accounts and policies with ease. “Google Cloud makes it easy to do good things, which matches our approach to renewable energy,” said Rich Robinson, CTO at Standard Industries. “The best time to get started with solar is when you’re already installing a new roof. As the world’s largest roofing company, we believe we’re in a unique position to eliminate barriers to solar adoption with our ‘roof as a service’ model. We want to make renewable energy effortless for homeowners, just as Google Cloud is simplifying technology for us.”Standard Industries has already achieved efficiencies by choosing Google Cloud as its cloud platform of choice. In addition to making more decisions backed by data, employees in some functions have seen productivity gains of up to 25%, reclaiming valuable time as a result of unifying its global workforce with Google Cloud productivity and collaboration tools. But this is just the beginning: The company has started using predictive analytics for more precise manufacturing forecasting and to personalize experiences for its customer base of contractors and homeowners.Google Cloud’s continued work with Standard Industries reflects our shared vision to build a more sustainable future. We’re honored that Standard Industries has chosen us as their technology partner as they advance their goal to generate solar energy from every roof.
Quelle: Google Cloud Platform

Leave no database behind with Cloud SQL for SQL Server

At Google Cloud, we develop our database services to meet the needs of enterprise teams wherever they are in their cloud journey. We’re excited today to announce the beta launch of Cloud SQL for SQL Server and make it available to all of our customers. This addition to our database lineup means you can migrate your enterprise SQL Server workloads to Google Cloud easily, then manage instances there. Earlier this year, we announced the addition of Microsoft SQL Server to the Cloud SQL portfolio of available database engines. At Next, we showed how easily an existing Windows environment could be migrated to Google Cloud, then integrated alongside our many other managed services. Cloud SQL for SQL Server is a key component when onboarding your existing applications and infrastructure to get the benefits of a fully managed and compatible database that will reduce your operational costs and overhead.  Highlights of Cloud SQL for SQL ServerCloud SQL for SQL Server brings some key benefits that can help you run workloads easily. Compatibility: Cloud SQL for SQL Server offers multiple editions of the current version of SQL Server and works with popular clients such as SQL Server Management Studio.Flexible backups: Schedule automatic daily backups or run them on-demand.Scalability: Enable the automatic storage increase configuration and Cloud SQL will add storage capacity whenever you approach your limit. Easily scale up your customized machines’ memory and processor cores as necessary.Built-in high availability: Cloud SQL for SQL Server has built-in high availability enabled for all editions that synchronously replicates data to each zone’s regional persistent disk.As part of the Cloud SQL platform, Cloud SQL for SQL Server will launch in all currently available regions and will integrate with our existing Cloud SQL functionality, such as connectivity via the Cloud SQL Proxy.   Here’s a look at creating a new instance.Early adopters of Cloud SQL for SQL Server have been using the service for the last few months, and we’ve heard that they see the potential value for onboarding more workloads.”Cloud SQL for SQL Server was very easy and fast to get up and going.” says Andrew P. Toi, database engineer lead at advertising management software company WideOrbit Inc. “With built-in high availability that can be used across editions, I can reduce the cost and overhead of managing databases dramatically, especially for smaller workloads” And desktop virtualization infrastructure company Itopia had this to say. “Cloud SQL Server dramatically reduces the complexity and cost involved in deploying cloud desktop infrastructure for our customers,” says Ubaldo Don, CTO of Itopia. “It turns a bulky pillar of infrastructure into a one-click service, reducing IT service management overhead.” More features coming soonWe’re continuing to improve Cloud SQL for SQL Server during beta and beyond to meet all of your cloud database needs. Watch for the following:Active Directory integrationRead replicasExpanded machine typesOnline migration toolsSee what Google Cloud can do for youSign up for a $300 credit to try Cloud SQL and the rest of GCP. You can start with inexpensive micro instances for testing and development. When you’re ready, you can easily scale them up to serve performance-intensive applications. As a bonus, everyone gets 100%sustained use discount during beta, regardless of usage. Enjoy your exploration of Google Cloud and Cloud SQL for SQL Server.
Quelle: Google Cloud Platform

OpenShift 4.2: Declarative Dynamic UI for your Operator

When building a Kubernetes-native application, CustomResourceDefinitions (CRD) are the primary way to extend the Kubernetes API with custom resources. This post will cover generating a creation form for your custom resource based on an OpenAPI-based schema. Afterward, we are going to talk about the value you can get through Operator Descriptors to fulfill more complex interactions and improve the overall usability of your application.
Generate creation form based on OpenAPI schema
Many of our partners (ISVs) have certain requirements when building a UI form to guide users creating an instance of their application or custom resource managed by their Operators. Starting from Kubernetes 1.8, CustomResourcesDefinition (CRD) gained the ability to define an optional OpenAPI v3 based validation schema. In Kubernetes 1.15 and beyond, any new feature for CRDs will be required to have a structural schema. This is important not only for data consistency and security, but it also enables the potential to design and build a richer UI to improve the user experience when creating or mutating custom resources.
 
For example, here is a CRD manifest from one of our partners:

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  creationTimestamp: null
  name: couchbaseclusters.couchbase.com
spec:
  …
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            …
            cluster:
              properties:
                …
                autoFailoverServerGroup:
                  type: boolean
                autoFailoverTimeout:
                  maximum: 3600
                  minimum: 5
                  type: integer
                …
              required:          
              …
             – autoFailoverTimeout
              …

 
With the validation info, we can start associating these fields with corresponding UI input fields. Since the autoFailoverServerGroup field is expecting a boolean data type, we can either assign this field with a checkbox, a radio button or a toggle switch. As for autoFailoverTimeout field, we can simply limit the input type as an integer between 5 to 3600. We can also denote that autoFailoverTimeout is a required field, while autoFailoverServerGroup is optional. So far, everything looks good. However, things start to get complicated for other data types or complex nested fields.
 
From our partners who build Operators, one common use case we see is that the custom resource needs a Secret object as a prerequisite for creating an instance. In the CRD manifest, this would be specified similar to the code snippet below:

  …
  properties:
    credentials:
      type: string
      …

 
As we can see, the only viable validation from OpenAPISchema checks only the data type as “string” and is fairly limited in terms of usability. Wouldn’t it be great if the UI could provide a searchable dropdown list of all the existing Secrets in your cluster? It could not only speed up the filling process but also reduce possible human errors in comparison with manually entry. This is where Operator Lifecycle Manager (OLM) descriptors come in.
Operator Descriptors enhancements
Prerequisites
 

Install Operator Lifecycle Manager

 
The Operator Lifecycle Manager (OLM) can be installed with one command on any Kubernetes cluster and interact with the OKD console. If you’re using Red Hat OpenShift 4, the OLM is pre-installed to manage and update the Operators on your cluster.
 
 

Generate an Operator manifest, ClusterServiceVersion

 
Generate the ClusterServiceVersion (CSV) that represents the CRDs your Operator manages, the permissions it requires to function, and other installation information with the OLM. See Generating a ClusterServiceVersion (CSV) for more information on generating with Operator SDK, or manually defining a manifest file. You’ll only have to do this once, then carry these changes forward for successive releases of the Operator.
specDescriptors
OLM introduces the notion of “descriptors” of both spec and status fields in Kubernetes API responses. Descriptors are intended to indicate various properties of a field in order to make decisions about their content. The schema for a descriptor is the same, regardless of type:

type Descriptor = {
  path: string; // Dot-delimited path of the field on the object
  displayName: string;
  description: string;

  /* Used to determine which “capabilities” this descriptor has, and which 
     React component to use */
  ‘x-descriptors’: SpecCapability[] | StatusCapability[];
  value?: any; // Optional value 
}

 
The x-descriptors field can be thought of as “capabilities” (and is referenced in the code using this term). Capabilities are defined in types.ts provide a mapping between descriptors and different UI components (implemented as React components) using URN format.
 

k8sResourcePrefix descriptor 

 
Recall the use case previously mentioned for specifying a Kubernetes resource in the CRD manifest. The “k8sResourcePrefix” is the OLM descriptor for this goal. 

k8sResourcePrefix = ‘urn:alm:descriptor:io.kubernetes:’,

 
Let’s take CouchbaseCluster as an example to see how this descriptor can be adopted in the Couchbase Operator’s CSV file. First, inside the CRD manifest (couchbasecluster.crd.yaml):

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  creationTimestamp: null
  name: couchbaseclusters.couchbase.com
spec:
  …
  names:
    kind: CouchbaseCluster
  …
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            …
            authSecret:
             minLength: 1
             type: string
            …
            tls:
             properties:
               static:
                 properties:
                   member:
                     properties:
                       serverSecret:
                       type: string
                     type: object
                  operatorSecret:
                     type: string
                type: object
              type: object
          required:          
          …
          – authSecret
          …

 
The validation block specifies a Secret object (authSecret) that stores the admin credential is required for creating a CouchbaseCluster custom resource. And for TLS (tls), it requires additional two Secret objects, one as Server Secret (tls.static.member.serverSecret), and the other as the Operator Secret (tls.static.operatorSecret).
 
To utilize the OLM Descriptors, inside Couchbase Operator’s CSV file, we first specify the k8sResourcePrefix descriptor as a “Secret” object (urn:alm:descriptor:io.kubernetes:Secret) and then point it to the fields on the CouchbaseCluster CRD object in the “path” field.

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: couchbase-operator.v1.1.0
  …
spec:
  customresourcedefinitions:
    owned:
    – description: Manages Couchbase clusters
      displayName: Couchbase Cluster
      kind: CouchbaseCluster
      name: couchbaseclusters.couchbase.com
      …
      specDescriptors:
      – description: The name of the secret object that stores the admin
          credentials.
        displayName: Auth Secret
        path: authSecret
        x-descriptors:
        – urn:alm:descriptor:io.kubernetes:Secret
        …
      – description: The name of the secret object that stores the server’s
          TLS certificate.
        displayName: Server TLS Secret
        path: tls.static.member.serverSecret
        x-descriptors:
        – urn:alm:descriptor:io.kubernetes:Secret
        …
      – description: The name of the secret object that stores the
          Operator’s TLS certificate.
        displayName: Operator TLS Secret
        path: tls.static.operatorSecret
        x-descriptors:
        – urn:alm:descriptor:io.kubernetes:Secret

 
Let’s take a closer look. In the CSV file:

Under the spec.customresourcedefinitions.owned section (i.e. the CRD is that owned by this Operator, which can be multiple CRDs), specify the metadata of your custom resource. 
Since this is for “creating or mutating” the custom resource, assign the k8sResourcePrefix descriptor under “specDescriptors” section as input. 
description and displayName fields are pretty straightforward being the information that can be displayed on the UI as help text and field title. 
path – is used for pointing the field on the object in the dot-delimited path as to where it is inside the CRD (i.e. couchbasecluster.crd.yaml). 
x-descriptors – Assign this field with the `k8sResourcePrefix` descriptor and specify the resource type as “Secret” in “urn:alm:descriptor:io.kubernetes:Secret”.

Now, let’s take a look in OpenShift console. We will have to install the Couchbase Operator from “OperatorHub” first so the Operator is ready to be used on the cluster.
We can create CouchbaseCluster instance via the “Installed Operator” view:

Next, switch to the form view and see that “searchable dropdown component” shows up on the UI. This component allows us to look for existing Secrets on the cluster and is pointed to the corresponding fields on the CouchbaseCluster object. It’s that simple.

resourceRequirements descriptor 

Specifying how much CPU and memory (RAM) each container needs for a pod is another worth mentioned use case. Again, in the couchbasecluster.crd.yaml manifest, we can see fields for specifying the resource limits and requests for a running pod in bold:

…
spec:
  …  names:
    kind: CouchbaseCluster
  …
  validation:
    openAPIV3Schema:
      properties:
        spec:
          properties:
            …
            servers:
             items:
               properties:
                 name:
                   minLength: 1
                   pattern: ^[-_a-zA-Z0-9]+$
                   type: string
                 pod:
                   properties:
                     …
                     resources:
                       properties:
                         limits:
                               properties:
                                 cpu:
                                   type: string
                                 memory:
                                   type: string
                                 storage:
                                   type: string
                               type: object
                         requests:
                               properties:
                                 cpu:
                                   type: string
                                 memory:
                                   type: string
                                 storage:
                                   type: string
                           type: object
                    …

 
As we can see, these fields are nested and could be tricky to convert and organize them to the form fields. Alternatively, we can take advantage of the resourceRequirements descriptor by including it in Couchbase Operator’s CSV file and pointing to the resources field of the CouchbaseCluster object.

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: couchbase-operator.v1.1.0
  …
spec:
  customresourcedefinitions:
    owned:
    – description: Manages Couchbase clusters
      displayName: Couchbase Cluster
      kind: CouchbaseCluster
      name: couchbaseclusters.couchbase.com
      …
      specDescriptors:
        …
      – description: Limits describes the minimum/maximum amount of compute
          Resources required/allowed.
        displayName: Resource Requirements
        path: servers[0].pod.resources
        x-descriptors:
        – urn:alm:descriptor:com.tectonic.ui:resourceRequirements
        …

 
The Resource Requirement react component will then show up on the UIs for creating or mutating your custom resource in OpenShift console. For example, in Create Couchbase Cluster view, UI shows both Limits and Requests fields:

On the other hand, in the CouchbaseCluster Details view, you can access the widget to configure the Resource Limits and Requests as shown as the screenshots below, respectively:

nodeAffinity, podAffinity, and podAntiAffinity descriptors

For assigning your running pods to nodes, it can be achieved by the affinity feature, which consists of two types of affinity, Node Affinity and Pod Affinity/Pod Anti-affinity. In the CRD manifest, these affinity related fields could be very nested and fairly complicated (see the nodeAffinity, podAffinity, and podAntiAffinity fields in alertmanager.crd.yaml).
 
Similarly, we can leverage nodeAffinity, podAffinity, and podAntiAffinity descriptors and point them to the affinity field of the Alertmanager object.

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: prometheusoperator.0.27.0
  …
spec:
  …
  displayName: Prometheus Operator
  …
  customresourcedefinitions:
    owned:
    …
    – name: alertmanagers.monitoring.coreos.com
      version: v1
      kind: Alertmanager
      displayName: Alertmanager
      description: Configures an Alertmanager for the namespace
      …
      specDescriptors:
        …
        – description: Node affinity is a group of node affinity scheduling                    
          displayName: Node Affinity
          path: affinity.nodeAffinity
          x-descriptors:
          – urn:alm:descriptor:com.tectonic.ui:nodeAffinity
   – description: Pod affinity is a group of inter pod affinity scheduling rules
          displayName: Pod Affinity
          path: affinity.podAffinity
          x-descriptors:
          – urn:alm:descriptor:com.tectonic.ui:podAffinity
   – description: Pod anti affinity is a group of inter pod anti affinity scheduling rules
          displayName: Pod Anti-affinity
          path: affinity.podAntiAffinity
          x-descriptors:
          – urn:alm:descriptor:com.tectonic.ui:podAntiAffinity
        …

 
Later when we go ahead and create an  Alertmanager instance in console, we will see those UI widgets with clear visual grouping along with input instruction for guiding how we can specify affinity using key/value pair with the logical operator. The “operator” field is a dropdown that provides viable options and the “value” field is enabled/disabled dynamically based on the operator being specified. And for “preferred” related rules, the weighting will be required. 

Through talking with customers, we’ve learned the majority of our users treat the UI as the medium to learn and explore the technical or API details. The Affinity descriptor is one good example of the desired UX we strive to provide.

statusDescriptors

So far we have covered the OLM descriptors for the spec fields in Kubernetes API responses. In addition, OLM also provides a set of statusDescriptors for referencing fields in the status block of a custom resource. Some of them come with an associated react component too for richer interactions to the API. One example is podStatuses descriptor. 

podStatuses descriptor 

podStatuses statusDescriptor is usually being paired with podCount specDescriptor. User can specify the desired size of the custom resource being deployed with podCount specDescriptor. podStatuses statusDescriptor provides a dynamic graphical widget for better representing the latest member status of the custom resource being created or mutated.

Following the same pattern, in the code snippet below, we can see how etcd Operator applies podCount and podStatuses descriptors in the CSV file for users to create, mutating, and displaying etcdCluster custom resource in the console.

apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: etcdoperator.v0.9.4
  …
spec:
  …
  displayName: etcd
  …
  customresourcedefinitions:
    owned:
    …
    – name: etcdclusters.etcd.database.coreos.com
      version: v1beta2
      kind: EtcdCluster
      displayName: etcd Cluster
      description: Represents a cluster of etcd nodes.
      …
      specDescriptors:
        – description: The desired number of member Pods for the etcd cluster.
          displayName: Size
          path: size
          x-descriptors:
          – ‘urn:alm:descriptor:com.tectonic.ui:podCount’
        …
      statusDescriptors:
        – description: The status of each of the member Pods for the etcd cluster.
          displayName: Member Status
          path: members
          x-descriptors:
          – ‘urn:alm:descriptor:com.tectonic.ui:podStatuses’
        …

What’s next?
We hope the content and examples covered in this post will trigger community-wide discussions on how to improve the overall UX of Operator-managed application for the end-users. If you would like to learn more about OLM Descriptors, check out the github page where you can see the full list of specDescriptors and statusDescriptors that are currently available. Share your experience or feedback to Operator Lifecycle Manager (OLM) with github issues. If you want to explore more and contribute to Operator Descriptors, check out the contributing guide.
 
The post OpenShift 4.2: Declarative Dynamic UI for your Operator appeared first on Red Hat OpenShift Blog.
Quelle: OpenShift