-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to allow core/vstack in the container (#230)
There are two changes in the PR to aid in debugging: - Added the SYS_PTRACE capability and gdb to the container. This allows us to run vstack to collect stacks of the vertica process. - Added an option to allow a custom securityContext to be specified. This was necessary since you need to run in privileged mode to set the core ulimit in order to collect core files in the container. Note, by default the vertica container still does not run in privileged mode. This new option is just to allow us to run in that mode. To capture core files, the following needs to be done: 1. Set the privileged mode in the container. This can be set now with the securityContext parameter like this: apiVersion: vertica.com/v1beta1 kind: VerticaDB metadata: name: v spec: image: "vertica/vertica-k8s:12.0.0-0-minimal" communal: path: "s3://nimbusdb/db" endpoint: "http://minio" credentialSecret: s3-auth includeUIDInPath: true kSafety: "0" securityContext: privileged: true subclusters: - name: defaultsubcluster size: 1 2. Ensure /proc/sys/kernel/core_pattern is set to core in the host machine. This file is not namespaced, so when setting this value in the host it effects all containers running on that host. $ cat /proc/sys/kernel/core_pattern core If vertica does generate a core, a message is written to the vertica.log to indicate where the file is written too.
- Loading branch information
spilchen
authored
Jul 5, 2022
1 parent
67e48a8
commit 02940aa
Showing
8 changed files
with
200 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: Added | ||
body: Allow vstack and cores to be taken in the container | ||
time: 2022-07-04T16:30:49.880373536-03:00 | ||
custom: | ||
Issue: "230" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
(c) Copyright [2021-2022] Micro Focus or one of its affiliates. | ||
Licensed 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. | ||
*/ | ||
|
||
package builder | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"sigs.k8s.io/controller-runtime/pkg/envtest/printer" | ||
) | ||
|
||
func TestAPIs(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
|
||
RunSpecsWithDefaultAndCustomReporters(t, | ||
"builder Suite", | ||
[]Reporter{printer.NewlineReporter{}}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# (c) Copyright [2021-2022] Micro Focus or one of its affiliates. | ||
# Licensed 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. | ||
|
||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: test-verify-vstack | ||
status: | ||
containerStatuses: | ||
- name: test | ||
state: | ||
terminated: | ||
exitCode: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# (c) Copyright [2021-2022] Micro Focus or one of its affiliates. | ||
# Licensed 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. | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: script-verify-vstack | ||
data: | ||
entrypoint.sh: |- | ||
#!/bin/bash | ||
set -o xtrace | ||
set -o errexit | ||
VSTACK_OP=$(kubectl exec svc/v-client-access-sc1 -- sudo /opt/vertica/bin/vstack) | ||
echo $VSTACK_OP | ||
echo $VSTACK_OP | grep -cq 'Thread' | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: test-verify-vstack | ||
labels: | ||
stern: include | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: test | ||
image: quay.io/helmpack/chart-testing:v3.3.1 | ||
command: ["/bin/entrypoint.sh"] | ||
volumeMounts: | ||
- name: entrypoint-volume | ||
mountPath: /bin/entrypoint.sh | ||
readOnly: true | ||
subPath: entrypoint.sh | ||
volumes: | ||
- name: entrypoint-volume | ||
configMap: | ||
defaultMode: 0700 | ||
name: script-verify-vstack |