Azure / mec-app-solution-accelerator

Application Solution Accelerator for Multi-access Edge Compute (MEC)
MIT License
37 stars 10 forks source link

[P2] Test and FIX MEC-Accelerator OSS with Mosquitto on Kubernetes from Docker-Desktop #153

Closed CESARDELATORRE closed 1 month ago

CESARDELATORRE commented 1 month ago

We need to Test MEC-Accelerator OSS with Mosquitto on Kubernetes from Docker-Desktop. Some folks need that environment.

Script setup using mosquitto and k8s (Kubernetes from Docker Desktop).

We tested it in one machine and the setup was giving erros, like the following:

kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE

PS C:\Users\PMEC\Github\mec-app-solution-accelerator-v1.9\deploy\k8s> .\deploy-accelerator.ps1 -kubernetesDistro k8s -mqttBroker mosquitto Installing Mec-Accelerator with mosquitto MQTT broker

  1. Installing Helm Found an existing package already installed. Trying to upgrade the installed package... No available upgrade found. No newer package versions are available from the configured sources.
  2. Creating Mec-Accelerator namespace namespace/mec-accelerator created
  3. Installing Akri "akri-helm-charts" already exists with the same configuration, skipping Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "akri-helm-charts" chart repository Update Complete. ⎈Happy Helming!⎈ coalesce.go:289: warning: destination for akri.custom.configuration.discoveryDetails is a table. Ignoring non-table value () NAME: akri LAST DEPLOYED: Fri May 10 11:18:30 2024 NAMESPACE: mec-accelerator STATUS: deployed REVISION: 1 TEST SUITE: None NOTES:
  4. Get the Akri Controller: kubectl get -o wide pods | grep controller
  5. Get the Akri Agent(s): kubectl get -o wide pods | grep agent
  6. Get the Akri Configuration(s): kubectl get -o wide akric
  7. Deploying MQTT Broker configmap/mqtt-config created deployment.apps/mosquitto created service/mosquitto created
  8. Deploying Mec-Accelerator resources namespace/mec-accelerator unchanged configuration.dapr.io/dapr-config created deployment.apps/alerts-api created service/alerts-api created service/alerts-ui created deployment.apps/alerts-ui created deployment.apps/files-management created service/files-management created deployment.apps/inference-model created persistentvolumeclaim/minio-pvc created deployment.apps/minio-deployment created service/minio created deployment.apps/mongodb-deployment created service/mongodb created deployment.apps/rulesengine created service/rulesengine created deployment.apps/zipkin created service/zipkin created persistentvolumeclaim/control-plane-mongodb-data created deployment.apps/control-plane-mongodb-deployment created service/control-plane-mongodb created configmap/control-plane-api-config created deployment.apps/control-plane-api-deployment created service/control-plane-api-service created deployment.apps/control-plane-ui-deployment created service/control-plane-ui-service created Warning: resource daemonsets/akri-camera-discovery-daemonset is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. daemonset.apps/akri-camera-discovery-daemonset configured Warning: resource deployments/akri-controller-deployment is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. deployment.apps/akri-controller-deployment configured Warning: resource configurations/akri-camera is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. Warning: resource serviceaccounts/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. serviceaccount/akri-webhook-configuration configured Warning: resource roles/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. role.rbac.authorization.k8s.io/akri-webhook-configuration configured Warning: resource rolebindings/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. rolebinding.rbac.authorization.k8s.io/akri-webhook-configuration configured Warning: resource deployments/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. deployment.apps/akri-webhook-configuration configured Warning: resource services/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. service/akri-webhook-configuration configured Warning: resource validatingwebhookconfigurations/akri-webhook-configuration is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically. validatingwebhookconfiguration.admissionregistration.k8s.io/akri-webhook-configuration configured serviceaccount/akri-webhook-configuration-patch created clusterrole.rbac.authorization.k8s.io/akri-webhook-configuration-patch created clusterrolebinding.rbac.authorization.k8s.io/akri-webhook-configuration-patch created role.rbac.authorization.k8s.io/akri-webhook-configuration-patch created rolebinding.rbac.authorization.k8s.io/akri-webhook-configuration-patch created job.batch/akri-webhook-configuration-create created job.batch/akri-webhook-configuration-patch created deployment.apps/rtsp-converter-deployment created service/rtsp-converter-service created deployment.apps/rtsp-video-streamer created service/rtsp-video-streamer created Error from server (InternalError): error when applying patch: {"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"akri.sh/v0\",\"kind\":\"Configuration\",\"metadata\":{\"annotations\":{},\"name\":\"akri-camera\",\"namespace\":\"mec-accelerator\"},\"spec\":{\"brokerProperties\":{\"MINIOURL\":\"http://minio.mec-accelerator.svc.cluster.local:9000\",\"TIMEOUT\":\"15\"},\"brokerSpec\":{\"brokerPodSpec\":{\"containers\":[{\"image\":\"mecsolutionaccelerator/framesplitter:1.8\",\"name\":\"akri-camera-broker\",\"resources\":{\"limits\":{\"cpu\":\"1000m\",\"memory\":\"1Gi\",\"{{PLACEHOLDER}}\":\"1\"},\"requests\":{\"cpu\":\"500m\",\"memory\":\"250Mi\",\"{{PLACEHOLDER}}\":\"1\"}}},{\"args\":[\"/daprd\",\"--mode\",\"kubernetes\",\"--dapr-http-port\",\"3500\",\"--dapr-grpc-port\",\"50001\",\"--dapr-internal-grpc-port\",\"50002\",\"--dapr-public-port\",\"3501\",\"--app-id\",\"frame-splitter-rtsp\",\"--control-plane-address\",\"dapr-api.dapr-system.svc.cluster.local:80\",\"--app-protocol\",\"grpc\",\"--placement-host-address\",\"dapr-placement-server.dapr-system.svc.cluster.local:50005\",\"--config\",\"dapr-config\",\"--log-level\",\"debug\",\"--app-max-concurrency\",\"-1\",\"--sentry-address\",\"dapr-sentry.dapr-system.svc.cluster.local:80\",\"--enable-metrics=true\",\"--metrics-port\",\"9090\",\"--dapr-http-max-request-size\",\"-1\",\"--dapr-http-read-buffer-size\",\"-1\",\"--dapr-graceful-shutdown-seconds\",\"-1\",\"--disable-builtin-k8s-secret-store=false\",\"--enable-api-logging=true\",\"--enable-mtls\"],\"env\":[{\"name\":\"DAPR_HTTP_PORT\",\"value\":\"3500\"},{\"name\":\"DAPR_GRPC_PORT\",\"value\":\"50001\"},{\"name\":\"DAPR_APP_ID\",\"value\":\"frame-splitter-rtsp\"},{\"name\":\"DAPR_APP_PORT\",\"value\":\"50052\"},{\"name\":\"DAPR_APP_PROTOCOL\",\"value\":\"grpc\"},{\"name\":\"DAPR_CONFIG\",\"value\":\"configuration.dapr.io/dapr-config\"},{\"name\":\"DAPR_API_LOGGING\",\"value\":\"true\"},{\"name\":\"DAPR_LOG_LEVEL\",\"value\":\"debug\"},{\"name\":\"NAMESPACE\",\"value\":\"mec-accelerator\"},{\"name\":\"DAPR_TRUST_ANCHORS\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"ca.crt\",\"name\":\"dapr-trust-bundle\",\"optional\":false}}},{\"name\":\"DAPR_CERT_CHAIN\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"issuer.crt\",\"name\":\"dapr-trust-bundle\",\"optional\":false}}},{\"name\":\"DAPR_CERT_KEY\",\"valueFrom\":{\"secretKeyRef\":{\"key\":\"issuer.key\",\"name\":\"dapr-trust-bundle\",\"optional\":false}}},{\"name\":\"SENTRY_LOCAL_IDENTITY\",\"value\":\"mec-accelerator:default\"}],\"image\":\"docker.io/daprio/daprd:latest\",\"name\":\"daprd\",\"ports\":[{\"containerPort\":3500},{\"containerPort\":50001},{\"containerPort\":50002},{\"containerPort\":9090}],\"volumeMounts\":[{\"mountPath\":\"/var/run/secrets/dapr.io/sentrytoken\",\"name\":\"dapr-identity-token\",\"readOnly\":true},{\"mountPath\":\"/var/run/secrets/kubernetes.io/serviceaccount\",\"name\":\"kube-api-access-dgztm\",\"readOnly\":true}]}],\"volumes\":[{\"name\":\"kube-api-access-dgztm\",\"projected\":{\"sources\":[{\"serviceAccountToken\":{\"expirationSeconds\":3607,\"path\":\"token\"}},{\"configMap\":{\"items\":[{\"key\":\"ca.crt\",\"path\":\"ca.crt\"}],\"name\":\"kube-root-ca.crt\",\"optional\":false}},{\"downwardAPI\":{\"items\":[{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"},\"path\":\"namespace\"}]}}]}},{\"name\":\"dapr-identity-token\",\"projected\":{\"sources\":[{\"serviceAccountToken\":{\"audience\":\"dapr.io/sentry\",\"expirationSeconds\":7200,\"path\":\"token\"}}]}}]}},\"capacity\":1,\"configurationServiceSpec\":{\"ports\":[{\"name\":\"akri-custom-configuration-service\",\"port\":6052,\"protocol\":\"TCP\",\"targetPort\":6052}],\"type\":\"ClusterIP\"},\"discoveryHandler\":{\"discoveryDetails\":\"map[collection:Cameras connectionString:mongodb://control-plane-mongodb.mec-accelerator:27017 database:ControlPlane]\",\"name\":\"camera\"},\"instanceServiceSpec\":{\"ports\":[{\"name\":\"akri-custom-instance-service\",\"port\":6052,\"protocol\":\"TCP\",\"targetPort\":6052}],\"type\":\"ClusterIP\"}}}\n"}},"spec":{"brokerProperties":{"MINIOURL":"http://minio.mec-accelerator.svc.cluster.local:9000/","TIMEOUT":"15"},"brokerSpec":{"brokerPodSpec":{"containers":[{"image":"mecsolutionaccelerator/framesplitter:1.8","name":"akri-camera-broker","resources":{"limits":{"cpu":"1000m","memory":"1Gi","{{PLACEHOLDER}}":"1"},"requests":{"cpu":"500m","memory":"250Mi","{{PLACEHOLDER}}":"1"}}},{"args":["/daprd","--mode","kubernetes","--dapr-http-port","3500","--dapr-grpc-port","50001","--dapr-internal-grpc-port","50002","--dapr-public-port","3501","--app-id","frame-splitter-rtsp","--control-plane-address","dapr-api.dapr-system.svc.cluster.local:80","--app-protocol","grpc","--placement-host-address","dapr-placement-server.dapr-system.svc.cluster.local:50005","--config","dapr-config","--log-level","debug","--app-max-concurrency","-1","--sentry-address","dapr-sentry.dapr-system.svc.cluster.local:80","--enable-metrics=true","--metrics-port","9090","--dapr-http-max-request-size","-1","--dapr-http-read-buffer-size","-1","--dapr-graceful-shutdown-seconds","-1","--disable-builtin-k8s-secret-store=false","--enable-api-logging=true","--enable-mtls"],"env":[{"name":"DAPR_HTTP_PORT","value":"3500"},{"name":"DAPR_GRPC_PORT","value":"50001"},{"name":"DAPR_APP_ID","value":"frame-splitter-rtsp"},{"name":"DAPR_APP_PORT","value":"50052"},{"name":"DAPR_APP_PROTOCOL","value":"grpc"},{"name":"DAPR_CONFIG","value":"configuration.dapr.io/dapr-config"},{"name":"DAPR_API_LOGGING","value":"true"},{"name":"DAPR_LOG_LEVEL","value":"debug"},{"name":"NAMESPACE","value":"mec-accelerator"},{"name":"DAPR_TRUST_ANCHORS","valueFrom":{"secretKeyRef":{"key":"ca.crt","name":"dapr-trust-bundle","optional":false}}},{"name":"DAPR_CERT_CHAIN","valueFrom":{"secretKeyRef":{"key":"issuer.crt","name":"dapr-trust-bundle","optional":false}}},{"name":"DAPR_CERT_KEY","valueFrom":{"secretKeyRef":{"key":"issuer.key","name":"dapr-trust-bundle","optional":false}}},{"name":"SENTRY_LOCAL_IDENTITY","value":"mec-accelerator:default"}],"image":"docker.io/daprio/daprd:latest","name":"daprd","ports":[{"containerPort":3500},{"containerPort":50001},{"containerPort":50002},{"containerPort":9090}],"volumeMounts":[{"mountPath":"/var/run/secrets/dapr.io/sentrytoken","name":"dapr-identity-token","readOnly":true},{"mountPath":"/var/run/secrets/kubernetes.io/serviceaccount","name":"kube-api-access-dgztm","readOnly":true}]}],"volumes":[{"name":"kube-api-access-dgztm","projected":{"sources":[{"serviceAccountToken":{"expirationSeconds":3607,"path":"token"}},{"configMap":{"items":[{"key":"ca.crt","path":"ca.crt"}],"name":"kube-root-ca.crt","optional":false}},{"downwardAPI":{"items":[{"fieldRef":{"fieldPath":"metadata.namespace"},"path":"namespace"}]}}]}},{"name":"dapr-identity-token","projected":{"sources":[{"serviceAccountToken":{"audience":"dapr.io/sentry","expirationSeconds":7200,"path":"token"}}]}}]}}}} to: Resource: "akri.sh/v0, Resource=configurations", GroupVersionKind: "akri.sh/v0, Kind=Configuration" Name: "akri-camera", Namespace: "mec-accelerator" for: "15-akri.yaml": error when patching "15-akri.yaml": Internal error occurred: failed calling webhook "akri-webhook-configuration.mec-accelerator.svc": failed to call webhook: Post "https://akri-webhook-configuration.mec-accelerator.svc:443/validate?timeout=10s": net/http: TLS handshake timeout secret/dapr-trust-bundle created Successfully installed MEC-Accelerator!

Alerts-UI and Control-Plane-UI services deployed in: grep : The term 'grep' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Users\PMEC\Github\mec-app-solution-accelerator-v1.9\deploy\k8s\deploy-accelerator.ps1:93 char:144

virubiotor commented 1 month ago

Do we know which error?

CESARDELATORRE commented 1 month ago

I updated the issue with the error.

We tried a couple of times, same issues.

We need to test it with DOCKER-DESKTOP-KUBERNETES/K8s

virubiotor commented 1 month ago

The error is caused by a timeout when calling Akri webhook. I have increased the timeout for it in c976b83

CESARDELATORRE commented 1 month ago

Fixed. Closing.