KubeEdge is an open-source system extending native containerized application orchestration and device management to hosts at the edge. One of the main disadvantages of edge computing is the lack of an effective resource allocation and privacy-preserving framework. The objective of this study dynamic task offloading is an important concept in resource allocation and privacy-preserving framework in Kubeedge-based edge computing using machine learning. This research focuses on enhancing the efficiency and security of edge computing within the framework of IoT devices within a KubeEdge cluster. It begins by gathering crucial data on computational power, memory, and network bandwidth from IoT devices, which is essential for informed decision-making. The study evaluates KubeEdge in terms of computational resource distribution and delay, introducing a privacy-preserving multi-layer Blockchain-enabled data aggregation mechanism. This approach ensures efficient data storage with adaptable and reliable data access control. The research addresses privacy concerns in IoT applications, balancing information loss and disclosure risk, and highlights the impact of forwarding traffic on cluster throughput and service delays in edge computing environments. Dynamic resource allocation algorithms are employed, considering profiling data and machine learning models for real-time task offloading decisions, guaranteeing sufficient allocated resources. A Multi-Agent Collaborative-Reinforcement Learning with Salp Swarm Algorithm is proposed for resource allocation in the edge computing environment, enhancing resource efficiency and secrecy performance. Blockchain ensures secure and transparent transactions, reinforcing trust in the dynamic edge environment. Reinforcement learning optimizes task offloading decisions, adapting to changing conditions. Auction games introduce a competitive mechanism, enhancing efficiency in resource allocation. When combined, they create a robust framework where blockchain guarantees data integrity, reinforcement learning optimizes resource usage, and auction games introduce a fair and efficient task allocation mechanism, ensuring both performance and privacy in computing environments. Furthermore, a Partitioning-Dynamic Collaborative energy-aware task offloading scheme is developed to securely offload tasks while preserving data privacy, enhancing trust computing and task offloading capabilities. The study also proposes a Hybrid Greedy Randomized Adaptive Stackelberg-Auction Game Approach to optimize offloading performance, reduce information loss, and decrease time consumption. This comprehensive framework includes task scheduling to reduce energy consumption, enhance privacy, and security, and reduce latency. The proposed work is analysed based on the Matlab software, and it shows a higher edge offloading rate and lower resource consumption for massive task scenarios in the edge network. Continuous performance evaluation of resource utilization, response time, and privacy protection further improves offloading decision accuracy over time. [ABSTRACT FROM AUTHOR]