Socials Media

Thứ Năm, 28 tháng 9, 2023

About me

Hi everybody 👋 My name is Hieu, but you can call me Toni

A Software Engineer 👨‍💻 Blogger and  Lecturer 🧑‍🏫

I'm a self-motivated student and researcher who graduated from Hanoi University Of Science and Technology 😉. My major is Information and Communication Engineering. I have more than seven years of experience in IT field, with a deep-dive in Cloud Computing and Networking. I'm passionate about cutting-edge technologies: Cloud Computing ☁️, Security 🕵️, AI/ML🤖,...

🌍 Currently, I'm living in Ha Long City, Vietnam, where I'm conducting independent research and teaching at MindX Technology Ha Long.

My hobbies are exercising 🏃‍♂️, traveling ✈️, studying languages 📖. 

During my leisure time, I write blogs and stuff about life and technology 🧑🏻‍💻.

Contact me via:

Linkedin: https://www.linkedin.com/in/hieutv96

Gmail: tovanhieu1996.hl@gmail.com

Github: https://github.com/tovanhieu

Facebook: https://www.facebook.com/profile.php?id=100010855276896&locale=vi_VN

Twitter: https://twitter.com/hieutv96

Here are some of my favorite books:

















Share:

Thứ Tư, 27 tháng 9, 2023

Key concepts of Operating System

Operating systems (OS) are fundamental software that manage and control computer hardware, resources, and processes. They provide a platform for running applications and play a crucial role in resource allocation and user interaction.

Most of the development of modern operating systems has focused on networking, distribution, reliability, protection, and security. Several widely used operating systems are available today:

  • Microsoft Windows: Windows XP, Vista, 7, 8, 10, 11.
  • Linux
  • OSF
  • Solaris
  • IRIS (Silicon Graphics)
  • OS2 (IBM)
  • MacOS X (Apple)


Fig 1: Abstract views of computer system



Fig 2: Basic structure of Operating System


Fig 3: Structure of a typical operating system

 Here are key concepts associated with operating systems:

  1. Kernel:
    • The core component of an OS that interacts directly with the hardware.
    • Manages system resources, such as CPU, memory, and I/O devices.
  1. Process Management:
    • Handles the creation, scheduling, and termination of processes (individual programs).
    • Allocates CPU time and manages process communication and synchronization.
  1. Memory Management:
    • Manages physical and virtual memory to ensure efficient use of RAM.
    • Includes tasks like memory allocation, swapping, and paging.
  1. File System:
    • Provides a hierarchical structure for organizing and storing files and directories.
    • Manages file access, permissions, and storage.
  1. Device Management:
    • Controls communication with I/O devices, such as disks, keyboards, and network interfaces.
    • Provides device drivers for hardware interaction.
  1. User Interface:
    • Offers interfaces for user interaction, including graphical user interfaces (GUIs) and command-line interfaces (CLIs).
    • Handles input and output for users and applications.
  1. Security and Access Control:
    • Enforces user authentication and authorization.
    • Implements security policies to protect data and resources.
  1. Networking:
    • Manages network connections and protocols for communication between devices.
    • Supports network services like file sharing and printing.
  1. Multiuser and Multitasking:
    • Allows multiple users to interact with the system simultaneously.
    • Supports multitasking, where multiple processes run concurrently.
  1. Concurrency and Synchronization:
    • Ensures safe access to shared resources among multiple processes.
    • Uses synchronization mechanisms like semaphores and mutexes.
  1. Process Communication:
    • Facilitates communication and data exchange between processes, such as message passing and interprocess communication (IPC) mechanisms.
  1. Boot Process:
    • Manages the system startup sequence, loading the OS into memory from storage devices.
    • Initializes system resources.
  1. Error Handling and Fault Tolerance:
    • Detects and handles errors, both hardware and software.
    • May include fault tolerance mechanisms for system reliability.
  1. Virtualization:
    • Provides the ability to run multiple virtual machines (VMs) or containers on a single physical server.
    • Offers isolation and resource allocation for each virtual instance.
  1. System Calls:
    • Interface between user-level applications and the kernel.
    • Allows applications to request OS services like file I/O, process creation, and network communication.
  1. Performance Monitoring and Optimization:
    • Monitors system performance, including CPU usage, memory utilization, and disk activity.
    • Optimizes resource allocation to improve system efficiency.
  1. Upgrades and Patching:
    • Supports OS updates, patches, and security fixes.
    • Ensures compatibility with new hardware and software.
  1. Distributed Systems:
    • Manages resources and processes across multiple networked computers.
    • Includes distributed file systems, distributed computing, and cloud computing.

