Skip to content

Commit

Permalink
Merge pull request #47 from fiji-flo/picture-api
Browse files Browse the repository at this point in the history
Add picture api domain and ingress.
  • Loading branch information
fiji-flo authored Aug 19, 2019
2 parents 8153f5c + fb0de9f commit 50f7b14
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 248 deletions.
468 changes: 223 additions & 245 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ nouid = []
[dependencies]
cis_client = { git = "https://github.com/fiji-flo/cis_client-rust", branch = "0.1.1", version = "0.1.1" }
cis_profile = { git = "https://github.com/fiji-flo/cis_profile-rust", branch = "0.1.1", version = "0.1.1", features = ["graphql", "aws", "vendored"] }
dino_park_gate = { git = "https://github.com/fiji-flo/dino-park-gate", branch = "future", version = "0.1.0-beta.3" }
dino_park_gate = { git = "https://github.com/fiji-flo/dino-park-gate", branch = "0.1.0-beta.4", version = "0.1.0-beta.4" }
actix-web = "1.0"
actix-cors = "0.1"
juniper = "0.13"
Expand Down
2 changes: 1 addition & 1 deletion ci/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME=/usr/local/cargo
export PATH=/usr/local/cargo/bin:$PATH
export RUST_VERSION=1.36.0
export RUST_VERSION=1.37.0

set -eux
dpkgArch="$(dpkg --print-architecture)"
Expand Down
29 changes: 29 additions & 0 deletions k8s/templates/ingress_pictures.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ if ne .Values.env "prod" }}
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pictures-ingress
namespace: {{ .Values.namespace }}
annotations:
kubernetes.io/ingress.class: "nginx-{{ .Values.namespace }}"
ingress.kubernetes.io/limit-rps: "100"
certmanager.k8s.io/cluster-issuer: letsencrypt-production
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true"
spec:
tls:
- hosts:
- {{ .Values.pictures_domain_name }}
secretName: pictures-secret
rules:
- host: {{ .Values.pictures_domain_name }}
http:
paths:
- path: /avatar/get/id/
backend:
serviceName: dino-park-fossil-service
servicePort: 80
{{ end }}
1 change: 1 addition & 0 deletions k8s/values/dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
env: dev
namespace: dinopark-dev
domain_name: dinopark.k8s.dev.sso.allizom.org
pictures_domain_name: picture.api.dev.sso.allizom.org
assume_role: arn:aws:iam::320464205386:role/dino-park-fence-role-dev-us-west-2
1 change: 1 addition & 0 deletions k8s/values/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ env: prod
namespace: dinopark-prod
domain_name: people.mozilla.org
secondary_domain_name: dinopark.k8s.sso.mozilla.com
pictures_domain_name: picture.api.sso.mozilla.com
assume_role: arn:aws:iam::320464205386:role/dino-park-fence-role-prod-us-west-2
replicas: 3
ingress_replicas: 5
1 change: 1 addition & 0 deletions k8s/values/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
env: test
namespace: dinopark-test
domain_name: dinopark.k8s.test.sso.allizom.org
pictures_domain_name: picture.api.test.sso.allizom.org
assume_role: arn:aws:iam::320464205386:role/dino-park-fence-role-test-us-west-2
2 changes: 1 addition & 1 deletion src/graphql_api/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn graphql<T: AsyncCisClientTrait + Send + Sync>(
data: Json<GraphQLRequest>,
state: Data<GraphQlState<T>>,
scope_and_user: ScopeAndUser,
) -> Box<Future<Item = HttpResponse, Error = Error>> {
) -> Box<dyn Future<Item = HttpResponse, Error = Error>> {
info!(
"graphql for {:?} → {:?}",
&scope_and_user.user_id, &scope_and_user.scope
Expand Down

0 comments on commit 50f7b14

Please sign in to comment.