Created attachment 20787 [details] kubectl logs deployment/trivy-operator -n trivy-system Шаги ==== Необходим стенд из 2 серверов. 1. Подготовить команду для установки переменных: export \ _arch=amd64 \ _repo=sisyphus \ _registry_repo=sisyphus \ _version=0.29.0 \ _kubernetes_version=1.33 \ kubehostb_ip=<ip> 2. Выполнить на будущем kubehosta (control-plane): # Установить переменные командой, подготовленной ранее. # apt-get install -y podsec fuse-overlayfs trivy trivy-server python3-module-{tomli,requests} kubernetes$_kubernetes_version-kubeadm && \ podsec-create-policy $(hostname -i) && \ sed 's|reject|insecureAcceptAnything|g' -i /etc/containers/policy.json && \ podsec-create-services # podsec-create-imagemakeruser imagemaker > ввести пароль (например 1) > ВНИМАНИЕ: выбрать тип ключа RSA (не ECC / Ed25519)! (см. ошибки в других пакетах 54838, 52211#c7) и задать размер 2048 > ввести полное имя imagemaker > ввести адрес почты imagemaker@test.ru > ввести пароль для gpg ключа (например 1qaz2wsx) > остальное по умолчанию # podsec-create-podmanusers poduser > ввести пароль (например 1) # ssh -o "StrictHostKeyChecking no" imagemaker@localhost imagemaker$ Установить переменные командой, подготовленной ранее. imagemaker$ podman pull --tls-verify "registry.altlinux.org/$_registry_repo/alt:latest" && \ podman tag "registry.altlinux.org/$_registry_repo/alt:latest" "registry.local/$_repo/alt:latest" && \ podman push --tls-verify=false --sign-by=imagemaker@test.ru "registry.local/$_repo/alt:latest" && \ podman images | sort && \ git clone --depth 1 https://altlinux.space/cloud/image-forge.git && \ cd image-forge && \ echo -e "[\"k8s-extra/trivy-operator\"]\n$_repo = [\"$_version\"]" > test-tags.toml && \ head test* && \ ./build.py \ --branches "$_repo" \ --registry registry.local \ --overwrite-organization "$_repo" \ --sign imagemaker@test.ru \ --images k8s-extra/trivy-operator \ --arches "$_arch" \ --tags test-tags.toml \ --package-versions "{\"k8s-extra/trivy-operator\": \"$_version\"}" \ --latest "$_repo" \ --log-level debug && \ podman images "registry.local/$_repo/trivy-operator" && \ exit # Установить переменные командой, подготовленной ранее. # export kubehosta_ip="$(hostname -i)" && \ cd /etc/docker-registry/ && \ CA_KEY=ca_private_key.pem && \ CA_CERT=ca_cert.pem && \ KEY=key.pem && \ CERT=cert.pem && \ CSR=cert.csr && \ SIGNED_CERT=output.pem && \ CHAIN=combined.pem && \ SUBJECT=registry.local && \ CA_NAME="registry.local Test CA" && \ CERT_NAME="registry.local Test Leaf Certificate" && \ VALIDITY_DAYS=14 && \ STRENGTH=4096 && \ rm -rfv {,**/}*.{pem,csr,crl} && \ openssl req -x509 -days "$VALIDITY_DAYS" -newkey "rsa:$STRENGTH" -keyout "$CA_KEY" -out "$CA_CERT" -nodes -subj "/C=RU/O=$CA_NAME/" && \ openssl req -x509 -newkey "rsa:$STRENGTH" -keyout "$KEY" -out "$CERT" -sha256 -days "$VALIDITY_DAYS" -nodes -subj "/C=RU/L=Moscow/O=$CERT_NAME/OU=QA/CN=$SUBJECT" -addext "subjectAltName = DNS:$SUBJECT" && \ openssl req -new -key "$KEY" -out "$CSR" -subj "/C=RU/L=Moscow/O=$CERT_NAME/OU=QA/CN=$SUBJECT" -addext "subjectAltName = DNS:$SUBJECT" && \ openssl x509 -req -in "$CSR" -days "$VALIDITY_DAYS" -CA "$CA_CERT" -CAkey "$CA_KEY" -CAcreateserial -out "$SIGNED_CERT" -extfile <(cat /etc/openssl/openssl.cnf <(printf "[my_san_ext]\nsubjectAltName=DNS:$SUBJECT")) -extensions my_san_ext && \ cat "$SIGNED_CERT" "$CA_CERT" > "$CHAIN" && \ sed 's/:80/:443/;/\[nosniff\]/a\ tls:\n certificate: /etc/docker-registry/combined.pem\n key: /etc/docker-registry/key.pem' -i config.yml && \ cp ca_cert.pem /etc/pki/ca-trust/source/anchors/ && \ scp -o "StrictHostKeyChecking no" ca_cert.pem "root@$kubehostb_ip:/etc/pki/ca-trust/source/anchors/" && \ ssh "root@$kubehostb_ip" "mkdir -p /var/sigstore/keys/" && \ scp -o "StrictHostKeyChecking no" /var/sigstore/keys/* "root@$kubehostb_ip:/var/sigstore/keys/" && \ update-ca-trust && \ systemctl restart docker-registry && \ echo "[qa] ssh kubehostb" && { ssh -o "StrictHostKeyChecking no" "root@$kubehostb_ip" << EOF apt-get install -y podsec && \ podsec-create-policy "$kubehosta_ip" && \ sed 's|reject|insecureAcceptAnything|g' -i /etc/containers/policy.json && \ update-ca-trust EOF } && \ echo "[qa] end ssh kubehostb" && \ echo "[qa] reboot kubehostb" && \ ssh -o "StrictHostKeyChecking no" "root@$kubehostb_ip" "reboot"; \ echo "[qa] reboot self" && \ reboot 3. Развернуть kubernetes-кластер на kubehosta (control-plane) + kubehostb. 4. Установить helm и подготовить файлы (на kubehosta): # apt-get install -y helm Скачать репозиторий пакета из проверяемого задания и создать файл с переопределениями некоторых переменных: $ Установить переменные командой, подготовленной ранее. $ git clone "https://git.altlinux.org/gears/t/trivy-operator.git" \ && cd "trivy-operator" \ && ll \ && cd ./deploy/helm \ && cat > alt-qa-override-values.yaml << EOF # Overrides only some of the values defined in: # -> https://altlinux.space/cloud/charts/src/branch/master/trivy-operator image: registry: registry.local repository: $_repo/trivy-operator tag: $_version pullPolicy: Always trivy: image: registry: registry.altlinux.org repository: $_registry_repo/trivy tag: latest pullPolicy: Always nodeCollector: registry: registry.altlinux.org repository: $_registry_repo/trivy-node-collector tag: latest pullPolicy: Always EOF 5. Развернуть: $ Установить переменные командой, подготовленной ранее. $ helm install trivy-operator . \ --namespace trivy-system \ --create-namespace \ --values "https://altlinux.space/cloud/charts/raw/branch/master/trivy-operator/sisyphus/$_version/values.yaml" \ --values "alt-qa-override-values.yaml" 6. $ kubectl get deployment -n trivy-system (дождаться Ready: 1/1) 7. $ kubectl logs deployment/trivy-operator -n trivy-system | grep Error Фактический результат ===================== 6. $ kubectl get deployment -n trivy-system > NAME READY UP-TO-DATE AVAILABLE AGE > trivy-operator 1/1 1 1 16s 7. $ kubectl logs deployment/trivy-operator -n trivy-system | grep Error См. лог во вложении. В целом вид ошибок следующий: > "level":"error", > "ts":"2026-03-02T08:28:16Z", > "logger":"reconciler.scan job", > "msg":"Scan job container", > "job":"trivy-system/scan-vulnerabilityreport-748d845995", > "container":"install-cni-plugin", > "status.reason":"Error", > "status.message":"", > ... И аналогично для install-cni, trivy-operator. Других подробностей нет, только stacktrace. Ожидаемый результат =================== Нет ошибок "reconciler.scan job". Дополнительно ============= 1. Если развернуть, например, nginx:1.16, он сканируется корректно. 2. Из https://aquasecurity.github.io/trivy-operator/v0.29.0/getting-started/installation/troubleshooting/#reconciliation-error > If this is the case, the Trivy Operator likely > does not have the right configurations to access your resource. Воспроизводимость ================= Воспроизводится на виртуальных машинах: [sisyphus] ALT Server 11.0 x86_64 (minimal) trivy-operator-0.29.0-alt1.x86_64 В [p11] пакета нет.