Understanding these key concepts is essential for working with operating systems, whether you're a system administrator, developer, or IT professional. Different operating systems (e.g., Windows, Linux, macOS) implement these concepts in various ways, and specialized OSes may focus on specific use cases (e.g., real-time operating systems, embedded systems).

Reference links:

Share:

Thứ Tư, 30 tháng 8, 2023

Thiền là gì và lợi ích của thiền ?

 Thiền - Meditation


💁‍♂️Một kênh youtube của thầy Minh Niệm rất hay về thiền mà mình thường nghe vào mỗi buổi sáng sớm khi thức dậy có cả radio bằng tiếng Anh nhưng chủ yếu là tiếng Việt các bạn có thể xem video ở cuối bài viết. Khái niệm về thiền - meditation có lẽ đối với các bạn trẻ thì nó khá là mới mẻ nhưng đối với một số người lớn tuổi đặc biệt là các cô chú trung niên trở đi thì nó không còn xa lạ gì, ngày nay thiền đang ngày càng trở nên phổ biến và nó dần như trở thành một phần không thể thiếu trong cuộc sống của chúng ta. Mình sẽ khái quát lại một số nội dung chính như sau:
- Khái niệm thiền - meditation: là một phương pháp cân bằng tinh thần xuất hiện trong nhiều nền văn hóa và tôn giáo khác nhau. Về cơ bản, thiền là một quá trình tập trung tinh thần nhằm thúc đẩy sự yên bình, tĩnh tâm và nhận thức sâu hơn về bản thân và thế giới xung quanh.
- 7 lợi ích chính của thiền mang lại cho chúng ta:
Giảm căng thẳng và lo âu : Thiền giúp giảm thiểu căng thẳng và lo âu bằng cách tạo ra một trạng thái tĩnh tâm, thúc đẩy sự thư giãn và xóa tan những suy nghĩ phiền muộn.
Tăng cường tập trung: Bằng cách tập trung vào trạng thái tinh thần duy nhất, thiền giúp cải thiện khả năng tập trung và tăng hiệu suất làm việc.
Tăng cường nhận thức: Thiền giúp tâm trạng, suy nghĩ và cảm xúc hiện tại một cách tích cực, từ đó tạo ra một sự nhận thức sâu hơn về bản thân.
Cải thiện sức khỏe về thể chất: Quá trình hít sâu và thở đều trong lúc thiền sẽ giúp cơ thể thư giãn và tiếp thêm nhiều oxi hơn giúp điều chỉnh nhịp tim một cách tử từ, giảm huyết áp và tăng cường sức đề kháng tạo ra một trạng thái cân bằng tốt cho sức khỏe.
Phát triển sự tự quản lý và kiểm soát: Thiền có thể giúp người tập luyện nhận biết và kiểm soát các phản ứng tự động và xử lý thông tin một cách bình thường hơn.
Tạo ra trạng thái hạnh phúc và tĩnh lặng: Thiền thường đi kèm với trạng thái hạnh phúc, yên bình và tĩnh lặng, giúp cải thiện chất lượng cuộc sống và tạo ra sự cân bằng trong tâm hồn.
Làm cho tinh thần tích cực: Thiền có thể giúp tạo ra tư duy tích cực, tăng cường niềm tin vào bản thân và khả năng giải quyết khó khăn.
Ở đây mình thích nhất lợi ích số 𝟮 , 𝟰 , 𝟳 và đặc biệt là số 𝟏. Bạn không cần phải dành quá nhiều thời gian vào thiền mỗi ngày chỉ cần khoảng 15-30 phút là đủ nếu lâu hơn thì càng tốt, như mình nếu một ngày bận quá thì sẽ chỉ dành khoảng 10-15 phút thiền vào cuối ngày trước lúc đi ngủ vì nó làm mình thư giãn cái đầu kiểu như refresh lại brain ấy 😉 đặc biệt là dễ đi vào giấc ngủ và ngủ sâu hơn rất nhiều 😃Trên đây là những chia sẻ cá nhân của mình về thiền hy vọng mọi người sẽ có được những thông tin bổ ích trong quá trình đọc.
Have a nice day ^^
Link radio video youtube của thầy Minh Niệm trong series "FINDING PEACE IN TURMOIL" mình có để ở dưới các bạn có thể subcribe kênh của thầy để nghe nhiều hơn:

