From 518ef1e3126c03782ca87a87091bc490f7b00a5d Mon Sep 17 00:00:00 2001 From: Rintaro Okamura Date: Thu, 25 Feb 2021 12:32:36 +0900 Subject: [PATCH] :arrow_up: Upgrade Operator SDK version to v1.4.2 Signed-off-by: Rintaro Okamura --- .../templates/operator.yaml | 32 ++++++++- charts/vald-helm-operator/values.schema.json | 2 +- charts/vald-helm-operator/values.yaml | 68 +++++++++++++++++++ versions/OPERATOR_SDK_VERSION | 2 +- 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/charts/vald-helm-operator/templates/operator.yaml b/charts/vald-helm-operator/templates/operator.yaml index e9d7e0d3bd4..ec1d8f0b830 100644 --- a/charts/vald-helm-operator/templates/operator.yaml +++ b/charts/vald-helm-operator/templates/operator.yaml @@ -63,17 +63,45 @@ spec: {{- if .Values.enableMetrics }} - "--metrics-addr=:{{ .Values.metricsPort }}" {{- end }} + - "--health-probe-bind-address=:{{ .Values.healthPort }}" - "--reconcile-period={{ .Values.reconcilePeriod }}" - "--max-concurrent-reconciles={{ .Values.maxConcurrentReconciles }}" - "--zap-encoder={{ .Values.logging.format }}" - "--zap-log-level={{ .Values.logging.level }}" - "--zap-stacktrace-level={{ .Values.logging.stacktraceLevel }}" - {{- if .Values.enableMetrics }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: {{ .Values.livenessProbe.httpGet.path }} + port: {{ .Values.livenessProbe.httpGet.port }} + scheme: {{ .Values.livenessProbe.httpGet.scheme }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: {{ .Values.readinessProbe.httpGet.path }} + port: {{ .Values.readinessProbe.httpGet.port }} + scheme: {{ .Values.readinessProbe.httpGet.scheme }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + {{- end }} ports: + - name: health + protocol: TCP + containerPort: {{ .Values.healthPort }} + {{- if .Values.enableMetrics }} - name: prometheus protocol: TCP containerPort: {{ .Values.metricsPort }} - {{- end }} + {{- end }} env: - name: POD_NAME valueFrom: diff --git a/charts/vald-helm-operator/values.schema.json b/charts/vald-helm-operator/values.schema.json index 63984eacbbc..dd4e6175ae9 100644 --- a/charts/vald-helm-operator/values.schema.json +++ b/charts/vald-helm-operator/values.schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft-07/schema#","title":"Values","type":"object","properties":{"affinity":{"type":"object"},"annotations":{"type":"object"},"enableLeaderElection":{"type":"boolean"},"enableMetrics":{"type":"boolean"},"image":{"type":"object","properties":{"pullPolicy":{"type":"string","enum":["Always","Never","IfNotPresent"]},"repository":{"type":"string"},"tag":{"type":"string"}}},"leaderElectionID":{"type":"string"},"logging":{"type":"object","properties":{"format":{"type":"string","enum":["console","json"]},"level":{"type":"string","enum":["debug","info","error"]},"stacktraceLevel":{"type":"string","enum":["debug","info","error"]}}},"maxConcurrentReconciles":{"type":"integer"},"metricsPort":{"type":"integer"},"name":{"type":"string"},"namespaced":{"type":"boolean"},"nodeSelector":{"type":"object"},"podAnnotations":{"type":"object"},"rbac":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"reconcilePeriod":{"type":"string"},"replicas":{"type":"integer"},"resources":{"type":"object"},"service":{"type":"object","properties":{"annotations":{"type":"object"},"enabled":{"type":"boolean"},"externalTrafficPolicy":{"type":"string"},"labels":{"type":"object"},"type":{"type":"string","enum":["ClusterIP","LoadBalancer","NodePort"]}}},"serviceAccount":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"tolerations":{"type":"array","items":{"type":"object"}},"watchNamespaces":{"type":"string"}}} +{"$schema":"http://json-schema.org/draft-07/schema#","title":"Values","type":"object","properties":{"affinity":{"type":"object"},"annotations":{"type":"object"},"enableLeaderElection":{"type":"boolean"},"enableMetrics":{"type":"boolean"},"healthPort":{"type":"integer"},"image":{"type":"object","properties":{"pullPolicy":{"type":"string","enum":["Always","Never","IfNotPresent"]},"repository":{"type":"string"},"tag":{"type":"string"}}},"leaderElectionID":{"type":"string"},"livenessProbe":{"type":"object","properties":{"enabled":{"type":"boolean"},"failureThreshold":{"type":"integer"},"httpGet":{"type":"object","properties":{"path":{"type":"string"},"port":{"type":"string"},"scheme":{"type":"string"}}},"initialDelaySeconds":{"type":"integer"},"periodSeconds":{"type":"integer"},"successThreshold":{"type":"integer"},"timeoutSeconds":{"type":"integer"}}},"logging":{"type":"object","properties":{"format":{"type":"string","enum":["console","json"]},"level":{"type":"string","enum":["debug","info","error"]},"stacktraceLevel":{"type":"string","enum":["debug","info","error"]}}},"maxConcurrentReconciles":{"type":"integer"},"metricsPort":{"type":"integer"},"name":{"type":"string"},"namespaced":{"type":"boolean"},"nodeSelector":{"type":"object"},"podAnnotations":{"type":"object"},"rbac":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"readinessProbe":{"type":"object","properties":{"enabled":{"type":"boolean"},"failureThreshold":{"type":"integer"},"httpGet":{"type":"object","properties":{"path":{"type":"string"},"port":{"type":"string"},"scheme":{"type":"string"}}},"initialDelaySeconds":{"type":"integer"},"periodSeconds":{"type":"integer"},"successThreshold":{"type":"integer"},"timeoutSeconds":{"type":"integer"}}},"reconcilePeriod":{"type":"string"},"replicas":{"type":"integer"},"resources":{"type":"object"},"service":{"type":"object","properties":{"annotations":{"type":"object"},"enabled":{"type":"boolean"},"externalTrafficPolicy":{"type":"string"},"labels":{"type":"object"},"type":{"type":"string","enum":["ClusterIP","LoadBalancer","NodePort"]}}},"serviceAccount":{"type":"object","properties":{"create":{"type":"boolean"},"name":{"type":"string"}}},"tolerations":{"type":"array","items":{"type":"object"}},"watchNamespaces":{"type":"string"}}} diff --git a/charts/vald-helm-operator/values.yaml b/charts/vald-helm-operator/values.yaml index 86f93d0ef23..e349e2c9fc7 100644 --- a/charts/vald-helm-operator/values.yaml +++ b/charts/vald-helm-operator/values.yaml @@ -110,6 +110,10 @@ reconcilePeriod: 1m # enableMetrics -- enable metrics endpoint enableMetrics: true +# @schema {"name": "healthPort", "type": "integer"} +# healthPort -- port of health endpoint +healthPort: 8081 + # @schema {"name": "metricsPort", "type": "integer"} # metricsPort -- port of metrics endpoint metricsPort: 6061 @@ -137,3 +141,67 @@ logging: # @schema {"name": "logging.format", "type": "string", "enum": ["console", "json"]} # logging.format -- logging format of operator (console or json) format: console + +# @schema {"name": "livenessProbe", "type": "object"} +livenessProbe: + # @schema {"name": "livenessProbe.enabled", "type": "boolean"} + # livenessProbe.enabled -- enable liveness probe. + enabled: true + # @schema {"name": "livenessProbe.httpGet", "type": "object"} + httpGet: + # @schema {"name": "livenessProbe.httpGet.path", "type": "string"} + # livenessProbe.httpGet.path -- readiness probe path + path: /healthz + # @schema {"name": "livenessProbe.httpGet.port", "type": "string"} + # livenessProbe.httpGet.port -- readiness probe port + port: health + # @schema {"name": "livenessProbe.httpGet.scheme", "type": "string"} + # livenessProbe.httpGet.scheme -- readiness probe scheme + scheme: HTTP + # @schema {"name": "livenessProbe.initialDelaySeconds", "type": "integer"} + # livenessProbe.initialDelaySeconds -- liveness probe initial delay seconds + initialDelaySeconds: 15 + # @schema {"name": "livenessProbe.periodSeconds", "type": "integer"} + # livenessProbe.periodSeconds -- liveness probe period seconds + periodSeconds: 20 + # @schema {"name": "livenessProbe.successThreshold", "type": "integer"} + # livenessProbe.successThreshold -- liveness probe success threshold + successThreshold: 1 + # @schema {"name": "livenessProbe.failureThreshold", "type": "integer"} + # livenessProbe.failureThreshold -- liveness probe failure threshold + failureThreshold: 2 + # @schema {"name": "livenessProbe.timeoutSeconds", "type": "integer"} + # livenessProbe.timeoutSeconds -- liveness probe timeout seconds + timeoutSeconds: 5 + +# @schema {"name": "readinessProbe", "type": "object"} +readinessProbe: + # @schema {"name": "readinessProbe.enabled", "type": "boolean"} + # readinessProbe.enabled -- enable readiness probe. + enabled: true + # @schema {"name": "readinessProbe.httpGet", "type": "object"} + httpGet: + # @schema {"name": "readinessProbe.httpGet.path", "type": "string"} + # readinessProbe.httpGet.path -- readiness probe path + path: /readyz + # @schema {"name": "readinessProbe.httpGet.port", "type": "string"} + # readinessProbe.httpGet.port -- readiness probe port + port: health + # @schema {"name": "readinessProbe.httpGet.scheme", "type": "string"} + # readinessProbe.httpGet.scheme -- readiness probe scheme + scheme: HTTP + # @schema {"name": "readinessProbe.initialDelaySeconds", "type": "integer"} + # readinessProbe.initialDelaySeconds -- liveness probe initial delay seconds + initialDelaySeconds: 5 + # @schema {"name": "readinessProbe.periodSeconds", "type": "integer"} + # readinessProbe.periodSeconds -- liveness probe period seconds + periodSeconds: 10 + # @schema {"name": "readinessProbe.successThreshold", "type": "integer"} + # readinessProbe.successThreshold -- liveness probe success threshold + successThreshold: 1 + # @schema {"name": "readinessProbe.failureThreshold", "type": "integer"} + # readinessProbe.failureThreshold -- liveness probe failure threshold + failureThreshold: 2 + # @schema {"name": "readinessProbe.timeoutSeconds", "type": "integer"} + # readinessProbe.timeoutSeconds -- liveness probe timeout seconds + timeoutSeconds: 5 diff --git a/versions/OPERATOR_SDK_VERSION b/versions/OPERATOR_SDK_VERSION index 18fa8e74f9b..c432e90f238 100644 --- a/versions/OPERATOR_SDK_VERSION +++ b/versions/OPERATOR_SDK_VERSION @@ -1 +1 @@ -v1.3.0 +v1.4.2