Skip to content

Commit 8e97692

Browse files
authored
Merge pull request #130 from efe-selcuk/tls
Add support for ACM/File listener TLS, backend TLS client policies, backend defaults
2 parents 18bdf1e + fb5dd1e commit 8e97692

File tree

9 files changed

+1006
-74
lines changed

9 files changed

+1006
-74
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ image-release:
4444
push:
4545
ifeq ($(AWS_ACCOUNT),)
4646
$(error AWS_ACCOUNT is not set)
47+
endif
48+
ifeq ($(AWS_REGION),)
49+
$(error AWS_REGION is not set)
4750
endif
4851
docker tag $(IMAGE):$(DEV_VERSION) $(REPO):$(DEV_VERSION)
4952
docker push $(REPO):$(DEV_VERSION)

deploy/all.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,38 @@ spec:
143143
type: integer
144144
unhealthyThreshold:
145145
type: integer
146+
tls:
147+
type: object
148+
required:
149+
- mode
150+
- certificate
151+
properties:
152+
mode:
153+
type: string
154+
enum:
155+
- 'DISABLED'
156+
- 'PERMISSIVE'
157+
- 'STRICT'
158+
certificate:
159+
type: object
160+
properties:
161+
acm:
162+
type: object
163+
required:
164+
- certificateArn
165+
properties:
166+
certificateArn:
167+
type: string
168+
file:
169+
type: object
170+
required:
171+
- certificateChain
172+
- privateKey
173+
properties:
174+
certificateChain:
175+
type: string
176+
privateKey:
177+
type: string
146178
serviceDiscovery:
147179
type: object
148180
properties:
@@ -169,6 +201,85 @@ spec:
169201
properties:
170202
name:
171203
type: string
204+
clientPolicy:
205+
type: object
206+
properties:
207+
tls:
208+
type: object
209+
required:
210+
- validation
211+
properties:
212+
enforce:
213+
type: boolean
214+
ports:
215+
type: array
216+
items:
217+
type: integer
218+
validation:
219+
type: object
220+
required:
221+
- trust
222+
properties:
223+
trust:
224+
type: object
225+
properties:
226+
acm:
227+
type: object
228+
required:
229+
- certificateAuthorityArns
230+
properties:
231+
certificateAuthorityArns:
232+
type: array
233+
items:
234+
type: string
235+
file:
236+
type: object
237+
required:
238+
- certificateChain
239+
properties:
240+
certificateChain:
241+
type: string
242+
backendDefaults:
243+
type: object
244+
properties:
245+
clientPolicy:
246+
type: object
247+
properties:
248+
tls:
249+
type: object
250+
required:
251+
- validation
252+
properties:
253+
enforce:
254+
type: boolean
255+
ports:
256+
type: array
257+
items:
258+
type: integer
259+
validation:
260+
type: object
261+
required:
262+
- trust
263+
properties:
264+
trust:
265+
type: object
266+
properties:
267+
acm:
268+
type: object
269+
required:
270+
- certificateAuthorityArns
271+
properties:
272+
certificateAuthorityArns:
273+
type: array
274+
items:
275+
type: string
276+
file:
277+
type: object
278+
required:
279+
- certificateChain
280+
properties:
281+
certificateChain:
282+
type: string
172283
logging:
173284
type: object
174285
properties:

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/aws/aws-app-mesh-controller-for-k8s
33
go 1.13
44