Share:

Thứ Tư, 16 tháng 8, 2023

K8s key concepts

This is summury of some key concepts in K8s:

K8S contains two properties: Worker node & Master node (Control plane)


Node can contain multiple Pods, Pod can contain multiple containers

Kubectl – kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster

Minikube – minikube is known as as “Local Kubernetes engine“, minikube runs a single-node Kubernetes cluster on your personal computer (including Windows, macOS and Linux PCs) so that you can try out Kubernetes, or for daily development work

Kubeadm – Kubeadm is a tool use to built Kubernetes clusters

Kubelet– Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node.

Resources type in K8s: job, service, deployment, config map, pod, secret, statefulset, role,  name sapce, ingress,....

K8S comunicates with containers through CRI - Container runtime interface (standard by OCI). Two most types CRI common: 

+ containerd: is kinds of container run time begin from docker 

+ cri-o: develped by Redhad

Containerd architecture:


Workload: Workloads are the applications or services that you deploy and manage using Kubernetes, workload contains multiple pods.

Key Kubernetes objects arranged in a workload node:


Common workload types in K8S: 

  • Pods: The smallest deployable units in Kubernetes. A pod can contain one or more containers that share the same network namespace and storage volumes. Pods are often used to encapsulate tightly coupled application components.
  • Deployments: A higher-level abstraction that manages the scaling and rolling updates of replicated pods. Deployments ensure that a specified number of replicas (identical instances) of a pod are running at all times, allowing for easy management and scalability.
  • StatefulSets: Used for managing stateful applications that require stable network identities and storage. Each pod in a StatefulSet has a unique identity, and they are created and scaled in a controlled order.
  • DaemonSets: Ensures that a copy of a pod is running on each node in the cluster. This is often used for cluster-level services such as log collection or monitoring agents.
  • Jobs: : Used for running short-lived, batch-like tasks. Jobs create one or more pods to complete a task and then terminate the pods when the task is completed.
  • CronJobs:  A time-based job scheduler. CronJobs allow you to create and manage jobs that run on a scheduled basis, similar to the UNIX cron utility.
  • ReplicaSets: A lower-level abstraction that ensures a specified number of replicas of a pod are running at all times. Deployments are built on top of ReplicaSets and provide additional features like rolling updates and scaling.

