Skip to content

Commit

Permalink
Merge branch 'master' into azdo-pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
dkisselev committed Apr 30, 2020
2 parents cb444b3 + b8c8ed1 commit a301cf5
Show file tree
Hide file tree
Showing 95 changed files with 1,408 additions and 4,080 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,17 @@ validate-copyright-headers:

# Generate manifests for helm and package them up
helm-chart-manifests: manifests
kustomize build ./config/default -o ./charts/azure-service-operator/templates
rm charts/azure-service-operator/templates/~g_v1_namespace_azureoperator-system.yaml
sed -i '' -e 's@controller:latest@{{ .Values.image.repository }}@' ./charts/azure-service-operator/templates/apps_v1_deployment_azureoperator-controller-manager.yaml
mkdir charts/azure-service-operator/templates/generated
kustomize build ./config/default -o ./charts/azure-service-operator/templates/generated
rm charts/azure-service-operator/templates/generated/~g_v1_namespace_azureoperator-system.yaml
sed -i '' -e 's@controller:latest@{{ .Values.image.repository }}@' ./charts/azure-service-operator/templates/generated/apps_v1_deployment_azureoperator-controller-manager.yaml
find ./charts/azure-service-operator/templates/generated/ -type f -exec sed -i '' -e 's@namespace: azureoperator-system@namespace: {{ .Values.namespace }}@' {} \;
helm package ./charts/azure-service-operator -d ./charts
helm repo index ./charts

delete-helm-gen-manifests:
rm -rf charts/azure-service-operator/templates/generated/

# Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Expand Down
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ resources:
- group: azure
version: v1alpha1
kind: BlobContainer
- group: azure
version: v1alpha1
kind: AzureDataLakeGen2FileSystem
- group: azure
version: v1alpha1
kind: PostgreSQLServer
Expand All @@ -53,6 +50,9 @@ resources:
- group: azure
version: v1alpha1
kind: PostgreSQLFirewallRule
- group: azure
version: v1alpha1
kind: PostgreSQLVNetRule
- group: azure
version: v1alpha1
kind: APIMgmtAPI
Expand Down
71 changes: 0 additions & 71 deletions api/v1alpha1/azuredatalakegen2filesystem_types.go

This file was deleted.

