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

Aad pod identity as add on #3475

Merged
merged 1 commit into from
Jul 20, 2018
Merged

Conversation

kkmsft
Copy link
Contributor

@kkmsft kkmsft commented Jul 13, 2018

What this PR does / why we need it:

Add deploying Aad pod Identity as a add-on for acs engine created cluster.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

@kkmsft
Copy link
Contributor Author

kkmsft commented Jul 13, 2018

/cc @khenidak @rite2nikhil @ritazh

@ritazh
Copy link
Member

ritazh commented Jul 13, 2018

I think we should hold off merging this until pod identity works with azure cni (no podCIDR) and RBAC, per these two issues: Azure/aad-pod-identity#40 and Azure/aad-pod-identity#39

@khenidak
Copy link
Contributor

@kkmsft can we remove the [WIP] tag and prep to merge this?
@jackfrancis @CecileRobertMichon I appreciate if you review this.

@@ -486,6 +486,10 @@ configACIConnectorAddon() {
sed -i "s|<kubernetesACIConnectorKey>|$(echo $ACI_CONNECTOR_KEY)|g" "/etc/kubernetes/addons/aci-connector-deployment.yaml"
}

configAADPodIdentityAddon() {
sed -i "s|<kubernetesAADPodIdentityCredentials>|$AAD_POD_IDENTITY|g" "/etc/kubernetes/addons/aad-pod-identity-deployment.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we aren't actually passing in AAD_POD_IDENTITY or AAD_POD_IDENTITY_ADDON env vars yet. May I suggest that we drop the "boolean" AAD_POD_IDENTITY_ADDON var, and simply check for non-empty string value of AAD_POD_IDENTITY to determine whether or not we want to do the sed replacement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Jack. Since we don't have anything to pass and use values from azure.json, this is not required. So have removed this.

{
"name": "aad-pod-identity",
"enabled" : true,
"config": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these configs are specific to the aci-connector. I dont think config is neccessary for pod identity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

"name": "agentpool",
"count": 3,
"vmSize": "Standard_DS2_v2",
"availabilityProfile": "VirtualMachineScaleSets"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to support VMSS first...hold this PR until that is added or change this to AvailabilitySet

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using AvailablitySet in this PR as the example. Will add the ScaleSet after adding the support for that in aad-pod-identity.

apiVersion: v1
kind: Secret
metadata:
name: aad-pod-identity-secret
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need this for pod identity

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using azure.json directly.

@@ -103,6 +103,16 @@
"kubernetesTillerCPULimit": "[parameters('kubernetesTillerCPULimit')]",
"kubernetesTillerMemoryLimit": "[parameters('kubernetesTillerMemoryLimit')]",
"kubernetesTillerMaxHistory": "[parameters('kubernetesTillerMaxHistory')]",
"kubernetesAADPodIdentityEnabled": "[parameters('kubernetesAADPodIdentityEnabled')]",
"kubernetesAADPodIdentitySpec": "[parameters('kubernetesAADPodIdentitySpec')]",
"kubernetesAADPodIdentityNodeName": "[parameters('kubernetesAADPodIdentityNodeName')]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are specific to aci-connector. I dont think we need these for pod identity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled flag remains. Rest removed.

},
"type": "string"
},
"kubernetesAADPodIdentityOS": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these params are specific to the aci-connector. I dont think config is neccessary for pod identity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Rita. Removed them. Remnants from following a template example :-)

@kkmsft kkmsft force-pushed the aad-pod-identity branch 6 times, most recently from d86fab9 to 9d83cbf Compare July 19, 2018 03:12
@kkmsft kkmsft changed the title [WIP] Aad pod identity as add on Aad pod identity as add on Jul 19, 2018
@khenidak
Copy link
Contributor

@jackfrancis @ritazh @kkmsft @CecileRobertMichon
Can we merge this?

"name": "agentpool",
"count": 3,
"vmSize": "Standard_DS2_v2",
"availabilityProfile": "AvailabilitySet"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to indicate currently only "AvailabilitySet" is supported to avoid users creating using "VirtualMachineScaleSets".


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

You should see two pod names - one starting with mic and another nmi as `Running` after executing:
Copy link
Member

@ritazh ritazh Jul 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should see two sets of pods - a single mic pod and as many nmi pods as there are agent nodes in Running state after executing:

"kubernetesmasteraddons-aad-pod-identity-deployment.yaml",
"aad-pod-identity-deployment.yaml",
profile.OrchestratorProfile.KubernetesConfig.IsAADPodIdentityEnabled(),
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spacing

@codecov
Copy link

codecov bot commented Jul 19, 2018

Codecov Report

Merging #3475 into master will increase coverage by 0.36%.
The diff coverage is 42.85%.

@@            Coverage Diff             @@
##           master    #3475      +/-   ##
==========================================
+ Coverage   55.49%   55.85%   +0.36%     
==========================================
  Files         105      105              
  Lines       15990    16003      +13     
==========================================
+ Hits         8873     8938      +65     
+ Misses       6369     6316      -53     
- Partials      748      749       +1

Containers: []api.KubernetesContainerSpec{
{
Name: "mic",
Image: "nikhilbh/mic:1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove image, it is not being used

},
{
Name: "nmi",
Image: "nikhilbh/nmi:1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove image, it is not being used

- name: nmi
image: "nikhilbh/nmi:1.2"
imagePullPolicy: Always
args:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need resource limits and requests here.

component: mic
spec:
serviceAccountName: aad-pod-id-mic-service-account
containers:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here. I think you need resource limits and requests here.

@ritazh
Copy link
Member

ritazh commented Jul 20, 2018

LGTM @jackfrancis will add an issue to add validation test for this

@jackfrancis
Copy link
Member

@ritazh In your // TODO issue add configurable resource limits

Thanks so much Rita and @kkmsft!

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jackfrancis
Copy link
Member

@ritazh and E2E test coverage :)

@jackfrancis jackfrancis merged commit fdcd8cb into Azure:master Jul 20, 2018
@kkmsft kkmsft deleted the aad-pod-identity branch October 14, 2018 00:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants