acostaedg opened a new issue, #10979: URL: https://github.com/apache/skywalking/issues/10979
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues. ### Apache SkyWalking Component Helm Chart (apache/skywalking-kubernetes) ### What happened When deploying the SkyWalking-OAP server using the SkyWalking-Kubernetes Helm chart for the first time with a clean database (e.g., PostgreSQL, MySQL), we encounter a problem with the [oap-init.job.yaml](https://github.com/apache/skywalking-kubernetes/blob/e2c61c6774cf377b23516fca6f8a1e119d3191c5/chart/skywalking/templates/oap-init.job.yaml) job. The issue arises because the job does not start before the deployment due to the incorrect helm hook annotation value. Currently, the "oap-init.job.yaml" job has the helm hook annotation "helm.sh/hook" with the values [post-install, post-upgrade, post-rollback](https://github.com/apache/skywalking-kubernetes/blob/e2c61c6774cf377b23516fca6f8a1e119d3191c5/chart/skywalking/templates/oap-init.job.yaml#LL29C52-L29C52). However, for the desired functionality, the annotation should be set to "pre-install, pre-upgrade" instead. This adjustment is necessary to ensure that the oap server is initiated first in the init mode. Once the init job successfully completes, the oap server can transition to the default mode without any failure, as the database will already be populated. By making this modification to the helm hook annotation, the deployment process will follow the intended sequence, ensuring the correct initialization and subsequent operation of the SkyWalking-OAP server. Please let me know if you need any further clarification or information regarding this issue. ### What you expected to happen **What you expected to happen:** I expected the [oap-init.job.yaml](https://github.com/apache/skywalking-kubernetes/blob/e2c61c6774cf377b23516fca6f8a1e119d3191c5/chart/skywalking/templates/oap-init.job.yaml) job to start before the deployment of the SkyWalking-OAP server. This initialization job should have run in the "pre-install, pre-upgrade" phase as specified by the helm hook annotation. The purpose of this job is to populate the database with the necessary data before the oap server starts in the default mode. **What do you think went wrong:** The issue occurred because the helm hook annotation value for the "oap-init.job.yaml" job was incorrectly set to "post-install, post-upgrade, post-rollback" instead of the expected "pre-install, pre-upgrade" values. This resulted in the job not being triggered before the oap server deployment, leading to a failure to initialize the database. As a consequence, the oap server could not start properly, as it relied on the presence of the populated database. By correcting the helm hook annotation value, the "oap-init.job.yaml" job will be executed in the correct phase, allowing for the successful initialization of the database and subsequent deployment of the SkyWalking-OAP server. ### How to reproduce To reproduce the issue, follow these steps: 1. Install the SkyWalking-Kubernetes Helm chart. 2. Ensure that the chosen database (e.g., PostgreSQL, MySQL) is clean and has no existing data, only the skywalking database/schema should exist but empty. 3. Start the deployment of the SkyWalking-OAP server using the Helm chart. 4. Monitor the deployment process and observe that the "oap-init.job.yaml" job does not start before the OAP server deployment. 5. Notice that the database is not populated with the necessary data before the OAP server starts. 6. As a result, the OAP server fails to start correctly due to the absence of the required data in the database. By following these steps, you should be able to reproduce the issue and observe the incorrect sequence of the "oap-init.job.yaml" job execution, leading to the failure in initializing the database before the OAP server deployment. Please let me know if there's any further information or clarification needed. ### Anything else _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
