Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ func (e *ProductionEnvImpl) Flags() map[string]string {
return map[string]string{
"v": "1",
"debug": "false",
"enable-mock": "false",
"enable-mock": "true",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this enable-mock is poorly named (mock for what?), but it's for the authz stub in the stack.

}
}
2 changes: 1 addition & 1 deletion components/ambient-api-server/plugins/projects/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (l ProjectList) Index() ProjectIndex {
}

func (d *Project) BeforeCreate(tx *gorm.DB) error {
d.ID = api.NewID()
d.ID = d.Name
return nil
}

Expand Down
16 changes: 16 additions & 0 deletions components/ambient-api-server/templates/route-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ objects:
tls:
termination: reencrypt
insecureEdgeTerminationPolicy: Redirect

- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server-grpc
labels:
app: ambient-api-server
spec:
to:
kind: Service
name: ambient-api-server-grpc
port:
targetPort: grpc
tls:
termination: reencrypt
insecureEdgeTerminationPolicy: Redirect
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ parameters:
- name: ENABLE_AUTHZ_MOCK
displayName: Enable Authz Mock
description: Enable mock authz client
value: "false"
value: "true"

- name: HTTP_READ_TIMEOUT
displayName: HTTP Read Timeout
Expand Down
17 changes: 17 additions & 0 deletions components/manifests/base/ambient-api-server-route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ spec:
name: ambient-api-server
port:
targetPort: api
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server-grpc
labels:
app: ambient-api-server
component: grpc
spec:
to:
kind: Service
name: ambient-api-server
port:
targetPort: grpc
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
14 changes: 11 additions & 3 deletions components/manifests/base/ambient-api-server-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@ spec:
- --db-max-open-connections=50
- --enable-db-debug=false
- --enable-metrics-https=false
- --enable-sentry=false
- --http-read-timeout=5s
- --http-write-timeout=30s
- --cors-allowed-origins=*
- --cors-allowed-headers=X-Ambient-Project
- --enable-grpc=true
- --grpc-server-bindaddress=:9000
- --alsologtostderr
- -v=10
env:
- name: OCM_ENV
- name: AMBIENT_ENV
value: development
ports:
- name: api
Expand All @@ -97,6 +98,9 @@ spec:
- name: health
containerPort: 4434
protocol: TCP
- name: grpc
containerPort: 9000
protocol: TCP
volumeMounts:
- name: db-secrets
mountPath: /secrets/db
Expand All @@ -113,7 +117,7 @@ spec:
memory: 1Gi
livenessProbe:
httpGet:
path: /api/ambient-api-server
path: /api/ambient
port: 8000
scheme: HTTP
initialDelaySeconds: 15
Expand Down Expand Up @@ -164,6 +168,10 @@ spec:
port: 8000
targetPort: 8000
protocol: TCP
- name: grpc
port: 9000
targetPort: 9000
protocol: TCP
- name: metrics
port: 4433
targetPort: 4433
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ spec:
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server-grpc
labels:
app: ambient-api-server
component: grpc
spec:
to:
kind: Service
name: ambient-api-server
port:
targetPort: grpc
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ spec:
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server-grpc
labels:
app: ambient-api-server
component: grpc
spec:
to:
kind: Service
name: ambient-api-server
port:
targetPort: grpc
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect