You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2022/12/06 00:09:22 UTC

[beam] branch master updated: [Playground] Healthcheck was added (#24227)

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

pabloem 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 60aba30e12d [Playground] Healthcheck was added (#24227)
60aba30e12d is described below

commit 60aba30e12d8235510f95c015459815a3a40b747
Author: MakarkinSAkvelon <67...@users.noreply.github.com>
AuthorDate: Tue Dec 6 05:09:13 2022 +0500

    [Playground] Healthcheck was added (#24227)
    
    * Healthcheck was added
    
    * Autoscaling
    
    * License information was added
    
    * Move healthcheck vars to value.yaml
    
    * remove unused values
    
    * Resources limits were corrected
    
    Co-authored-by: Sergey Makarkin <se...@akvelon.com>
---
 .../autoscaling-frontend.yaml}                     | 30 +++++++++-------------
 .../{values.yaml => templates/autoscaling-go.yaml} | 30 +++++++++-------------
 .../autoscaling-java.yaml}                         | 30 +++++++++-------------
 .../autoscaling-python.yaml}                       | 30 +++++++++-------------
 .../autoscaling-router.yaml}                       | 30 +++++++++-------------
 .../autoscaling-scio.yaml}                         | 30 +++++++++-------------
 .../templates/deployment-frontend.yml              | 19 ++++++++++++++
 .../helm-playground/templates/deployment-go.yml    | 21 +++++++++++++++
 .../helm-playground/templates/deployment-java.yml  | 21 +++++++++++++++
 .../templates/deployment-python.yml                | 21 +++++++++++++++
 .../templates/deployment-router.yml                | 21 +++++++++++++++
 .../helm-playground/templates/deployment-scio.yml  | 21 +++++++++++++++
 .../infrastructure/helm-playground/values.yaml     | 11 ++++----
 13 files changed, 202 insertions(+), 113 deletions(-)

diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-frontend.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-frontend.yaml
index 96ee08fa7c0..6fc40394330 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-frontend.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-frontend
+spec:
+  maxReplicas: 10
+  minReplicas: 1
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-frontend
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-go.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-go.yaml
index 96ee08fa7c0..81a28e2d59a 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-go.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-go
+spec:
+  maxReplicas: 10
+  minReplicas: 1
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-go
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-java.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-java.yaml
index 96ee08fa7c0..7784c0432eb 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-java.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-java
+spec:
+  maxReplicas: 10
+  minReplicas: 2
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-java
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-python.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-python.yaml
index 96ee08fa7c0..a4d96a7d035 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-python.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-python
+spec:
+  maxReplicas: 10
+  minReplicas: 1
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-python
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-router.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-router.yaml
index 96ee08fa7c0..b13edbdf8af 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-router.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-router
+spec:
+  maxReplicas: 10
+  minReplicas: 1
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-router
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/templates/autoscaling-scio.yaml
similarity index 62%
copy from playground/infrastructure/helm-playground/values.yaml
copy to playground/infrastructure/helm-playground/templates/autoscaling-scio.yaml
index 96ee08fa7c0..ad370c7fa19 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/templates/autoscaling-scio.yaml
@@ -12,21 +12,15 @@
 # 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.
-replicaCount: 1
-image:
-   java_image: beam_playground-backend-java
-   go_image: beam_playground-backend-go
-   router_image: beam_playground-backend-router
-   scio_image: beam_playground-backend-scio
-   python_image: beam_playground-backend-python
-   frontend_image: beam_playground-frontend 
-   pullPolicy: Always
-service:
-   type: NodePort
-   targetPort: 8080
-   port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+apiVersion: autoscaling/v1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: playground-scio
+spec:
+  maxReplicas: 10
+  minReplicas: 1
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: playground-scio
+  targetCPUUtilizationPercentage: 90
diff --git a/playground/infrastructure/helm-playground/templates/deployment-frontend.yml b/playground/infrastructure/helm-playground/templates/deployment-frontend.yml
index 35bbf74d987..2da99734187 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-frontend.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-frontend.yml
@@ -34,6 +34,25 @@ spec:
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        ports:
         - containerPort: 8080
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "50Mi"
+           cpu: "250m"
+         limits:
+           cpu: "500"
+           memory: "500Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/templates/deployment-go.yml b/playground/infrastructure/helm-playground/templates/deployment-go.yml
index 931b8e7fa6d..f592c180146 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-go.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-go.yml
@@ -39,6 +39,27 @@ spec:
            value: "remote"
          - name: CACHE_ADDRESS
            value: {{ .Values.redis_ip }}
