Code Monkey home page Code Monkey logo

azure-service-operator's Introduction

Azure Service Operator (for Kubernetes)

Go Report Card Build Status

What is it?

Azure Service Operator (ASO) helps you provision Azure resources and connect your applications to them from within Kubernetes.

If you want to use Azure resources but would prefer to manage those resources using Kubernetes tooling and primitives (for example kubectl apply), then Azure Service Operator might be for you.

Overview

The Azure Service Operator consists of:

  • The Custom Resource Definitions (CRDs) for each of the Azure services a Kubernetes user can provision.
  • The Kubernetes controller that manages the Azure resources represented by the user specified Custom Resources. The controller attempts to synchronize the desired state in the user specified Custom Resource with the actual state of that resource in Azure, creating it if it doesn't exist, updating it if it has been changed, or deleting it.

Versions of Azure Service Operator

There are two major versions of Azure Service Operator: v1 and v2. Consult the below table and descriptions to learn more about which you should use.

Note: ASO v1 and v2 are two totally independent operators. Each has its own unique set of CRDs and controllers. They can be deployed side by side in the same cluster.

ASO Version Lifecycle stage Development status Installation options
v2 Stable Under active development. Helm chart, GitHub release 2.x. See installation for example.
v1 Beta Bug and security fixes primarily. Helm chart, OperatorHub or GitHub release 1.x

ASO v2

Azure Service Operator v2 was built based on the lessons learned from ASO v1, with the following improvements:

  • Supports code-generated CRDs based on Azure OpenAPI specifications. This enables us to quickly add new resources as they are requested.
  • More powerful Status. You can view the actual state of the resource in Azure through ASO v2, which enables you to see server-side applied defaults and more easily debug issues.
  • Dedicated storage versions. This enables faster (and less error prone) support for new Azure API versions, even if there were significant changes in resource shape.
  • Uniformity. ASO v2 resources are very uniform due to their code-generated nature.
  • Clearer resource states. The state a resource is in is exposed via a Ready condition.

Learn more about Azure Service Operator v2

ASO v1

⚠️ We strongly recommend new users consider ASO v2 instead of ASO v1

Azure Service Operator v1 is no longer under active development. Bug and security fixes are still made.

Features may be added if the scope is small and the impact is large, but we are winding down investment into ASO v1. If you are already using ASO v1 a migration path/tool will be provided to eventually move ASO v1 resources to ASO v2. In the meantime you can continue using ASO v1 as you have been.

Learn more about Azure Service Operator v1

Contributing

The contribution guide covers everything you need to know about how you can contribute to Azure Service Operators.

Support and feedback

For help, please use the following resources:

  1. Review the documentation
  2. Search open issues. If your issue is not represented there already, please open a new one.
  3. Chat with us on the azure-service-operator channel of the Kubernetes Slack. If you are not a member you can get an invitation from the community inviter.

For more information, see SUPPORT.md.

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

azure-service-operator's People

Contributors

aka-msft avatar alexeldeib avatar annazietlow avatar azadehkhojandi avatar babbageclunk avatar buhongw7583c avatar chrisrisner avatar clmccart avatar cnadolny avatar dependabot[bot] avatar devigned avatar dkisselev avatar frodopwns avatar haagha avatar huangpf avatar jakiefermsft avatar jananivms avatar jasonthedeveloper avatar jskulavik avatar matthchr avatar melonrush13 avatar microsoftopensource avatar porges avatar priyakumarank avatar ross-p-smith avatar sakthi-vetrivel avatar super-harsh avatar szoio avatar theunrepentantgeek avatar williammortlmicrosoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-service-operator's Issues

Operator: Allow user to delete API Management Service

#26

Users should be able to delete the Azure API Management service by removing its correlattting CR via kubectl delete AzureAPIManagement some-resource

DONE: APIM resources removed from Kubernetes should result in services being removed from Azure

As a user, I can deploy Azure API Management service using Azure Go SDK

This user story covers the following:
Creation of a resource helper library using Azure Go SDK that can be used to deploy/delete/update the resource. This can be used in the operator code.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can create an instance of the Azure API management service given the location and resource group using the helper library

  • User can delete an particular instance of the Azure API management service using the helper library

  • User can update the settings of a particular instance of the API management service using the helper library

  • Unit tests exist for the helper functions

  • The service principal information, subscription ID and tenant ID can be passed as environment variables to the helper library

  • The helper library has the ability to diagnose issues. (Discuss the logger we want to use)

Tasks
Add a link to tasks you would like to create for this user story

As a developer, I can test my Azure service operator for API management using integration tests

This user story covers the following:
Integration tests for the API management operator that can be used in the release pipeline

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • Developer can run integration tests for the operator as part of the release pipeline to catch issues

Tasks
Reference this issue when you create tasks for this user story

Create ACR operator POC using Azure SDK for Go

Use kubebuilder and the azure sdk for go to create an operator POC that defines a CRD for ACR deployments and an operator that watches instances of those CRDs.

When an ACR CR is created, the operator should deploy a new ACR in Azure.

When an ACR CR is updated, the operator should idempotently update the ACR in Azure.

When an ACR CR is deleted, the operator should remove the cloud resource in Azure.

As a user, I have documentation that helps me deploy the operator and use it

This user story covers the following:
Creation of README for deploying the operator, using it to deploy Azure services and running tests.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • Documentation covers instructions to deploy the operator based on the public docker image released.

  • Documentation should cover instructions to setup their environment to build the code

  • Documentation should cover how to deploy/delete//update Azure resources once the CRDs are installed (on Operator install) with example YAMLs and information on how to store the environment variables

  • Documentation should cover how to run unit tests/integration tests

Tasks
Reference this issue when you create tasks for this user story

As a user of the Azure service operator, I can ensure sensitive information is handled appropriately in the Kubernetes cluster

This user story covers the following:
Handling of tenant ID, Subscription ID, service principal ID/secret that is required to create the Azure service by storing them as secrets in the cluster during Operator install.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can populate the sensitive information needed for the Azure service to be created in the Kubernetes cluster as environment variables during Operator install

  • User can ensure that the Operator picks up new values if the information changes after Operator install

Tasks
Reference this issue when you create tasks for this user story

Scaffold API Management Controller

#26

  1. Clone the master branch
  2. check out a new branch for the api mgmt work (call it api-management)
  3. checkout a new branch for the first deliverable for this user story (scaffolding)
  4. use kubebuilder to scaffold the new operator kubebuilder create api --group azure --version v1 --kind AzureAPIManagement
  5. submit PR

DONE: When a user can deploy a blank CRD for API Management and trigger an empty Reconcile loop when mutating APIM CRs

code clean up

clean up the current repo, removing customer-specific details (namespaces,…) and send pr

As a developer, I can test my Azure service operator for EventHub using integration tests

This user story covers the following:
Integration tests for the API management operator that can be used in the release pipeline

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • Developer can run integration tests for the operator as part of the release pipeline to catch issues

Tasks
Reference this issue when you create tasks for this user story

Azure API management service

This epic covers

  • Development of an Azure Service operator using Kubebuilder which creates a CRD for Azure API management

  • An user should be able to deploy/delete/update the resource

  • We'll use Azure Go SDK for the resource management/creation

  • There will need to be tests and logging added

Acceptance criteria
Reference: [Done-Done checklist] Link

  • Can you create, delete and update settings for the Azure API Management service?

  • Are there unit tests for the resource helper functions?

  • Are there integration tests that run as part of the release pipeline?

  • Is there logging and telemetry added for diagnosability?

  • Is there documentation added for how to deploy and use the operator?

  • Code reviewed by product group?

  • Code reviewed by customer?

User Stories
Add links to User Stories for this epic. User stories are intended to be completed in one sprint.

As a developer, I can use the CI/CD pipeline to validate that the EventHub Operator works correctly

