mirror of
https://github.com/google/nomulus
synced 2026-01-11 00:10:36 +00: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:
@@ -25,6 +25,7 @@ public class ProxyConfig {
|
||||
|
||||
enum Environment {
|
||||
PRODUCTION,
|
||||
PRODUCTION_CANARY,
|
||||
SANDBOX,
|
||||
SANDBOX_CANARY,
|
||||
ALPHA,
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ProxyModule {
|
||||
throw e;
|
||||
}
|
||||
checkArgument(
|
||||
!log || env != Environment.PRODUCTION,
|
||||
!log || (env != Environment.PRODUCTION && env != Environment.PRODUCTION_CANARY),
|
||||
"Logging cannot be enabled for production environment");
|
||||
configureLogging();
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user