+         - name: NUM_PARALLEL_JOBS
+           value: "5"
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "1000Mi"
+           cpu: "250m"
+         limits: 
+           cpu: "500"
+           memory: "500Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/templates/deployment-java.yml b/playground/infrastructure/helm-playground/templates/deployment-java.yml
index d27e6f79e98..94749e77467 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-java.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-java.yml
@@ -38,6 +38,27 @@ spec:
            value: "remote"
          - name: CACHE_ADDRESS
            value: {{ .Values.redis_ip }}
+         - name: NUM_PARALLEL_JOBS
+           value: "5"
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "1000Mi"
+           cpu: "500m"
+         limits:
+           cpu: "1000"
+           memory: "1500Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/templates/deployment-python.yml b/playground/infrastructure/helm-playground/templates/deployment-python.yml
index fa99891afbb..a884630c4aa 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-python.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-python.yml
@@ -38,6 +38,27 @@ spec:
           value: "remote"
         - name: CACHE_ADDRESS
           value: {{ .Values.redis_ip }}
+        - name: NUM_PARALLEL_JOBS
+          value: "5"
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "1000Mi"
+           cpu: "250m"
+         limits:
+           cpu: "500"
+           memory: "1000Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/templates/deployment-router.yml b/playground/infrastructure/helm-playground/templates/deployment-router.yml
index 7c1ad440a3d..ad826240125 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-router.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-router.yml
@@ -40,6 +40,27 @@ spec:
            value: "remote"
          - name: CACHE_ADDRESS
            value: {{ .Values.redis_ip }}
+         - name: NUM_PARALLEL_JOBS
+           value: "5"
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "50Mi"
+           cpu: "250m"
+         limits:
+           cpu: "500"
+           memory: "500Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/templates/deployment-scio.yml b/playground/infrastructure/helm-playground/templates/deployment-scio.yml
index 40defce0d69..ee2c6e15e64 100644
--- a/playground/infrastructure/helm-playground/templates/deployment-scio.yml
+++ b/playground/infrastructure/helm-playground/templates/deployment-scio.yml
@@ -37,6 +37,27 @@ spec:
          value: "remote"
        - name: CACHE_ADDRESS
          value: {{ .Values.redis_ip }}
+       - name: NUM_PARALLEL_JOBS
+         value: "5"
+       livenessProbe:
+         httpGet:
+           path: /liveness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.livInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.livPeriodSeconds }}
+       readinessProbe:
+         httpGet:
+           path: /readiness
+           port: {{ .Value.healthcheck.port }}
+         initialDelaySeconds: {{ .Value.healthcheck.readInitialDelaySeconds }}
+         periodSeconds: {{ .Value.healthcheck.readPeriodSeconds }}
+       resources:
+         requests:
+           memory: "1000Mi"
+           cpu: "500m"
+         limits:
+           cpu: "1000"
+           memory: "500Mi"
   replicas: {{ .Values.replicaCount  }}
   selector:
     matchLabels:
diff --git a/playground/infrastructure/helm-playground/values.yaml b/playground/infrastructure/helm-playground/values.yaml
index 96ee08fa7c0..81fae537345 100644
--- a/playground/infrastructure/helm-playground/values.yaml
+++ b/playground/infrastructure/helm-playground/values.yaml
@@ -25,8 +25,9 @@ service:
    type: NodePort
    targetPort: 8080
    port: 443
-autoscaling:
-   enabled: false
-   minReplicas: 1
-   maxReplicas: 4
-   targetCPUUtilizationPercentage: 80
\ No newline at end of file
+healthcheck:
+   port: 8080
+   livInitialDelaySeconds: 30
+   livPeriodSeconds: 30
+   readInitialDelaySeconds: 30
+   readPeriodSeconds: 30
\ No newline at end of file