-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infrastructure-as-Code deploys API & dependencies (#29155)
- Loading branch information
1 parent
388fc39
commit a256080
Showing
27 changed files
with
914 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.test-infra/mock-apis/infrastructure/kubernetes/echo/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the Echo Service ConfigMap. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/echo/main.go | ||
# for details on the Echo service executable and | ||
# https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/internal/environment/variable.go | ||
# for details on various environment variables. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: echo | ||
data: | ||
HTTP_PORT: "8080" | ||
GRPC_PORT: "50051" | ||
# See .test-infra/mock-apis/infrastructure/kubernetes/redis | ||
CACHE_HOST: redis-master.default.svc.cluster.local:6379 |
48 changes: 48 additions & 0 deletions
48
.test-infra/mock-apis/infrastructure/kubernetes/echo/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the Echo Deployment on the Kubernetes cluster. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/echo/main.go | ||
# for details on the Echo service executable. | ||
# Assumes usage of https://ko.build/ to resolve the manifest: | ||
# export KO_DOCKER_REPO=<location>-docker.pkg.dev/<project>/<repository> | ||
# kubectl kustomize .test-infra/mock-apis/infrastructure/echo | ko resolve -f - | kubectl apply -f - | ||
# See .test-infra/mock-apis/README.md for details | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echo | ||
labels: | ||
app: echo | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: echo | ||
template: | ||
metadata: | ||
labels: | ||
app: echo | ||
spec: | ||
containers: | ||
- name: echo | ||
# Prefixed with ko:// to resolve with the ko utility. | ||
# See https://ko.build/features/k8s/ for details. | ||
image: ko://github.com/apache/beam/test-infra/mock-apis/src/main/go/cmd/service/echo | ||
imagePullPolicy: IfNotPresent | ||
envFrom: | ||
- configMapRef: | ||
name: echo |
23 changes: 23 additions & 0 deletions
23
.test-infra/mock-apis/infrastructure/kubernetes/echo/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the provisioning of the Echo service on the Kubernetes cluster. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/echo/main.go | ||
# for details on the Echo service executable. | ||
|
||
resources: | ||
- configmap.yaml | ||
- deployment.yaml | ||
- service.yaml |
42 changes: 42 additions & 0 deletions
42
.test-infra/mock-apis/infrastructure/kubernetes/echo/service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the provisioning of the Echo Service on the Kubernetes cluster. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/echo/main.go | ||
# for details on the Echo service executable. | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: echo | ||
annotations: | ||
# Configures the LoadBalancer to assign an internal private IP | ||
# instead of an external private IP. | ||
# See https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing | ||
networking.gke.io/load-balancer-type: "Internal" | ||
spec: | ||
type: LoadBalancer | ||
externalTrafficPolicy: Cluster | ||
selector: | ||
app: echo | ||
# Ports must match the environment variables assigned in the ConfigMap/echo. | ||
# See configmap.yaml. | ||
ports: | ||
- port: 50051 | ||
name: grpc | ||
targetPort: 50051 | ||
- port: 8080 | ||
name: http | ||
targetPort: 8080 |
22 changes: 22 additions & 0 deletions
22
.test-infra/mock-apis/infrastructure/kubernetes/redis/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures a Redis instance using https://bitnami.com/stack/redis/helm. | ||
helmCharts: | ||
- name: redis | ||
releaseName: redis | ||
repo: https://charts.bitnami.com/bitnami | ||
version: 18.1.5 | ||
valuesFile: redis-values.yaml |
26 changes: 26 additions & 0 deletions
26
.test-infra/mock-apis/infrastructure/kubernetes/redis/redis-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Assigns values to the https://bitnami.com/stack/redis/helm chart. | ||
auth: | ||
# The cluster is used for testing only in a private Google Kubernetes Engine | ||
# (GKE) cluster. So setting enabled to false delegates role based | ||
# access control to Google Cloud Identity and Access Management (IAM). | ||
enabled: false | ||
|
||
# We set sentinel to false, since we do not need high availability. | ||
# See https://developer.redis.com/operate/redis-at-scale/high-availability/understanding-sentinels/ | ||
# for more details on the sentinel mode. | ||
sentinel: false |
37 changes: 37 additions & 0 deletions
37
.test-infra/mock-apis/infrastructure/kubernetes/refresher/base/configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the Refresher ConfigMap. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/refresher/main.go | ||
# Designed for use with kustomize patch overlays. | ||
# See https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/ | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: refresher | ||
labels: | ||
app.kubernetes.io/name: refresher | ||
|
||
# targeted for overlay replacement | ||
quota-id: quota-id-value | ||
data: | ||
CACHE_HOST: redis-master.default.svc.cluster.local:6379 | ||
|
||
# targeted for overlay replacement | ||
QUOTA_ID: quota-id-value | ||
QUOTA_SIZE: "100" | ||
QUOTA_REFRESH_INTERVAL: "10s" | ||
|
54 changes: 54 additions & 0 deletions
54
.test-infra/mock-apis/infrastructure/kubernetes/refresher/base/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Configures the Refresher Deployment. | ||
# See https://github.com/apache/beam/blob/master/.test-infra/mock-apis/src/main/go/cmd/service/refresher/main.go | ||
# Designed for use with kustomize patch overlays. | ||
# See https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/ | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
# name created using kustomize nameSuffix as refresher-<quota-id-value> | ||
name: refresher | ||
|
||
labels: | ||
app.kubernetes.io/name: refresher | ||
|
||
# targeted for overlay replacement | ||
quota-id: quota-id-value | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: refresher | ||
|
||
# targeted for overlay replacement | ||
quota-id: quota-id-value | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: refresher | ||
|
||
# targeted for overlay replacement | ||
quota-id: quota-id-value | ||
spec: | ||
containers: | ||
- name: refresher | ||
image: ko://github.com/apache/beam/test-infra/mock-apis/src/main/go/cmd/service/refresher | ||
imagePullPolicy: IfNotPresent | ||
envFrom: | ||
- configMapRef: | ||
name: refresher |
Oops, something went wrong.