55
require (
6-
github.com/aws/aws-sdk-go v1.25.19
6+
github.com/aws/aws-sdk-go v1.29.13
77
github.com/deckarep/golang-set v1.7.1
88
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
99
github.com/googleapis/gnostic v0.2.0 // indirect
@@ -14,10 +14,9 @@ require (
1414
github.com/spf13/pflag v1.0.5
1515
github.com/spf13/viper v1.3.2
1616
github.com/stretchr/objx v0.2.0 // indirect
17-
github.com/stretchr/testify v1.3.0
17+
github.com/stretchr/testify v1.4.0
1818
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5
19-
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 // indirect
20-
golang.org/x/tools v0.0.0-20190710153321-831012c29e42 // indirect
19+
golang.org/x/tools v0.0.0-20200212213342-7a21e308cf6c // indirect
2120
gopkg.in/inf.v0 v0.9.1 // indirect
2221
k8s.io/api v0.0.0-20191025225708-5524a3672fbb
2322
k8s.io/apimachinery v0.0.0-20191025225532-af6325b3a843

go.sum

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0
77
github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
88
github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
99
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
10-
github.com/aws/aws-sdk-go v1.25.19 h1:sp3xP91qIAVhWufyn9qM6Zhhn6kX06WJQcmhRj7QTXc=
11-
github.com/aws/aws-sdk-go v1.25.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
10+
github.com/aws/aws-sdk-go v1.29.13 h1:Y77U33nj5ic5hVxE6Th4LhZaw2rSwl3mXIm9OdmIs+k=
11+
github.com/aws/aws-sdk-go v1.29.13/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg=
1212
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
1313
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
1414
github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
@@ -37,6 +37,7 @@ github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+
3737
github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg=
3838
github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc=
3939
github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I=
40+
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
4041
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
4142
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I=
4243
github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
@@ -113,6 +114,7 @@ github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181
113114
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
114115
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
115116
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
117+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
116118
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
117119
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
118120
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -153,6 +155,8 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1
153155
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
154156
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
155157
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
158+
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
159+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
156160
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
157161
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5 h1:Xim2mBRFdXzXmKRO8DJg/FJtn/8Fj9NOEpO6+WuMPmk=
158162
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5/go.mod h1:ppEjwdhyy7Y31EnHRDm1JkChoC7LXIJ7Ex0VYLWtZtQ=
@@ -161,13 +165,15 @@ golang.org/x/crypto v0.0.0-20181025213731-e84da0312774 h1:a4tQYYYuK9QdeO/+kEvNYy
161165
golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
162166
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
163167
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
164-
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU=
165-
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
168+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
169+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
166170
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
167171
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk=
168172
golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
169173
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
170174
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
175+
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
176+
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
171177
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
172178
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
173179
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -180,11 +186,14 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwL
180186
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
181187
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA=
182188
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
189+
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
190+
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
183191
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA=
184192
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
185193
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
186194
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
187195
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
196+
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
188197
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
189198
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
190199
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -207,8 +216,10 @@ golang.org/x/tools v0.0.0-20181112210238-4b1f3b6b1646/go.mod h1:n7NCudcB/nEzxVGm
207216
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
208217
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
209218
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
210-
golang.org/x/tools v0.0.0-20190710153321-831012c29e42 h1:4IOeC7p+OItq3+O5BWkcmVu2uBe3jekXau5S4QZX9DU=
211-
golang.org/x/tools v0.0.0-20190710153321-831012c29e42/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
219+
golang.org/x/tools v0.0.0-20200212213342-7a21e308cf6c h1:D2X+P0Z6ychko7xn2jvd38yxQfdU0eksO4AHfd8AWFI=
220+
golang.org/x/tools v0.0.0-20200212213342-7a21e308cf6c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
221+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
222+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
212223
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw=
213224
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
214225
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=

pkg/apis/appmesh/v1beta1/types.go

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,17 @@ type VirtualNodeSpec struct {
352352
// +optional
353353
Backends []Backend `json:"backends,omitempty"`
354354
// +optional
355+
BackendDefaults *BackendDefaults `json:"backendDefaults,omitempty"`
356+
// +optional
355357
Logging *Logging `json:"logging,omitempty"`
356358
}
357359

358360
type Listener struct {
359361
PortMapping PortMapping `json:"portMapping"`
360362
// +optional
361363
HealthCheck *HealthCheckPolicy `json:"healthCheck,omitempty"`
364+
// +optional
365+
TLS *ListenerTls `json:"tls,omitempty"`
362366
}
363367

364368
type PortMapping struct {
@@ -412,8 +416,15 @@ type Backend struct {
412416
VirtualService VirtualServiceBackend `json:"virtualService"`
413417
}
414418

419+
type BackendDefaults struct {
420+
// +optional
421+
ClientPolicy *ClientPolicy `json:"clientPolicy,omitempty"`
422+
}
423+
415424
type VirtualServiceBackend struct {
416425
VirtualServiceName string `json:"virtualServiceName"`
426+
// +optional
427+
ClientPolicy *ClientPolicy `json:"clientPolicy,omitempty"`
417428
}
418429

419430
// Logging refers to https://docs.aws.amazon.com/app-mesh/latest/APIReference/API_Logging.html
@@ -453,6 +464,71 @@ type CloudMapServiceStatus struct {
453464
NamespaceID *string `json:"namespaceId,omitempty"`
454465
}
455466

467+
// General TLS Types
468+
469+
type TlsValidationContext struct {
470+
Trust TlsValidationContextTrust `json:"trust"`
471+
}
472+
473+
type TlsValidationContextTrust struct {
474+
// +optional
475+
ACM *TlsValidationContextAcmTrust `json:"acm,omitempty"`
476+
// +optional
477+
File *TlsValidationContextFileTrust `json:"file,omitempty"`
478+
}
479+
480+
type TlsValidationContextAcmTrust struct {
481+
CertificateAuthorityArns []string `json:"certificateAuthorityArns"`
482+
}
483+
484+
type TlsValidationContextFileTrust struct {
485+
CertificateChain string `json:"certificateChain"`
486+
}
487+
488+
// END General TLS Types
489+
490+
// Listener TLS Types
491+
492+
type ListenerTls struct {
493+
Mode string `json:"mode"`
494+
Certificate ListenerTlsCertificate `json:"certificate"`
495+
}
496+
497+
type ListenerTlsCertificate struct {
498+
// +optional
499+
ACM *ListenerTlsAcmCertificate `json:"acm,omitempty"`
500+
// +optional
501+
File *ListenerTlsFileCertificate `json:"file,omitempty"`
502+
}
503+
504+
type ListenerTlsAcmCertificate struct {
505+
CertificateArn string `json:"certificateArn"`
506+
}
507+
508+
type ListenerTlsFileCertificate struct {
509+
CertificateChain string `json:"certificateChain"`
510+
PrivateKey string `json:"privateKey"`
511+
}
512+
513+
// END Listener TLS Types
514+
515+
// Client Policy Types
516+
517+
type ClientPolicy struct {
518+
// +optional
519+
TLS *ClientPolicyTls `json:"tls,omitempty"`
520+
}
521+
522+
type ClientPolicyTls struct {
523+
// +optional
524+
Enforce *bool `json:"enforce,omitempty"`
525+
// +optional
526+
Ports []int64 `json:"ports,omitempty"`
527+
Validation TlsValidationContext `json:"validation"`
528+
}
529+
530+
// END Client Policy Types
531+
456532
type VirtualNodeConditionType string
457533

458534
const (

0 commit comments

Comments
 (0)