Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit c75ff02

Browse files
committed
Run Go fmt and test in CI
1 parent dc42502 commit c75ff02

File tree

5 files changed

+57
-9
lines changed

5 files changed

+57
-9
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
name: CI
1+
name: build
22

33
on: [push, pull_request]
44

55
jobs:
6-
kustomize:
6+
test:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v1
10-
- name: Validate manifests
10+
- name: Go fmt
11+
uses: stefanprodan/kube-tools@v1
12+
with:
13+
command: |
14+
make go-fmt
15+
- name: Go test
16+
uses: stefanprodan/kube-tools@v1
17+
with:
18+
command: |
19+
make test
20+
- name: Validate kustomization
1121
uses: stefanprodan/kube-tools@v1
1222
with:
1323
command: |
@@ -17,7 +27,7 @@ jobs:
1727
kustomize build ./kustomize/test | kubeval --strict --ignore-missing-schemas
1828
build:
1929
runs-on: ubuntu-latest
20-
needs: [kustomize]
30+
needs: [test]
2131
steps:
2232
- uses: actions/checkout@v1
2333
- name: Build container

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
name: PUSH
1+
name: release
22

3-
on: [push]
3+
on:
4+
push:
5+
branches-ignore:
6+
- '**'
7+
tags:
8+
- 'v*.*.*'
49

510
jobs:
611
push-container:

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ COPY . .
88

99
RUN go mod download
1010

11-
RUN go test -v -race ./...
12-
1311
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin/appmesh-gateway cmd/appmesh-gateway/*
1412

1513
FROM alpine:3.10

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ build:
1010
test:
1111
go test -v -race ./...
1212

13+
go-fmt:
14+
gofmt -l pkg/* | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi;
15+
1316
run:
1417
go run cmd/appmesh-gateway/*.go --kubeconfig=$$HOME/.kube/config -v=4 \
1518
--gateway-mesh=appmesh --gateway-name=gateway --gateway-namespace=appmesh-gateway

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# appmesh-gateway
2-
[![CI](https://github.com/stefanprodan/appmesh-gateway/workflows/CI/badge.svg)](https://github.com/stefanprodan/appmesh-gateway/actions)
2+
[![CI](https://github.com/stefanprodan/appmesh-gateway/workflows/build/badge.svg)](https://github.com/stefanprodan/appmesh-gateway/actions)
33
[![report](https://goreportcard.com/badge/github.com/stefanprodan/appmesh-gateway)](https://goreportcard.com/report/github.com/stefanprodan/appmesh-gateway)
44

55
App Mesh Gateway is an edge load balancer that exposes applications outside the mesh.
@@ -32,12 +32,35 @@ The gateway registers/de-registers virtual services automatically as they come a
3232
3333
### Install
3434
35+
Requirements:
36+
* App Mesh CRDs, controller and inject [installed](https://github.com/aws/eks-charts#app-mesh)
37+
* A mesh called `appmesh`
38+
3539
Install the API Gateway as NLB in `appmesh-gateway` namespace:
3640

3741
```sh
3842
kubectl apply -k github.com/stefanprodan/appmesh-gateway//kustomize/appmesh-gateway
3943
```
4044

45+
Wait for the deployment rollout to finish:
46+
47+
```sh
48+
kubectl -n appmesh-gateway rollout status deploy/appmesh-gateway
49+
```
50+
51+
When the gateway starts it will create a virtual node. You can verify the install with:
52+
53+
```text
54+
watch kubectl -n appmesh-gateway describe virtualnode appmesh-gateway
55+
56+
Status:
57+
Conditions:
58+
Status: True
59+
Type: VirtualNodeActive
60+
```
61+
62+
### Example
63+
4164
Deploy podinfo in the `test` namespace:
4265

4366
```sh
@@ -61,3 +84,12 @@ Access podinfo on its custom domain:
6184
```sh
6285
curl -vH 'Host: podinfo.internal' localhost:8080
6386
```
87+
88+
Access podinfo using the gateway NLB address:
89+
90+
```sh
91+
URL="http://$(kubectl -n appmesh-gateway get svc/appmesh-gateway -ojson | \
92+
jq -r ".status.loadBalancer.ingress[].hostname")"
93+
94+
curl -vH 'Host: podinfo.internal' $URL
95+
```

0 commit comments

Comments
 (0)