[AAI] Enhancement of AAI-traversal healthcheck 43/131443/2
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Wed, 12 Oct 2022 07:50:46 +0000 (09:50 +0200)
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>
Wed, 12 Oct 2022 09:18:07 +0000 (11:18 +0200)
- use the EchoResponse endpoint for the traversal healthcheck
- proof read the CONTRIBUTING.md

Issue-ID: AAI-3547

Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Change-Id: Ic07a194f2e42185dfb0cc43fffc7f805663447d9

CONTRIBUTING.md
kubernetes/aai/components/aai-traversal/templates/deployment.yaml

index 1fdea5b..e16772d 100644 (file)
@@ -17,49 +17,46 @@ limitations under the License.
 # Contributing to OOM
 
 Thanks for taking the time to contribute to OOM!
-Please see a few informations on how to dot it.
+Please see some information on how to do it.
 
 ## How to become a contributor and submit your own code
 
 ### Environment setup
-
-In order to be able to check on your side before submitting, you'll need to
-install some binaries:
+In order to be able to check on your side before submitting, you'll need to install some binaries:
 
 * helm (satisfying the targeted version as seen in [setup guide](
-docs/oom_cloud_setup_guide.rst#software-requirements).
-* chartmuseum (in order to cm-push dependency charts)
-* helm cm-push (version 0.10.1 as of today)
+docs/oom_cloud_setup_guide.rst#software-requirements)).
+* chartmuseum (in order to push dependency charts)
+* helm push (version 0.10.1 as of today)
 * make
 
 ### Linting and testing
+OOM uses helm linting in order to check that the template rendering is correct with default values.
 
-OOM use helm linting in order to check that the templates rendering is correct
-with default values.
-
-first step is to start chartmuseum:
+The first step is to start chartmuseum:
 
-```shell
+``` shell
 nohup chartmuseum --storage="local" --storage-local-rootdir="/tmp/chartstorage" \
   --port 6464 &
 ```
+or
+``` shell
+docker-compose up
+```
 
-then you add `local` repository to helm:
-
+then you add a `local` repository to helm:
 ```shell
-helm repo remove local && helm repo add local http://localhost:6464
+helm repo remove local || helm repo add local http://localhost:6464
 ```
 
-As full rendering may be extremely long (~9h), you can only lint the common
-part and the component you're working on.
+As full rendering may be extremely long (~9h), you may only want to lint the common part and the component you're working on.
 Here's an example with AAI:
-
 ```shell
 cd kubernetes
 make common && make aai
 ```
 
-If you work on non default path, it's strongly advised to also render the
+If you work on non default path, it's strongly advised to also render the
 template of your component / subcomponent to be sure it's as expected.
 
 Here's an example enabling service mesh on aai graphadmin:
@@ -68,21 +65,19 @@ Here's an example enabling service mesh on aai graphadmin:
 cd aai/components/
 helm template --release-name onap --debug \
   --set global.ingress.virtualhost.baseurl=toto \
-  --set global.ingress.enabled=true --set global.masterPassword="toto" \
-  --set global.serviceMesh.enabled=true --set global.serviceMesh.tls=true \
+  --set global.ingress.enabled=true \
+  --set global.masterPassword="toto" \
+  --set global.serviceMesh.enabled=true \
+  --set global.serviceMesh.tls=true \
   aai-graphadmin
 ```
+All the output will be rendered YAML if everything works as expected or an error if something goes wrong.
+Usually the errors come from bad indentation or unknown values.
 
-All the output will be the rendered YAML if it's OK or you may see an error.
-Usually the errors comes from bad indentation or unknown value.
-
-### Contributing A Patch
-
+### Contributing a Patch
 1. Fork the desired repo, develop and test your code changes.
 2. Sign the LFN CLA (<https://www.onap.org/cla>)
 3. Submit a pull request.
 4. Work with the reviewers on their suggestions.
-5. Ensure to rebase to the HEAD of your target branch and squash un-necessary
-   commits (
-   <https://blog.carbonfive.com/always-squash-and-rebase-your-git-commits/>)
-   before final merger of your contribution.
+5. Ensure to rebase to the HEAD of your target branch and [squash un-necessary commits](https://blog.carbonfive.com/always-squash-and-rebase-your-git-commits/)
+   before finally mergin your contribution.
index ed8cde7..b9f2a80 100644 (file)
@@ -221,18 +221,35 @@ spec:
         # so K8s doesn't restart unresponsive container
         {{ if .Values.liveness.enabled }}
         livenessProbe:
-          tcpSocket:
+          httpGet:
+            path: /aai/util/echo?action=checkDB
             port: {{ .Values.service.internalPort }}
+            scheme: HTTP{{ (eq "true" (include "common.needTLS" .)) | ternary "S" "" }}
+            httpHeaders:
+            - name: X-FromAppId
+              value: LivenessCheck
+            - name: X-TransactionId
+              value: LiveCheck_TID
+            - name: Accept
+              value: application/json
           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
           periodSeconds: {{ .Values.liveness.periodSeconds }}
         {{ end }}
         readinessProbe:
-          tcpSocket:
+          httpGet:
+            path: /aai/util/echo?action=checkDB
             port: {{ .Values.service.internalPort }}
+            scheme: HTTP{{ (eq "true" (include "common.needTLS" .)) | ternary "S" "" }}
+            httpHeaders:
+            - name: X-FromAppId
+              value: ReadinessCheck
+            - name: X-TransactionId
+              value: ReadinessCheck_TID
+            - name: Accept
+              value: application/json
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
-        resources:
-{{ include "common.resources" . }}
+        resources: {{ include "common.resources" . | nindent 12 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 8 }}