Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Add ACI Connector (#1844)
Browse files Browse the repository at this point in the history
* added aci connector addon

* added example json

* linting changes

* disabled by default

* linting changes

* added readme

* fix test bools

* review changes

* add KubernetesAddon.Config key/val defaults

* defaults for config

* handling nil

* KubernetesAddons.Config conversion

* update example api model readme

* update default config

* update example api model

* removing china cloud changes
  • Loading branch information
sozercan authored and jackfrancis committed Dec 1, 2017
1 parent 8fde49b commit 6d1a3c2
Show file tree
Hide file tree
Showing 19 changed files with 1,072 additions and 397 deletions.
2 changes: 1 addition & 1 deletion docs/clusterdefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ More usefully, let's add some custom configuration to both of the above addons:
"containers": [
{
"name": "tiller",
"image": "myDockerHubUser/tiller:v3.0.0-alpha
"image": "myDockerHubUser/tiller:v3.0.0-alpha",
"cpuRequests": "1",
"memoryRequests": "1024Mi",
"cpuLimits": "1",
Expand Down
108 changes: 108 additions & 0 deletions examples/addons/aci-connector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# ACI Connector Add-on


This is the ACI Connector add-on. Add this add-on to your json file as shown below to automatically enable ACI Connector in your new Kubernetes cluster.

```
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"kubernetesConfig": {
"addons": [
{
"name": "aci-connector",
"enabled" : true,
"config": {
"clientId": "",
"clientKey": "",
"tenantId": "",
"subscriptionId": "",
"resourceGroup": "",
"region": ""
},
"containers": [
{
"name": "aci-connector",
"cpuRequests": "50m",
"memoryRequests": "150Mi",
"cpuLimits": "50m",
"memoryLimits": "150Mi"
}
]
}
]
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_DS2_v2",
},
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 3,
"vmSize": "Standard_DS2_v2",
"availabilityProfile": "AvailabilitySet"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}
```

You can validate that the add-on is running as expected with the following commands:

Make sure to create resource group:
```
az group create \
--name "[resource group name]" \
--location "[location]"
```

You should see ACI Connector as running after running:
```
$ kubectl get pods -n kube-system
```

You should see ACI Connector node after running:
```
$ kubectl get nodes
```

Follow the README at https://github.com/Azure/aci-connector-k8s for examples.

# Configuration
|Name|Required|Description|Default Value|
|---|---|---|---|
|clientId|yes|your client id||
|clientKey|yes|your client key||
|tenantId|yes|your tenant id||
|resourceGroup|yes|your resource group||
|region|yes|Azure region|"westus"|
|name|no|container name|"aci-connector"|
|image|no|image|"microsoft/aci-connector-k8s:latest"|
|cpuRequests|no|cpu requests for the container|"50m"|
|memoryRequests|no|memory requests for the container|"150Mi"|
|cpuLimits|no|cpu limits for the container|"50m"|
|memoryLimits|no|memory limits for the container|"150Mi"|


# Supported Orchestrators
Kubernetes
61 changes: 61 additions & 0 deletions examples/addons/aci-connector/kubernetes-aci-connector.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"kubernetesConfig": {
"addons": [
{
"name": "aci-connector",
"enabled" : true,
"config": {
"clientId": "",
"clientKey": "",
"tenantId": "",
"subscriptionId": "",
"resourceGroup": "",
"region": "eastus"
},
"containers": [
{
"name": "aci-connector",
"image": "microsoft/aci-connector-k8s:latest",
"cpuRequests": "50m",
"memoryRequests": "150Mi",
"cpuLimits": "50m",
"memoryLimits": "150Mi"
}
]
}
]
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_DS2_v2"
},
"agentPoolProfiles": [
{
"name": "agentpool",
"count": 3,
"vmSize": "Standard_DS2_v2",
"availabilityProfile": "AvailabilitySet"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}
91 changes: 91 additions & 0 deletions parts/kubernetesmasteraddons-aci-connector-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: aci-connector
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: "EnsureExists"
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: aci-connector
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: "EnsureExists"
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- services
- endpoints
- events
- secrets
- nodes
- nodes/status
- pods/status
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: aci-connector
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: "EnsureExists"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aci-connector
subjects:
- kind: ServiceAccount
name: aci-connector
namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: aci-connector
namespace: kube-system
labels:
app: aci-connector
name: aci-connector
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: "EnsureExists"
spec:
replicas: 1
template:
metadata:
labels:
app: aci-connector
spec:
serviceAccountName: aci-connector
containers:
- name: aci-connector
image: <kubernetesACIConnectorSpec>
env:
- name: AZURE_CLIENT_ID
value: <kubernetesACIConnectorClientId>
- name: AZURE_CLIENT_KEY
value: <kubernetesACIConnectorClientKey>
- name: AZURE_TENANT_ID
value: <kubernetesACIConnectorTenantId>
- name: AZURE_SUBSCRIPTION_ID
value: <kubernetesACIConnectorSubscriptionId>
- name: ACI_RESOURCE_GROUP
value: <kubernetesACIConnectorResourceGroup>
- name: ACI_REGION
value: <kubernetesACIConnectorRegion>
resources:
requests:
cpu: <kubernetesACIConnectorCPURequests>
memory: <kubernetesACIConnectorMemoryRequests>
limits:
cpu: <kubernetesACIConnectorCPULimit>
memory: <kubernetesACIConnectorMemoryLimit>
nodeSelector:
beta.kubernetes.io/os: linux
89 changes: 89 additions & 0 deletions parts/kubernetesmasteraddons-aci-connector-deployment1.5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: aci-connector
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
---
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRole
metadata:
name: aci-connector
labels:
app: aci-connector
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: "EnsureExists"
rules:
- apiGroups:
- ""
resources:
- configmaps
- pods
- services
- endpoints
- events
- secrets
- nodes
- nodes/status
- pods/status
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRoleBinding
metadata:
name: aci-connector
labels:
kubernetes.io/cluster-service: "true"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: aci-connector
namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: aci-connector
namespace: kube-system
labels:
app: aci-connector
name: aci-connector
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
template:
metadata:
labels:
app: aci-connector
spec:
serviceAccountName: aci-connector
containers:
- name: aci-connector
image: <kubernetesACIConnectorSpec>
env:
- name: AZURE_CLIENT_ID
value: <kubernetesACIConnectorClientId>
- name: AZURE_CLIENT_KEY
value: <kubernetesACIConnectorClientKey>
- name: AZURE_TENANT_ID
value: <kubernetesACIConnectorTenantId>
- name: AZURE_SUBSCRIPTION_ID
value: <kubernetesACIConnectorSubscriptionId>
- name: ACI_RESOURCE_GROUP
value: <kubernetesACIConnectorResourceGroup>
- name: ACI_REGION
value: <kubernetesACIConnectorRegion>
resources:
requests:
cpu: <kubernetesACIConnectorCPURequests>
memory: <kubernetesACIConnectorMemoryRequests>
limits:
cpu: <kubernetesACIConnectorCPULimit>
memory: <kubernetesACIConnectorMemoryLimit>
nodeSelector:
beta.kubernetes.io/os: linux
Loading

0 comments on commit 6d1a3c2

Please sign in to comment.