Storage in Kubernetes (often abbreviated as K8s) refers to the mechanisms and components used to manage persistent data storage for applications running in Kubernetes clusters. Kubernetes provides various options for managing storage that cater to different use cases and requirements. Here are some key concepts and components related to storage in Kubernetes:

  • Volumes: Volumes are the basic unit of storage in Kubernetes. They represent a directory accessible to containers within a pod. Kubernetes supports several types of volumes, such as EmptyDir (temporary storage), HostPath (using the host filesystem), and various cloud provider-specific volumes.
  • Persistent Volumes (PVs) and Persistent Volume Claims (PVCs): PVs are cluster-wide storage resources provisioned by an administrator. They represent physical storage such as network-attached storage (NAS) or cloud-based storage. PVCs are used by users (developers) to request a specific amount and type of storage. A PVC can request a specific amount of storage from a PV and then be attached to a pod, allowing the pod to access the persistent data.

Storage Classes: Storage Classes are used to dynamically provision Persistent Volumes based on the user's storage requirements. Each Storage Class defines the parameters for creating PVs, such as the type of storage, provisioner, and other attributes. This allows for a more dynamic and flexible storage provisioning process.

  • Dynamic Provisioning: Kubernetes supports dynamic provisioning of storage, where a PVC can automatically create and bind to a PV without requiring manual intervention from the cluster administrator. This is facilitated by Storage Classes.
  • StatefulSets: StatefulSets are a type of workload in Kubernetes designed for managing stateful applications that require stable and unique network identities, persistent storage, and ordered deployment/scaling.
  • CSI (Container Storage Interface): The Container Storage Interface is a standard for exposing storage systems to containerized workloads in Kubernetes. It enables storage providers to develop plugins that seamlessly integrate with Kubernetes, allowing users to choose from a variety of storage solutions.
  • Volume Plugins: Kubernetes supports various volume plugins that allow integration with different storage backends, including NFS, iSCSI, AWS EBS, Azure Disk, and more. These plugins enable pods to access different types of external storage.
  • Stateful Workloads: For stateful applications like databases, Kubernetes provides mechanisms like StatefulSets and Operators to manage the deployment, scaling, and lifecycle of these applications, including their associated storage.
  • CSI Drivers: CSI drivers are components that implement the Container Storage Interface and allow Kubernetes to communicate with various storage systems. These drivers enable the integration of external storage providers into Kubernetes.

etcd is a distributed key-value store that is widely used as the primary data store for Kubernetes (K8s). It serves as the backbone of Kubernetes' control plane, storing configuration data, state information, and other critical data that the Kubernetes cluster needs to function.

Here's how etcd is used in Kubernetes:

  • Cluster State Storage: Kubernetes uses etcd to store the entire state of the cluster. This includes information about nodes, pods, services, configurations, secrets, and more. This allows Kubernetes to maintain high availability and recover from failures.
  • Configuration and Metadata: All configuration data and metadata that define the desired state of the cluster are stored in etcd. When you create or update resources (such as deployments, services, or pods), the API server writes the changes to etcd, which then serves as the single source of truth for the cluster's state.
  • Consistency and Consensus: etcd employs a consensus algorithm (Raft) to ensure that data consistency is maintained across the distributed cluster. This means that changes are only considered valid if they are replicated and agreed upon by a majority of etcd nodes.
  • High Availability: To ensure resilience, etcd can be run in a highly available configuration, with multiple etcd instances distributed across different nodes in the cluster. This minimizes the risk of data loss in case of node failures.
  • Backup and Restore: Regularly backing up etcd data is crucial to recover from disasters or data corruption. Kubernetes administrators often perform routine backups of the etcd data to ensure data integrity.
  • Security: As a critical component of the cluster, etcd must be secured. Access controls, encryption, and network segmentation are used to protect the etcd cluster from unauthorized access.

Prometheus is an open-source systems monitoring and alerting toolkit originally developed by SoundCloud. It is widely used to monitor and collect metrics from various components of software systems, helping operators gain insights into the performance, health, and behavior of their applications.