This user story covers the following:
Creation of the CI/CD pipeline using Azure Devops for EventHub Operator. This pipeline will be used for other operators too after this.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • The CI pipeline runs for every pull request. It builds the code and runs unit tests

  • All changes to the master branch trigger the CI/CD pipeline to build code, run unit tests in addition to also running integration tests and tagging releases in ACR and Github

  • The pipeline to run integration tests can also be triggered manually when we need to test if things are working fine with the external Azure APIs

Tasks
Reference this issue when you create tasks for this user story

As a user, I can deploy a Kubernetes operator to install Azure API management service using a Custom Resource Definition

This user story covers the following:
Creation of the Kubernetes service operator scaffolding using Kubebuilder. The operator would utilize the helper library developed using Go SDK to perform the actual resource deployment.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can install a Custom Resource Definition (CRD) for Azure API management service on the Kubernetes cluster

  • User can install a API management service instance using the CRD in an YAML file

  • User can update the settings of a particular instance of the API management service using the CRD

  • User can delete the instance of the API management service using the CRD

  • User gets clear information on why an operation failed and how to remedy it

Tasks
Reference this issue when you create tasks for this user story

Create an interface for API Management Helper functions

#24

Create a generic interface for concrete implementations of helper functions for API Management Service. The reason for this is so that a Go Azure SDK concrete implementation can be created now, but allowing for ARM and Terraform concrete implementations at a later date.

This will require creating a struct to pass information to / uniquely identify the Go Azure SDK concrete implementation.

Task: Integrate with aad-pod-identity

This is also from feedback from the AKS PG team. We should look at using AAD pod identity instead of service principals

**Done criteria **
This is the "done" criteria for this task

  • The operator should be able to run given an MSI identity using AAD pod identity

Epic reference
#266

Reconciliation loops should be non-blocking

Currently several reconciliation loops return futures from Azure API calls and wait on their completion. This means deploying many object will cause blocking calls and effectively serialize their creation. This is undesirable.

We should instead make reconciliation not care about the result of the call, allowing it to proceed and pick up any information it would need during the next requeue.

Add fields needed to configure API Management Service to Azure APIManagement struct spec

#26

Refer to the API Management spec to determine which fields will be needed to properly configure the service: https://github.com/Azure/azure-sdk-for-go/blob/a629ae7873bf2a86184a8bc1b65e65e1ab532f57/services/apimanagement/mgmt/2019-01-01/apimanagement/models.go#L1193:6

update the spec fields in api/v1/azureapimanagement_types.go to reflect the configuration requirementts

DONE: New API Management service manifests can accept all the configuration necessary to deploy API Management services. APIM CRs can be unmarshaled into a go struct with all the data intact.

Investigate / become SME on the API Mgmt Svc

#24

Investigate the API Mgmt Svc in the portal and understand how to setup API endpoints for:

Blank, OpenAPI, and WADL (ignore the rest)

Understand what configuration we should do via YAML vs. what should be done in the portal after deployment

Create more limited admin group for repo ownership

Currently, the owner of this repo is ACS-Admin (plus me). The owner should reflect the actual participants and we can't add CSE people to ACS-Admin. So maybe we should create a new group that combines the AKS participants and the CSE ones?

Possibly not high priority!

Document usage of API Management service operator

#26

Create documentation detailing how a user can deploy, update, or delete API Management services from Kubernetes.

DONE: User can perform CRUD operations after following the documentation provided by this issue

Proposed change to Eventhub validation

Current behavior

Currently, the Eventhub operator employs a Webhook in order to validate that the Eventhub namespace referenced by an Eventhub CR exists in Azure.

If it does not exist, the kubectl create command will fail.

Webhook code here: https://github.com/Azure/azure-service-operator/blob/master/api/v1/eventhub_webhook.go#L71

Expected behavior

My expectation is that kubectl only rejects manifests with malformed yaml or json. Beyond that, it continues to attempt to reach the state desired by the user.

The current solution makes us rely on Flux to deploy the manifests and overcome failures. The expected behavior would allow us to remove the validating webhook and simplify testing.

Proposed Change

Remove webhook for validating Eventhub resources. Check for existence of namespace in reconciliation loop, if it does not exist, set a status explaining the issue on the resource and re-queue.

