Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add App Mesh controller and injector charts #1

Merged
merged 18 commits into from
Oct 2, 2019
Merged

Add App Mesh controller and injector charts #1

merged 18 commits into from
Oct 2, 2019

Conversation

stefanprodan
Copy link
Collaborator

@stefanprodan stefanprodan commented Oct 1, 2019

This PR adds the App Mesh controller and injector charts and CircleCI config (lint and validate charts).

Tested on EKS v1.13 with Helm v2 and v3:

kubectl create ns appmesh-system

kubectl apply -f stable/appmesh-controller/crds/

helmv3 upgrade -i appmesh-controller stable/appmesh-controller/ \
--wait --namespace appmesh-system

helmv3 upgrade -i appmesh-inject stable/appmesh-inject/  \
--wait --namespace appmesh-system \
--set mesh.create=true \
--set mesh.name=global \
--set mesh.discovery=dns

kubectl get meshes.appmesh.k8s.aws -oyaml
  status:
    meshCondition:
    - lastTransitionTime: "2019-10-01T22:07:50Z"
      status: "True"
      type: MeshActive

kubectl -n appmesh-system logs deploy/appmesh-controller
I1001 22:07:34.124266       1 root.go:123] Running controller with threadiness=5
I1001 22:07:34.124281       1 controller.go:180] Starting controller
I1001 22:07:34.124287       1 controller.go:190] Waiting for informer caches to sync
I1001 22:07:34.224579       1 controller.go:195] Starting workers
I1001 22:07:34.224755       1 controller.go:205] Started workers
I1001 22:07:50.410786       1 mesh.go:58] Created mesh global

kubectl -n appmesh-system logs deploy/appmesh-inject
I1002 07:46:07.889972       1 server.go:74] Starting HTTP server on port 8080
I1002 07:51:42.813420       1 server.go:238] Patching pod { podinfo-7fcd7db55-     0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[app:podinfo pod-template-hash:7fcd7db55] map[kubernetes.io/psp:eks.privileged prometheus.io/scrape:true] [{apps/v1 ReplicaSet podinfo-7fcd7db55 7974861e-e4e9-11e9-9771-0657df3da4b0 0xc0004977e7 0xc0004977e8}] nil []  []}

Fix: #3
Fix: #2

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stefanprodan stefanprodan changed the title Add App Mesh controller chart Add App Mesh controller and injector charts Oct 2, 2019
@stefanprodan
Copy link
Collaborator Author

@nckturner this is ready for review

Copy link
Contributor

@nckturner nckturner left a comment

Choose a reason for hiding this comment

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

Awesome! This is going to be a huge improvement for installation.

Comment on lines +33 to +38
```sh
helm upgrade -i appmesh-inject eks/appmesh-inject \
--namespace appmesh-system \
--set mesh.create=true \
--set mesh.name=global
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Below this block, maybe we can have a note about upgrading the existing installation before the helm chart existed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: meshes.appmesh.k8s.aws
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if there was a way to not have to define these both in the controller package and the helm chart, but I feel like we should keep them in both places for now, for non helm users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The CRDs in the controller repo should be for development purpose only. The App Mesh users should use the CRDs from this repo as it doesn't require Helm to install them.

{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
Copy link
Contributor

Choose a reason for hiding this comment

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

According to the helm docs:

Release.Service: The name of the releasing service (always Tiller).

Is it different in helm V3? Should we only set this if .Release.Service itself is set?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've used the Helm v3 template when creating these charts, the .Release.Service is handled by v3 like this app.kubernetes.io/managed-by: Helm.

Comment on lines +51 to +54
{{- if .Values.serviceAccount.create -}}
{{ default (include "appmesh-controller.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that if .Values.serviceAccount.create is specified, then we fallback on the appmesh-controller.fullname, but otherwise we fallback on the default service account? So .Values.serviceAccount.name can either refer to a service account that helm creates, or an existing service account, correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this allows a user to specify an existing service account and combined with rbac.create=false you can have full control over what the App Mesh controllers can do.

Install the App Mesh CRD controller:

```sh
helm upgrade -i appmesh-controller eks/appmesh-controller --namespace appmesh-system
Copy link
Contributor

Choose a reason for hiding this comment

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

So is namespace expected to always be passed? Can we add a default namespace?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The default namespace is default same as with kubectl. Helm v3 doesn't support namespace definitions and that's a good thing :) it uses the kubectl context for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI for Helm charts App Mesh charts
2 participants