This is an automated email from the ASF dual-hosted git repository.

damondouglas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new a0004b33e56 Provision a redis cluster on Kubernetes (#27409)
a0004b33e56 is described below

commit a0004b33e56308256f8f82304410462c03181d86
Author: Damon <damondoug...@users.noreply.github.com>
AuthorDate: Mon Jul 10 21:02:17 2023 -0700

    Provision a redis cluster on Kubernetes (#27409)
---
 .../03.io/api-overuse-study/02.redis/README.md     | 46 ++++++++++++++++++++++
 .../03.io/api-overuse-study/02.redis/common.tfvars | 19 +++++++++
 .../03.io/api-overuse-study/02.redis/data.tf       | 24 +++++++++++
 .../03.io/api-overuse-study/02.redis/provider.tf   | 27 +++++++++++++
 .../03.io/api-overuse-study/02.redis/redis.tf      | 35 ++++++++++++++++
 .../03.io/api-overuse-study/02.redis/variables.tf  | 22 +++++++++++
 6 files changed, 173 insertions(+)

diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/README.md
 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/README.md
new file mode 100644
index 00000000000..9ea3a98ee77
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/README.md
@@ -0,0 +1,46 @@
+<!--
+    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.
+-->
+
+# Overview
+
+This directory provisions a redis cluster in Kubernetes.
+
+# Usage
+
+Follow terraform workflow convention to apply this module. It assumes the
+working directory is at
+[.test-infra/pipelines/infrastructure/03.io/api-overuse-study](..).
+
+## Terraform Init
+
+Initialize the terraform workspace.
+
+```
+DIR=02.redis
+terraform -chdir=$DIR init
+```
+
+## Terraform Apply
+
+Apply the terraform module.
+
+```
+DIR=02.redis
+terraform -chdir=$DIR apply -var-file=common.tfvars
+```
\ No newline at end of file
diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/common.tfvars
 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/common.tfvars
new file mode 100644
index 00000000000..f71b496b5a2
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/common.tfvars
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
+namespace = "api-overuse-study"
\ No newline at end of file
diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/data.tf 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/data.tf
new file mode 100644
index 00000000000..32cb7434d30
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/data.tf
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+// Query the Kubernetes namespace to verify existence.
+data "kubernetes_namespace" "default" {
+  metadata {
+    name = var.namespace
+  }
+}
\ No newline at end of file
diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/provider.tf
 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/provider.tf
new file mode 100644
index 00000000000..20bdbac74ea
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/provider.tf
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+provider "kubernetes" {
+  config_path = "~/.kube/config"
+}
+
+provider "helm" {
+  kubernetes {
+    config_path = "~/.kube/config"
+  }
+}
\ No newline at end of file
diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/redis.tf
 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/redis.tf
new file mode 100644
index 00000000000..93b74a28782
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/redis.tf
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+// Spin up a Redis cluster within the Kubernetes cluster using the bitami
+// helm chart.
+resource "helm_release" "redis" {
+  wait       = false
+  repository = "https://charts.bitnami.com/bitnami";
+  chart      = "redis"
+  name       = "redis"
+  namespace  = data.kubernetes_namespace.default.metadata[0].name
+  set {
+    name  = "auth.enabled"
+    value = false
+  }
+  set {
+    name  = "auth.sentinel"
+    value = false
+  }
+}
\ No newline at end of file
diff --git 
a/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/variables.tf
 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/variables.tf
new file mode 100644
index 00000000000..b55ce279654
--- /dev/null
+++ 
b/.test-infra/pipelines/infrastructure/03.io/api-overuse-study/02.redis/variables.tf
@@ -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.
+ */
+
+variable "namespace" {
+  type        = string
+  description = "The Kubernetes namespace"
+}
\ No newline at end of file

Reply via email to