4 changes: 0 additions & 4 deletions api/v1alpha1/azuresqldatabase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,3 @@ func (s *AzureSqlDatabase) IsSubmitted() bool {
func (s *AzureSqlDatabase) HasFinalizer(finalizerName string) bool {
return helpers.ContainsString(s.ObjectMeta.Finalizers, finalizerName)
}

func (s *AzureSqlDatabase) IsBeingDeleted() bool {
return !s.ObjectMeta.DeletionTimestamp.IsZero()
}
4 changes: 0 additions & 4 deletions api/v1alpha1/blobcontainer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,3 @@ func (bc *BlobContainer) IsProvisioned() bool {
func (bc *BlobContainer) HasFinalizer(finalizerName string) bool {
return helpers.ContainsString(bc.ObjectMeta.Finalizers, finalizerName)
}

func (bc *BlobContainer) IsBeingDeleted() bool {
return !bc.ObjectMeta.DeletionTimestamp.IsZero()
}
4 changes: 0 additions & 4 deletions api/v1alpha1/consumergroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ func init() {
SchemeBuilder.Register(&ConsumerGroup{}, &ConsumerGroupList{})
}

func (consumerGroup *ConsumerGroup) IsBeingDeleted() bool {
return !consumerGroup.ObjectMeta.DeletionTimestamp.IsZero()
}

func (consumerGroup *ConsumerGroup) IsSubmitted() bool {
return consumerGroup.Status.Provisioning || consumerGroup.Status.Provisioned

Expand Down
22 changes: 15 additions & 7 deletions api/v1alpha1/cosmosdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type CosmosDBSpec struct {
Properties CosmosDBProperties `json:"properties,omitempty"`
VirtualNetworkRules *[]CosmosDBVirtualNetworkRule `json:"virtualNetworkRules,omitempty"`
KeyVaultToStoreSecrets string `json:"keyVaultToStoreSecrets,omitempty"`
Locations *[]CosmosDBLocation `json:"locations,omitempty"`
IPRules *[]string `json:"ipRules,omitempty"`
}

Expand All @@ -45,9 +46,17 @@ type CosmosDBProperties struct {
// DatabaseAccountOfferType - The offer type for the Cosmos DB database account.
DatabaseAccountOfferType CosmosDBDatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"`
// IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules.
IsVirtualNetworkFilterEnabled bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
EnableMultipleWriteLocations bool `json:"enableMultipleWriteLocations,omitempty"`
MongoDBVersion string `json:"mongoDBVersion,omitempty"`
IsVirtualNetworkFilterEnabled bool `json:"isVirtualNetworkFilterEnabled,omitempty"`
EnableMultipleWriteLocations bool `json:"enableMultipleWriteLocations,omitempty"`
MongoDBVersion string `json:"mongoDBVersion,omitempty"`
Capabilities *[]Capability `json:"capabilities,omitempty"`
}

// Capability cosmos DB capability object
type Capability struct {
//Name *CosmosCapability `json:"name,omitempty"`
// +kubebuilder:validation:Enum=EnableCassandra;EnableTable;EnableGremlin;EnableMongo;
Name *string `json:"name,omitempty"`
}

// +kubebuilder:validation:Enum=Standard
Expand All @@ -58,13 +67,12 @@ const (
CosmosDBDatabaseAccountOfferTypeStandard CosmosDBDatabaseAccountOfferType = "Standard"
)

/*
// CosmosDBLocation defines one or more locations for geo-redundancy and high availability
type CosmosDBLocation struct {
FailoverPriority int `json:"failoverPriority,omitempty"`
LocationName string `json:"locationName,omitempty"`
LocationName string `json:"locationName"`
FailoverPriority int32 `json:"failoverPriority"`
IsZoneRedundant bool `json:"isZoneRedundant,omitempty"`
}
*/

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
Expand Down
4 changes: 0 additions & 4 deletions api/v1alpha1/eventhub_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ func init() {
SchemeBuilder.Register(&Eventhub{}, &EventhubList{})
}

func (eventhub *Eventhub) IsBeingDeleted() bool {
return !eventhub.ObjectMeta.DeletionTimestamp.IsZero()
}

func (eventhub *Eventhub) IsSubmitted() bool {
return eventhub.Status.Provisioning || eventhub.Status.Provisioned
}
Expand Down
4 changes: 0 additions & 4 deletions api/v1alpha1/eventhubnamespace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ func init() {
SchemeBuilder.Register(&EventhubNamespace{}, &EventhubNamespaceList{})
}

func (eventhubNamespace *EventhubNamespace) IsBeingDeleted() bool {
return !eventhubNamespace.ObjectMeta.DeletionTimestamp.IsZero()
}

func (eventhubNamespace *EventhubNamespace) IsSubmitted() bool {
return eventhubNamespace.Status.Provisioning || eventhubNamespace.Status.Provisioned

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/mysqlvnetrule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ type MySQLVNetRuleSpec struct {
// +kubebuilder:object:root=true

// MySQLVNetRule is the Schema for the mysqlvnetrules API
// +kubebuilder:printcolumn:name="Provisioned",type="string",JSONPath=".status.provisioned"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message"
type MySQLVNetRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
49 changes: 49 additions & 0 deletions api/v1alpha1/postgresqlvnetrule_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// PotgreSQLVNetRuleSpec defines the desired state of PostgreSQLVNetRule
type PostgreSQLVNetRuleSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
ResourceGroup string `json:"resourceGroup"`
Server string `json:"server"`
VNetResourceGroup string `json:"vNetResourceGroup"`
VNetName string `json:"vNetName"`
SubnetName string `json:"subnetName"`
IgnoreMissingServiceEndpoint bool `json:"ignoreMissingServiceEndpoint,omitempty"`
}

// +kubebuilder:object:root=true

// PostgreSQLVNetRule is the Schema for the PostgreSQLVNetRules API
// +kubebuilder:printcolumn:name="Provisioned",type="string",JSONPath=".status.provisioned"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.message"
type PostgreSQLVNetRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec PostgreSQLVNetRuleSpec `json:"spec,omitempty"`
Status ASOStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// PostgreSQLVNetRuleList contains a list of PostgreSQLVNetRule
type PostgreSQLVNetRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PostgreSQLVNetRule `json:"items"`
}

func init() {
SchemeBuilder.Register(&PostgreSQLVNetRule{}, &PostgreSQLVNetRuleList{})
}
4 changes: 0 additions & 4 deletions api/v1alpha1/resourcegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ func init() {
SchemeBuilder.Register(&ResourceGroup{}, &ResourceGroupList{})
}

func (resourceGroup *ResourceGroup) IsBeingDeleted() bool {
return !resourceGroup.ObjectMeta.DeletionTimestamp.IsZero()
}

func (resourceGroup *ResourceGroup) IsSubmitted() bool {
return resourceGroup.Status.Provisioning || resourceGroup.Status.Provisioned

Expand Down
5 changes: 3 additions & 2 deletions api/v1alpha1/virtualnetwork_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
type VNetSubnets struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
SubnetName string `json:"subnetName"`
SubnetAddressPrefix string `json:"subnetAddressPrefix"`
SubnetName string `json:"subnetName"`
SubnetAddressPrefix string `json:"subnetAddressPrefix"`
ServiceEndpoints []string `json:"serviceEndpoints,omitempty"`
}

// VirtualNetworkSpec defines the desired state of VirtualNetwork
Expand Down
Binary file added charts/azure-service-operator-0.1.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion charts/azure-service-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
name: azure-service-operator
version: 0.1.0
appVersion: 0.1.0
Expand Down
11 changes: 9 additions & 2 deletions charts/azure-service-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ If you are deploying into an already created namespace, be sure to set the follo
createNamespace: False
```

and specify the namespace name:
```
namespace: your-namespace
```

Finally, install the chart with your added values. The chart can be installed by using a values file or environment variables.
```
helm upgrade --install aso azureserviceoperator/azure-service-operator -f values.yaml
Expand Down Expand Up @@ -102,7 +107,9 @@ The following table lists the configurable parameters of the azure-service-opera
| `azureClientSecret` | Azure Service Principal Client Secret | `` |
| `azureUseMI` | Set to True if using Managed Identity for authentication | `False` |
| `azureOperatorKeyvault` | Set this value with the name of your Azure Key Vault resource if you prefer to store secrets in Key Vault rather than as Kubernetes secrets (default) | `` |
| `image.repository` | Image repository | `mcr.microsoft.com/k8s/azure-service-operator:0.0.9150` |
| `createNamespace` | Set to True if you would like the namespace autocreated, otherwise False if you have an existing namespace | `True` |
| `image.repository` | Image repository | `mcr.microsoft.com/k8s/azure-service-operator:0.0.20258` |
| `cloudEnvironment` | Set the cloud environment, possible values include: AzurePublicCloud, AzureUSGovernmentCloud, AzureChinaCloud, AzureGermanCloud | `AzurePublicCloud` |
| `createNamespace` | Set to True if you would like the namespace autocreated, otherwise False if you have an existing namespace. If using an existing namespace, the `namespace` field must also be updated | `True` |
| `namespace` | Configure a custom namespace to deploy the operator into | `azureoperator-system` |
| `aad-pod-identity.azureIdentity.resourceID` | The resource ID for your managed identity | `` |
| `aad-pod-identity.azureIdentity.clientID` | The client ID for your managed identity | `` |
Binary file not shown.
6 changes: 6 additions & 0 deletions charts/azure-service-operator/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: aad-pod-identity
repository: https://raw.githubusercontent.com/Azure/aad-pod-identity/master/charts
version: 1.5.5
digest: sha256:db38bea05230aea212e9ab0f056a1defa73d540bbff2962e807b2fd860dddf3d
generated: "2020-04-22T10:23:15.164357-07:00"
2 changes: 1 addition & 1 deletion charts/azure-service-operator/templates/namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: azureoperator-system
name: {{ .Values.namespace }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/azure-service-operator/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ apiVersion: v1
kind: Secret
metadata:
name: azureoperatorsettings
namespace: azureoperator-system
namespace: {{ .Values.namespace }}
type: Opaque
data:
AZURE_SUBSCRIPTION_ID: {{ .Values.azureSubscriptionID | b64enc | quote }}
AZURE_TENANT_ID: {{ .Values.azureTenantID | b64enc | quote }}
AZURE_CLOUD_ENV: {{ .Values.cloudEnvironment | b64enc | quote }}

{{- if .Values.azureClientID }}
AZURE_CLIENT_ID: {{ .Values.azureClientID | b64enc | quote }}
Expand Down
8 changes: 7 additions & 1 deletion charts/azure-service-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ azureOperatorKeyvault: ""
# Set to False if you do not need the namespace autocreated
createNamespace: True

# Optional, Custom Namespace
namespace: azureoperator-system

# Set the cloud environment, possible values include: AzurePublicCloud, AzureUSGovernmentCloud, AzureChinaCloud, AzureGermanCloud
cloudEnvironment: AzurePublicCloud

# Authentication - Service Principal
azureClientID: ""
azureClientSecret: ""
Expand All @@ -15,7 +21,7 @@ azureClientSecret: ""
azureUseMI: False

image:
repository: mcr.microsoft.com/k8s/azure-service-operator:0.0.13046
repository: mcr.microsoft.com/k8s/azure-service-operator:0.0.20258

aad-pod-identity:
azureIdentityBinding:
Expand Down
13 changes: 9 additions & 4 deletions charts/index.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
apiVersion: v1
entries:
azure-service-operator:
- apiVersion: v1
- apiVersion: v2
appVersion: 0.1.0
created: "2020-03-09T14:47:12.306231-05:00"
created: "2020-04-23T11:50:42.794582-07:00"
dependencies:
- condition: azureUseMI
name: aad-pod-identity
repository: https://raw.githubusercontent.com/Azure/aad-pod-identity/master/charts
version: 1.5.5
description: Deploy components and dependencies of azure-service-operator
digest: 4fbc8ed33b694e9a239b4b5c3e0903a23c731f1fd2d5e8a040488f780487bf87
digest: 6aaf972ecdc1aad3c0e9b4c414d8b39cc33c40f17ef8b8985b3c8acfac80bc72
home: https://github.com/Azure/azure-service-operator
name: azure-service-operator
sources:
- https://github.com/Azure/azure-service-operator
urls:
- azure-service-operator-0.1.0.tgz
version: 0.1.0
generated: "2020-03-09T14:47:12.302559-05:00"
generated: "2020-04-23T11:50:42.791883-07:00"
Loading

0 comments on commit a301cf5

Please sign in to comment.