As a user, I can deploy a Kubernetes operator to install Azure EventHub using a Custom Resource Definition

This user story covers the following:
Creation of a resource helper library using Azure Go SDK that can be used to deploy/delete/update the resource. This can be used in the operator code.

Acceptance Criteria

  • User can install a Custom Resource Definition (CRD) for Azure EventHub and EventHub namespace on the Kubernetes cluster

  • User can install Azure EventHub and EventHub namespace instance using the CRD in an YAML file

  • User can update the settings of a particular instance of the Azure EventHub and EventHub namespace using the CRD

  • User can delete the instance of the Azure EventHub and EventHub namespace using the CRD

  • User gets clear information on why an operation failed and how to remedy it

Tasks
Reference this issue when you create tasks for this user story

As an user, I can diagnose errors and troubleshoot issues with the Azure Service Operator for API management

This user story covers the following:
Diagnosability for the operator including logging, telemetry and metric monitoring

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can understand clearly what operations succeeded and what failed using the logs

  • User can troubleshoot and remedy the problem when the operator does not work

Tasks
Reference this issue when you create tasks for this user story

Create an ACR operator POC that uses Terraform

Use kubebuilder and Terraform to create an operator POC that defines a CRD for ACR deployments and an operator that watches instances of those CRDs.

When an ACR CR is created, the operator should use terraform to deploy a new ACR instance to Azure

When an ACR CR is updated, the operator should redeploy the terraform plan.

When an ACR CR is deleted, the operator should remove the cloud resource in Azure using Terraform.

Create an ACR operator POC that uses AARM templates

Use kubebuilder and the azure sdk for go to create an operator POC that defines a CRD for ACR deployments and an operator that watches instances of those CRDs.

When an ACR CR is created, the operator should deploy a new ACR in Azure using the go adk and an Arm template.

When an ACR CR is updated, the operator should redeploy the Arm template.

When an ACR CR is deleted, the operator should remove the Arm deployment and the ACR resource deployed within it.

Restructure repository so that the code is logically laid out

After merging in the event hub code the source code repository needs additional helper functions from the azure go sdk example repository added in, as well as needs to be restructured so that we can expand the repository to have additional functionality

#24

Operator: Allow user to update API Management Service

#26

Users should be able to change the configuration for allowed fields in an AzureAPIManagement CR and have those changes propagated to the Azure service.

DONE: Reconciliation loop applies changes in spec idempotently to Azure APIM service

As a user, I can deploy Azure EventHub using Azure Go SDK

This user story covers the following:
Creation of a resource helper library using Azure Go SDK that can be used to deploy/delete/update eventhub and eventhub namespace. This can be used in the operator code.

Acceptance Criteria

  • User can create an instance of the Azure EventHub given the location and resource group using the helper library

  • User can delete an particular instance of the Azure EventHub using the helper library

  • User can update the settings of a particular instance of the Azure EventHub using the helper library

  • Unit tests exist for the helper functions

  • The service principal information, subscription ID and tenant ID can be passed as environment variables to the helper library

  • The helper library has the ability to diagnose issues.

Tasks
Reference this issue when you create tasks for this user story

As a user of the Azure service operator, I can ensure sensitive information is handled appropriately in the Kubernetes cluster

This user story covers the following:
Handling of tenant ID, Subscription ID, service principal ID/secret that is required to create the Azure service by storing them as environment variables in the cluster during Operator install.

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can populate the sensitive information needed for the Azure service to be created in the Kubernetes cluster as environment variables during Operator install

  • User can ensure that the Operator picks up new values if the information changes after Operator install

Tasks
Reference this issue when you create tasks for this user story

As a user, I can diagnose errors and troubleshoot issues with the Azure Service Operator for EventHub

This user story covers the following:
Diagnosability for the operator including logging, telemetry and metric monitoring

Acceptance Criteria
[Update this once the owner starts looking at the user story]

  • User can understand clearly what operations succeeded and what failed using the logs

  • User can troubleshoot and remedy the problem when the operator does not work

Tasks
Reference this issue when you create tasks for this user story

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.