Open nuu9323226 opened 2 years ago
@nuu9323226
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 6m58s default-scheduler 0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
I think you not deploy the k8s on AWS, your master/worker pods will not bound to the right PersistentVolume
.
You should create you own StorageClass such as nfs-provisioner.
@LubinLew @Wazuh
I have followed the steps exactly described wazuh-kubernetes-reopository, generated certificates and changed storageclass to nfs-provisioner, the wazuh-pods are still in crashloopbackoff state. Before changing storageclass to nfs-provisioner i have deployed nfs-subdir-external-provisioner in kubernetes.
@chasegame-alpha
If you want to use nfs-provisioner, you need a NFS server first.
# example on centos7
yum install -y nfs-utils
mkdir -p /opt/k8s
echo "/opt/k8s *(rw,async,insecure,no_subtree_check,no_root_squash)" > /etc/exports
systemctl enable nfs
systemctl start nfs
configure StorageClass
name to wazuh-storage
in class.yaml
configure NFS(hostname/path) indeployment.yaml.
env:
- name: PROVISIONER_NAME
value: k8s-sigs.io/nfs-subdir-external-provisioner
- name: NFS_SERVER
value: 10.3.243.101
- name: NFS_PATH
value: /opt/k8s
volumes:
- name: nfs-client-root
nfs:
server: 10.3.243.101
path: /opt/k8s
@LubinLew i have already nfs server running, while deploying nfs-subdir-external-provisioner i have given the ip of nfs server and path to use the path for dynamic provisioning. I have deployed it through helm at the run time i have given the ip and path. The below are the files i have changed to use nfs-client storageclass. StorageClass.yaml file
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: nfs-client provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
volumeclaimtemplates:
volumeClaimTemplates:
logs of wazuh-manager-master pod
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 0-wazuh-init: executing...
/var/ossec/data_tmp/permanent/var/ossec/api/configuration/
The path /var/ossec/api/configuration is already mounted
/var/ossec/data_tmp/permanent/var/ossec/etc/
The path /var/ossec/etc is already mounted
/var/ossec/data_tmp/permanent/var/ossec/logs/
The path /var/ossec/logs is already mounted
/var/ossec/data_tmp/permanent/var/ossec/queue/
The path /var/ossec/queue is already mounted
/var/ossec/data_tmp/permanent/var/ossec/agentless/
The path /var/ossec/agentless is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/var/multigroups/
The path /var/ossec/var/multigroups is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/integrations/
The path /var/ossec/integrations is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/active-response/bin/
The path /var/ossec/active-response/bin is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/wodles/
The path /var/ossec/wodles is already mounted
/var/ossec/data_tmp/permanent/etc/filebeat/
The path /etc/filebeat is already mounted
Updating /var/ossec/etc/internal_options.conf
Error executing command: 'cp -p /var/ossec/data_tmp/exclusion//var/ossec/etc/internal_options.conf /var/ossec/etc/internal_options.conf'.
Exiting.
[cont-init.d] 0-wazuh-init: exited 1.
[cont-init.d] 1-config-filebeat: executing...
Customize Elasticsearch ouput IP
Configuring username.
Configuring password.
Configuring SSL verification mode.
Configuring Certificate Authorities.
Configuring SSL Certificate.
Configuring SSL Key.
chown: changing ownership of '/etc/filebeat/filebeat.yml': Operation not permitted
[cont-init.d] 1-config-filebeat: exited 0.
[cont-init.d] 2-manager: executing...
Traceback (most recent call last):
File "/var/ossec/framework/scripts/create_user.py", line 72, in
these are the logs wazuh-manager-worker pod:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 0-wazuh-init: executing... /var/ossec/data_tmp/permanent/var/ossec/api/configuration/ The path /var/ossec/api/configuration is already mounted /var/ossec/data_tmp/permanent/var/ossec/etc/ The path /var/ossec/etc is already mounted /var/ossec/data_tmp/permanent/var/ossec/logs/ The path /var/ossec/logs is already mounted /var/ossec/data_tmp/permanent/var/ossec/queue/ The path /var/ossec/queue is already mounted /var/ossec/data_tmp/permanent/var/ossec/agentless/ The path /var/ossec/agentless is empty, skiped /var/ossec/data_tmp/permanent/var/ossec/var/multigroups/ The path /var/ossec/var/multigroups is empty, skiped /var/ossec/data_tmp/permanent/var/ossec/integrations/ The path /var/ossec/integrations is empty, skiped /var/ossec/data_tmp/permanent/var/ossec/active-response/bin/ The path /var/ossec/active-response/bin is empty, skiped /var/ossec/data_tmp/permanent/var/ossec/wodles/ The path /var/ossec/wodles is already mounted /var/ossec/data_tmp/permanent/etc/filebeat/ The path /etc/filebeat is already mounted Updating /var/ossec/etc/internal_options.conf Error executing command: 'cp -p /var/ossec/data_tmp/exclusion//var/ossec/etc/internal_options.conf /var/ossec/etc/internal_options.conf'. Exiting. [cont-init.d] 0-wazuh-init: exited 1. [cont-init.d] 1-config-filebeat: executing... Customize Elasticsearch ouput IP Configuring username. Configuring password. Configuring SSL verification mode. Configuring Certificate Authorities. Configuring SSL Certificate. Configuring SSL Key. chown: changing ownership of '/etc/filebeat/filebeat.yml': Operation not permitted [cont-init.d] 1-config-filebeat: exited 0. [cont-init.d] 2-manager: executing... 2023/02/13 11:14:20 wazuh-analysisd: ERROR: Could not change the group to 'wazuh': 1 2023/02/13 11:14:20 wazuh-analysisd: CRITICAL: (1202): Configuration error at 'etc/ossec.conf'. wazuh-analysisd: Configuration error. Exiting [cont-init.d] 2-manager: exited 1. [cont-init.d] done. [services.d] starting services 2023/02/13 10:42:25 wazuh-integratord: ERROR: (1103): Could not open file 'etc/internal_options.conf' due to [(2)-(No such file or directory)]. 2023/02/13 10:42:25 wazuh-integratord: CRITICAL: (2301): Definition not found for: 'integrator.debug'. 2023/02/13 10:44:03 wazuh-analysisd: ERROR: Could not change the group to 'wazuh': 1 2023/02/13 10:44:03 wazuh-analysisd: CRITICAL: (1202): Configuration error at 'etc/ossec.conf'. 2023/02/13 10:46:28 wazuh-analysisd: ERROR: Could not change the group to 'wazuh': 1 2023/02/13 10:46:28 wazuh-analysisd: CRITICAL: (1202): Configuration error at 'etc/ossec.conf'. 2023/02/13 11:14:04 wazuh-analysisd: ERROR: Could not change the group to 'wazuh': 1 2023/02/13 11:14:04 wazuh-analysisd: CRITICAL: (1202): Configuration error at 'etc/ossec.conf'. 2023/02/13 11:14:20 wazuh-analysisd: ERROR: Could not change the group to 'wazuh': 1 2023/02/13 11:14:20 wazuh-analysisd: CRITICAL: (1202): Configuration error at 'etc/ossec.conf'. [services.d] done. starting Filebeat Exiting: error loading config file: config file ("/etc/filebeat/filebeat.yml") must be owned by the user identifier (uid=0) or root Filebeat exited. code=1 [cont-finish.d] executing container finish scripts... [cont-finish.d] done. [s6-finish] waiting for services. [s6-finish] sending all processes the TERM signal. [s6-finish] sending all processes the KILL signal and exiting.
any help regarding this? Thanks in advance.
@chasegame-alpha
All dirs mounted, StorgeClass workes. Maybe just the permissions issue ?
Everything I do is replace the wazh-storage to nfs-provisioner.
$ kubectl get pod -A
NAMESPACE NAME READY STATUS RESTARTS AGE
default nfs-client-provisioner-745cc5684-jwssj 1/1 Running 0 51m
kube-system coredns-5bbd96d687-cwjpf 1/1 Running 0 51m
kube-system coredns-5bbd96d687-dtn48 1/1 Running 0 51m
kube-system etcd-k8s 1/1 Running 7 52m
kube-system kube-apiserver-k8s 1/1 Running 1 52m
kube-system kube-controller-manager-k8s 1/1 Running 1 52m
kube-system kube-proxy-q768x 1/1 Running 0 51m
kube-system kube-scheduler-k8s 1/1 Running 7 52m
wazuh wazuh-dashboard-6755c6b9f8-85pj4 1/1 Running 0 50m
wazuh wazuh-indexer-0 1/1 Running 0 50m
wazuh wazuh-indexer-1 1/1 Running 0 36m
wazuh wazuh-indexer-2 1/1 Running 0 35m
wazuh wazuh-manager-master-0 1/1 Running 0 50m
wazuh wazuh-manager-worker-0 1/1 Running 0 50m
wazuh wazuh-manager-worker-1 1/1 Running 0 50m
$ kubectl logs -f wazuh-manager-master-0 -n wazuh
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 0-wazuh-init: executing...
/var/ossec/data_tmp/permanent/var/ossec/api/configuration/
Installing /var/ossec/api/configuration
/var/ossec/data_tmp/permanent/var/ossec/etc/
Installing /var/ossec/etc
/var/ossec/data_tmp/permanent/var/ossec/logs/
Installing /var/ossec/logs
/var/ossec/data_tmp/permanent/var/ossec/queue/
Installing /var/ossec/queue
/var/ossec/data_tmp/permanent/var/ossec/agentless/
The path /var/ossec/agentless is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/var/multigroups/
The path /var/ossec/var/multigroups is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/integrations/
The path /var/ossec/integrations is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/active-response/bin/
The path /var/ossec/active-response/bin is empty, skiped
/var/ossec/data_tmp/permanent/var/ossec/wodles/
Installing /var/ossec/wodles
/var/ossec/data_tmp/permanent/etc/filebeat/
Installing /etc/filebeat
Updating /var/ossec/etc/internal_options.conf
Updating /var/ossec/integrations/pagerduty
Updating /var/ossec/integrations/slack
Updating /var/ossec/integrations/slack.py
Updating /var/ossec/integrations/virustotal
Updating /var/ossec/integrations/virustotal.py
Updating /var/ossec/active-response/bin/default-firewall-drop
Updating /var/ossec/active-response/bin/disable-account
Updating /var/ossec/active-response/bin/firewalld-drop
Updating /var/ossec/active-response/bin/firewall-drop
Updating /var/ossec/active-response/bin/host-deny
Updating /var/ossec/active-response/bin/ip-customblock
Updating /var/ossec/active-response/bin/ipfw
Updating /var/ossec/active-response/bin/kaspersky.py
Updating /var/ossec/active-response/bin/kaspersky
Updating /var/ossec/active-response/bin/npf
Updating /var/ossec/active-response/bin/wazuh-slack
Updating /var/ossec/active-response/bin/pf
Updating /var/ossec/active-response/bin/restart-wazuh
Updating /var/ossec/active-response/bin/restart.sh
Updating /var/ossec/active-response/bin/route-null
Updating /var/ossec/agentless/sshlogin.exp
Updating /var/ossec/agentless/ssh_pixconfig_diff
Updating /var/ossec/agentless/ssh_asa-fwsmconfig_diff
Updating /var/ossec/agentless/ssh_integrity_check_bsd
Updating /var/ossec/agentless/main.exp
Updating /var/ossec/agentless/su.exp
Updating /var/ossec/agentless/ssh_integrity_check_linux
Updating /var/ossec/agentless/register_host.sh
Updating /var/ossec/agentless/ssh_generic_diff
Updating /var/ossec/agentless/ssh_foundry_diff
Updating /var/ossec/agentless/ssh_nopass.exp
Updating /var/ossec/agentless/ssh.exp
Updating /var/ossec/wodles/utils.py
Updating /var/ossec/wodles/aws/aws-s3
Updating /var/ossec/wodles/aws/aws-s3.py
Updating /var/ossec/wodles/azure/azure-logs
Updating /var/ossec/wodles/azure/azure-logs.py
Updating /var/ossec/wodles/docker/DockerListener
Updating /var/ossec/wodles/docker/DockerListener.py
Updating /var/ossec/wodles/gcloud/gcloud
Updating /var/ossec/wodles/gcloud/gcloud.py
Updating /var/ossec/wodles/gcloud/integration.py
Updating /var/ossec/wodles/gcloud/tools.py
find: '/proc/336/task/336/fd/5': No such file or directory
find: '/proc/336/task/336/fdinfo/5': No such file or directory
find: '/proc/336/fd/6': No such file or directory
find: '/proc/336/fdinfo/6': No such file or directory
find: '/proc/337/task/337/fd/5': No such file or directory
find: '/proc/337/task/337/fdinfo/5': No such file or directory
find: '/proc/337/fd/6': No such file or directory
find: '/proc/337/fdinfo/6': No such file or directory
Identified Wazuh configuration files to mount...
'/wazuh-config-mount/etc/ossec.conf' -> '/var/ossec/etc/ossec.conf'
'/wazuh-config-mount/etc/authd.pass' -> '/var/ossec/etc/authd.pass'
[cont-init.d] 0-wazuh-init: exited 0.
[cont-init.d] 1-config-filebeat: executing...
Customize Elasticsearch ouput IP
Configuring username.
Configuring password.
Configuring SSL verification mode.
Configuring Certificate Authorities.
Configuring SSL Certificate.
Configuring SSL Key.
[cont-init.d] 1-config-filebeat: exited 0.
[cont-init.d] 2-manager: executing...
2023/02/16 06:58:56 wazuh-modulesd: WARNING: The <ignore_time> tag at module 'vulnerability-detector' is deprecated for version newer than 4.3.
Starting Wazuh v4.3.10...
Started wazuh-apid...
Started wazuh-csyslogd...
Started wazuh-dbd...
2023/02/16 06:59:13 wazuh-integratord: INFO: Remote integrations not configured. Clean exit.
Started wazuh-integratord...
Started wazuh-agentlessd...
Started wazuh-authd...
Started wazuh-db...
Started wazuh-execd...
Started wazuh-analysisd...
2023/02/16 06:59:18 wazuh-syscheckd: WARNING: The check_unixaudit option is deprecated in favor of the SCA module.
Started wazuh-syscheckd...
Started wazuh-remoted...
Started wazuh-logcollector...
Started wazuh-monitord...
2023/02/16 06:59:22 wazuh-modulesd: WARNING: The <ignore_time> tag at module 'vulnerability-detector' is deprecated for version newer than 4.3.
Started wazuh-modulesd...
Started wazuh-clusterd...
Completed.
[cont-init.d] 2-manager: exited 0.
[cont-init.d] done.
[services.d] starting services
2023/02/16 06:59:23 wazuh-modulesd:database: INFO: Module started.
2023/02/16 06:59:23 wazuh-modulesd:control: INFO: Starting control thread.
2023/02/16 06:59:23 wazuh-modulesd:task-manager: INFO: (8200): Module Task Manager started.
2023/02/16 06:59:24 wazuh-remoted: INFO: (1410): Reading authentication keys file.
2023/02/16 06:59:25 wazuh-modulesd:syscollector: INFO: Module started.
2023/02/16 06:59:26 wazuh-modulesd:syscollector: INFO: Starting evaluation.
2023/02/16 06:59:28 wazuh-syscheckd: INFO: (6009): File integrity monitoring scan ended.
2023/02/16 06:59:28 wazuh-analysisd: INFO: Total rules enabled: '6327'
2023/02/16 06:59:28 wazuh-analysisd: INFO: The option <queue_size> is deprecated and won't apply. Set up each queue size in the internal_options file.
2023/02/16 06:59:29 wazuh-analysisd: INFO: Started (pid: 524).
starting Filebeat
[services.d] done.
Having the same issue here. The only thing I had done differently is setup the wazuh storage to be an EFS provisioner storage instead of a GP2 storage.
I use version v4.3.6 I got errors below wazuh-master and wazuh-worker can't run This is my event How should I solve this problem?