mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Setup sandbox for GCP proxy
1) Clean up alpha config to only allow alpha proxy, removing test proxy client id. 2) Add sandbox service account client id to sandbox config. 3) Add sandbox config to nomulus and proxy, remove TEST environment, which is not being used anymore. (Test now uses LOCAL.) 4) Add sandbox kubenetes config ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=193400909
This commit is contained in:
@@ -25,9 +25,9 @@ public class ProxyConfig {
|
||||
enum Environment {
|
||||
PRODUCTION,
|
||||
SANDBOX,
|
||||
SANDBOX_CANARY,
|
||||
ALPHA,
|
||||
LOCAL,
|
||||
TEST,
|
||||
}
|
||||
|
||||
private static final String DEFAULT_CONFIG = "config/default-config.yaml";
|
||||
@@ -119,7 +119,8 @@ public class ProxyConfig {
|
||||
String defaultYaml = readResourceUtf8(ProxyConfig.class, DEFAULT_CONFIG);
|
||||
String customYaml =
|
||||
readResourceUtf8(
|
||||
ProxyConfig.class, String.format(CUSTOM_CONFIG_FORMATTER, env.name().toLowerCase()));
|
||||
ProxyConfig.class,
|
||||
String.format(CUSTOM_CONFIG_FORMATTER, env.name().toLowerCase().replace("_", "-")));
|
||||
return getConfigSettings(defaultYaml, customYaml, ProxyConfig.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# Add environment-specific proxy configuration here.
|
||||
@@ -0,0 +1,65 @@
|
||||
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", "sandbox_canary"]
|
||||
env:
|
||||
- name: POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: NAMESPACE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CONTAINER_NAME
|
||||
value: proxy-canary
|
||||
---
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
namespace: default
|
||||
name: proxy-autoscale-canary
|
||||
labels:
|
||||
app: proxy-canary
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
name: proxy-deployment-canary
|
||||
maxReplicas: 5
|
||||
minReplicas: 1
|
||||
@@ -0,0 +1,65 @@
|
||||
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", "sandbox"]
|
||||
env:
|
||||
- name: POD_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: NAMESPACE_ID
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: CONTAINER_NAME
|
||||
value: proxy
|
||||
---
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
namespace: default
|
||||
name: proxy-autoscale
|
||||
labels:
|
||||
app: proxy
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
name: proxy-deployment
|
||||
maxReplicas: 5
|
||||
minReplicas: 1
|
||||
@@ -0,0 +1,25 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
namespace: default
|
||||
name: proxy-service-canary
|
||||
spec:
|
||||
selector:
|
||||
app: proxy-canary
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 30000
|
||||
nodePort: 31000
|
||||
targetPort: health-check
|
||||
name: health-check
|
||||
- protocol: TCP
|
||||
port: 30001
|
||||
nodePort: 31001
|
||||
targetPort: whois
|
||||
name: whois
|
||||
- protocol: TCP
|
||||
port: 30002
|
||||
nodePort: 31002
|
||||
targetPort: epp
|
||||
name: epp
|
||||
type: NodePort
|
||||
Reference in New Issue
Block a user