Key features of Prometheus include:

  • Multi-dimensional Data Model: Prometheus employs a flexible data model based on key-value pairs, allowing users to represent data with various dimensions. This facilitates effective monitoring and querying.
  • PromQL: Prometheus Query Language (PromQL) enables users to query collected data for analytics and alerting purposes. PromQL supports various aggregation, filtering, and transformation functions.
  • Time Series Collection: Prometheus continuously scrapes data from configured targets using a pull model. Targets can be various endpoints like HTTP, exporters, or other Prometheus instances.
  • Data Storage: Collected data is stored in a time-series database with efficient and compressed storage mechanisms. Prometheus uses its storage format, which is optimized for time-based data.
  • Alerting: Prometheus allows users to define custom alerting rules based on collected metrics. When a rule condition is met, an alert is triggered, and notifications can be sent to specified channels.
  • Visualization: Although Prometheus itself does not provide native visualization tools, it can be integrated with various visualization and dashboarding tools like Grafana.
  • Service Discovery: Prometheus has built-in support for service discovery, making it easier to dynamically discover and monitor new instances of services as they come online.
  • Exporters: Prometheus can be extended using exporters, which are specialized agents that expose metrics from various systems and applications. Many third-party exporters are available for popular services like databases, web servers, and more.
  • Scalability: Prometheus is designed to be horizontally scalable and can be configured to work in a federated mode, allowing multiple Prometheus instances to share data and queries.

Prometheus is often used as part of a larger monitoring and observability ecosystem alongside other tools like Grafana, which provides powerful visualization capabilities, and Alertmanager, which handles alert notifications. The combination of these tools can help operators maintain a clear understanding of their systems' health and performance.

As with any open-source project, it's advisable to refer to the official documentation and community resources for the most up-to-date and accurate information. You can find more information about Prometheus on its official website: https://prometheus.io/

Grafana is an open-source platform used for monitoring and observability. It allows you to visualize, analyze, and understand various metrics and data from different sources in real-time. Grafana supports a wide range of data sources, including databases, cloud services, and various monitoring systems. Some key features of Grafana include:

  • Data Visualization: Grafana provides a flexible and customizable dashboarding system where you can create interactive visualizations such as graphs, charts, and tables to represent your data.
  • Data Source Integration: Grafana supports integration with numerous data sources, including popular time-series databases like InfluxDB, Prometheus, Graphite, and Elasticsearch, as well as cloud platforms like AWS CloudWatch and Google Cloud Monitoring.
  • Alerting: You can set up alerting rules in Grafana to notify you when certain conditions are met or thresholds are exceeded. This helps in proactive monitoring and quick response to issues.
  • Templating: Grafana allows you to create dynamic dashboards by using variables that can be changed at runtime. This is useful for creating more interactive and flexible dashboards.
  • Plugins and Extensions: Grafana supports a rich ecosystem of plugins and extensions that enable additional features and integrations. These plugins can extend the functionality and allow you to create custom visualizations or data source connectors.

Community and Support: Grafana has a strong community of users and contributors, which means you can find a wealth of resources, tutorials, and documentation to help you get started and solve issues.

References:

https://kubernetes.io/docs/concepts/overview/components/

https://azuredays.com/2020/12/09/understanding-kubernetes-workload-objects/

Share:

tovanhieu-bk.blogspot.com

Tìm kiếm Blog này

Được tạo bởi Blogger.

Giới thiệu về tôi

Ảnh của tôi
Hello everybody, my name is Hieu, but you can call me Toni, I am a Software Engineer👨‍🔬 and a Blogger 👨‍💻 . My major is Information and Communication Engineering. I am passionate about cutting-edge technologies: Cloud Computing ☁️, AI/ML🤖 and Security 🕵️. During my leisure time, I write blogs and stuff about life and technology 🧑🏻‍💻. Have a nice day and enjoy while reading my blog 🥰

About me

Hi everybody 👋 My name is Hieu, but you can call me Toni A Software Engineer 👨‍💻 Blogger and  Lecturer 🧑‍🏫 I'm a self-motivated stu...

Người theo dõi