Skip to content

Commit

Permalink
Updating Helm Chart and adding custom namespace (#985)
Browse files Browse the repository at this point in the history
* initial changes for vnet rule operator

* added mysql docs

* remaining changes, added tests + controller logic

* minor cleanup

* fixed test

* updated SKU type

* updating helm chart

* custom namespace changes

* merged custom namespace changes

* removing unrelated change

* updated chart version + deps

Co-authored-by: William Mortl <[email protected]>
Co-authored-by: Erin Corson <[email protected]>
Co-authored-by: Janani Vasudevan <[email protected]>
  • Loading branch information
4 people authored Apr 27, 2020
1 parent 647dd4a commit c003029
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 15 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,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
Binary file modified 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
10 changes: 7 additions & 3 deletions 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,17 +21,15 @@ 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:
name: aso-identity-binding
selector: aso_manager_binding
namespace: azureoperator-system
azureIdentity:
enabled: True
name: aso-identity
namespace: azureoperator-system
type: 0

# Update values for Managed Identity
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"
13 changes: 13 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,19 @@ go build -o bin/manager main.go

If you make changes to the operator and want to update the deployment without recreating the cluster (when testing locally), you can use the `make update` to update your Azure Operator pod. If you need to rebuild the docker image without cache, use `make ARGS="--no-cache" update`

12. Update the Helm Chart to include the new CRD.
Run:
```
make helm-chart-manifests
make delete-helm-gen-manifests
```

This will generate the manifests into the Helm Chart directory, and repackage them into a new Helm Chart tar.gz file. Add the newly modified files to the PR, which should be the following:
```
charts/azure-service-operator-0.1.0.tgz
charts/index.yaml
```

**Notes:**

- Run `make manifests` if you find the property you add doesn't work.
Expand Down

0 comments on commit c003029

Please sign in to comment.