cmd/tip: add staging deployment configuration
We want to be able to test cmd/tip changes on staging before pushing
to production. This change adds configuration files to be used for
the staging environment.
Mirror the production environment, but use a staging-specific load
balancer IP, domain, and autocert GCS bucket (golang-tip-dev-autocert).
Also rename the existing production configuration files to mirror the
pattern in other directories. This is especially important now that
there are both production and staging configuration files.
Updates golang/go#30232
Change-Id: I11c8cf643654d2c5bfa4add50f9ac8ca6771606b
Reviewed-on: https://go-review.googlesource.com/c/162914
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/tip/tip-prod.yaml b/cmd/tip/deployment-prod.yaml
similarity index 100%
rename from cmd/tip/tip-prod.yaml
rename to cmd/tip/deployment-prod.yaml
diff --git a/cmd/tip/deployment-staging.yaml b/cmd/tip/deployment-staging.yaml
new file mode 100644
index 0000000..16b4543
--- /dev/null
+++ b/cmd/tip/deployment-staging.yaml
@@ -0,0 +1,38 @@
+apiVersion: extensions/v1beta1
+kind: Deployment
+metadata:
+ name: tipgodoc-deployment
+spec:
+ replicas: 1
+ template:
+ metadata:
+ name: tipgodoc
+ labels:
+ app: tipgodoc
+ spec:
+ volumes:
+ - name: cache-volume
+ emptyDir: {}
+ containers:
+ - name: tipgodoc
+ image: gcr.io/go-dashboard-dev/tip:latest
+ imagePullPolicy: Always
+ command: ["/go/bin/tip", "--autocert=tip-staging.golang.org", "--autocert-bucket=golang-tip-dev-autocert"]
+ env:
+ - name: TMPDIR
+ value: /build
+ - name: TIP_BUILDER
+ value: godoc
+ volumeMounts:
+ - mountPath: /build
+ name: cache-volume
+ ports:
+ - containerPort: 8080
+ - containerPort: 443
+ resources:
+ requests:
+ cpu: "1"
+ memory: "4Gi"
+ limits:
+ cpu: "2"
+ memory: "8Gi"
diff --git a/cmd/tip/tip-service.yaml b/cmd/tip/service-prod.yaml
similarity index 100%
rename from cmd/tip/tip-service.yaml
rename to cmd/tip/service-prod.yaml
diff --git a/cmd/tip/service-staging.yaml b/cmd/tip/service-staging.yaml
new file mode 100644
index 0000000..c9434fa
--- /dev/null
+++ b/cmd/tip/service-staging.yaml
@@ -0,0 +1,16 @@
+apiVersion: v1
+kind: Service
+metadata:
+ name: tipgodoc
+spec:
+ ports:
+ - port: 80
+ targetPort: 8080
+ name: http
+ - port: 443
+ targetPort: 443
+ name: https
+ selector:
+ app: tipgodoc
+ type: LoadBalancer
+ loadBalancerIP: 35.192.124.190