mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Add configs for production GCP proxy
This also introduces a production canary environment, similar to sandbox canary. The docker tags are changed to "live" and "sandbox" respectively, to reflect the fact that different images may be used for prod and sandbox. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=204343530
This commit is contained in:
parent
a00cb2237a
commit
35110927d6
5 changed files with 105 additions and 1 deletions
|
@ -25,6 +25,7 @@ public class ProxyConfig {
|
||||||
|
|
||||||
enum Environment {
|
enum Environment {
|
||||||
PRODUCTION,
|
PRODUCTION,
|
||||||
|
PRODUCTION_CANARY,
|
||||||
SANDBOX,
|
SANDBOX,
|
||||||
SANDBOX_CANARY,
|
SANDBOX_CANARY,
|
||||||
ALPHA,
|
ALPHA,
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class ProxyModule {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
checkArgument(
|
checkArgument(
|
||||||
!log || env != Environment.PRODUCTION,
|
!log || (env != Environment.PRODUCTION && env != Environment.PRODUCTION_CANARY),
|
||||||
"Logging cannot be enabled for production environment");
|
"Logging cannot be enabled for production environment");
|
||||||
configureLogging();
|
configureLogging();
|
||||||
return this;
|
return this;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
# Add environment-specific proxy configuration here.
|
|
@ -0,0 +1,51 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
namespace: default
|
||||||
|
name: proxy-deployment-canary
|
||||||
|
labels:
|
||||||
|
app: proxy-canary
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: proxy-canary
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: proxy-canary
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: proxy-canary
|
||||||
|
image: gcr.io/GCP_PROJECT/IMAGE_NAME:bazel
|
||||||
|
ports:
|
||||||
|
- containerPort: 30000
|
||||||
|
name: health-check
|
||||||
|
- containerPort: 30001
|
||||||
|
name: whois
|
||||||
|
- containerPort: 30002
|
||||||
|
name: epp
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: health-check
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: health-check
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 20
|
||||||
|
imagePullPolicy: Always
|
||||||
|
args: ["--env", "production_canary"]
|
||||||
|
env:
|
||||||
|
- name: POD_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: NAMESPACE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
|
- name: CONTAINER_NAME
|
||||||
|
value: proxy-canary
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
namespace: default
|
||||||
|
name: proxy-deployment
|
||||||
|
labels:
|
||||||
|
app: proxy
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: proxy
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: proxy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: proxy
|
||||||
|
image: gcr.io/GCP_PROJECT/IMAGE_NAME:bazel
|
||||||
|
ports:
|
||||||
|
- containerPort: 30000
|
||||||
|
name: health-check
|
||||||
|
- containerPort: 30001
|
||||||
|
name: whois
|
||||||
|
- containerPort: 30002
|
||||||
|
name: epp
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: health-check
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: health-check
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 20
|
||||||
|
imagePullPolicy: Always
|
||||||
|
args: ["--env", "production"]
|
||||||
|
env:
|
||||||
|
- name: POD_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: NAMESPACE_ID
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.namespace
|
||||||
|
- name: CONTAINER_NAME
|
||||||
|
value: proxy
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue