Move terraform and kubernetes folder to be under proxy (#127)

* Move terraform and kubernetes folder to be under proxy

There is no reason for them to be under proxy/src/... any more now that
we have a Gradle-idiomatic folder structure.
This commit is contained in:
Lai Jiang 2019-06-20 14:28:32 -04:00 committed by GitHub
parent 96f7217ed2
commit 684bb119db
30 changed files with 8 additions and 17 deletions

View file

@ -103,13 +103,13 @@ $ gcloud auth application-default login
Login with the account that has "Project Owner" role of all three projects Login with the account that has "Project Owner" role of all three projects
mentioned above. mentioned above.
Navigate to `java/google/registry/proxy/terraform`, create a folder called Navigate to `proxy/terraform`, create a folder called
`envs`, and inside it, create a folder for the environment that proxy is `envs`, and inside it, create a folder for the environment that proxy is
deployed to ("alpha" for example). Copy `example_config.tf` to the environment deployed to ("alpha" for example). Copy `example_config.tf` to the environment
folder. folder.
```bash ```bash
$ cd java/google/registry/proxy/terraform $ cd proxy/terraform
$ mkdir -p envs/alpha $ mkdir -p envs/alpha
$ cp example_config.tf envs/alpha/config.tf $ cp example_config.tf envs/alpha/config.tf
``` ```
@ -232,11 +232,11 @@ $ gcloud container clusters get-credentials --project <proxy-project> \
# Deploys environment specific kubernetes objects. # Deploys environment specific kubernetes objects.
$ kubectl create -f \ $ kubectl create -f \
java/google/registry/proxy/kubernetes/proxy-deployment-<env>.yaml proxy/kubernetes/proxy-deployment-<env>.yaml
# Deploys shared kubernetes objects. # Deploys shared kubernetes objects.
$ kubectl create -f \ $ kubectl create -f \
java/google/registry/proxy/kubernetes/proxy-service.yaml proxy/kubernetes/proxy-service.yaml
``` ```
Repeat this for all three clusters. Repeat this for all three clusters.
@ -535,7 +535,7 @@ Use `kubectl` to create the deployment and autoscale objects:
```bash ```bash
$ kubectl create -f \ $ kubectl create -f \
java/google/registry/proxy/kubernetes/proxy-deployment-alpha.yaml proxy/kubernetes/proxy-deployment-alpha.yaml
``` ```
The kubernetes The kubernetes
@ -608,7 +608,7 @@ To deploy the NodePort service:
```bash ```bash
$ kubectl create -f \ $ kubectl create -f \
java/google/registry/proxy/kubernetes/proxy-service.yaml proxy/kubernetes/proxy-service.yaml
``` ```
This service object will open up port 30000 (health check), 30001 (WHOIS) and This service object will open up port 30000 (health check), 30001 (WHOIS) and

View file

@ -1,14 +1,5 @@
apply plugin: 'java' apply plugin: 'java'
sourceSets {
main {
resources {
exclude "${javaDir}/terraform/"
exclude "${javaDir}/kubernetes/"
}
}
}
createUberJar('deployJar', 'proxy_server', 'google.registry.proxy.ProxyServer') createUberJar('deployJar', 'proxy_server', 'google.registry.proxy.ProxyServer')
project.build.dependsOn deployJar project.build.dependsOn deployJar

View file

@ -55,7 +55,7 @@ artifacts:
location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}' location: 'gs://${PROJECT_ID}-deploy/${TAG_NAME}'
# This cannot be regexs because of how Spinnaker constructs artifact paths. # This cannot be regexs because of how Spinnaker constructs artifact paths.
paths: paths:
- 'proxy/src/main/java/google/registry/proxy/kubernetes/proxy-*.yaml' - 'proxy/kubernetes/proxy-*.yaml'
- 'release/cloudbuild-tag.yaml' - 'release/cloudbuild-tag.yaml'
timeout: 3600s timeout: 3600s
options: options:

View file

@ -75,7 +75,7 @@ steps:
sed -i s%distroless/java%${PROJECT_ID}/base@$base_digest% proxy/Dockerfile sed -i s%distroless/java%${PROJECT_ID}/base@$base_digest% proxy/Dockerfile
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-proxy.yaml sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-proxy.yaml
sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-nomulus.yaml sed -i s/builder:latest/builder@$builder_digest/g release/cloudbuild-nomulus.yaml
sed -i s/GCP_PROJECT/${PROJECT_ID}/ proxy/src/main/java/google/registry/proxy/kubernetes/proxy-*.yaml sed -i s/GCP_PROJECT/${PROJECT_ID}/ proxy/kubernetes/proxy-*.yaml
sed -i s/'$${TAG_NAME}'/${TAG_NAME}/g release/cloudbuild-sync.yaml sed -i s/'$${TAG_NAME}'/${TAG_NAME}/g release/cloudbuild-sync.yaml
# Upload the gradle binary to GCS if it does not exist and point URL in gradle wrapper to it. # Upload the gradle binary to GCS if it does not exist and point URL in gradle wrapper to it.
- name: 'gcr.io/cloud-builders/gsutil' - name: 'gcr.io/cloud-builders/gsutil'