Posts
Faster way to restart static pods after configuraiton changes
In the past several days, I practiced several exercises for my coming CKS exam. I noticed that it takes a while to get static pods restart after configuraiton changes. I was curious if there is any faster way to make that happen. I think the following ways definitely will be faster than waiting 3 minutes after I used them for a while. The observable time is shorter than 3 minutes
Posts
Convert statistics information columns to rows in sql
I encountered an issue how to get detailed information based on statistics information such as minimum and maximum values in a dataset. The traditional way might be use case expression,coalese functions etc to archive the goals, However I felt it is quite clumsy.
How do it in a neat way? In SQL standard, there is a way using unpivot to transform columns to rows. It is a good fit for this situation to get a neat SQL statement to resolve the issue.
Posts
Resolve the error that The Pod xxx is invalid: spec.containers[0].volumeMounts[1].name: Not found
I encountered the issue yesterday during my exercise in killer CKA similator. However I made the same mistakes again. I think it worth to write it down to avoid I make the same mistake again.
In my day to day works, I usually add volumes before containers in the spec section of pods. In exams, sometimes I need to add extra volumes into a existing pod extracted from a running pod, and I still add volumes in the old way.
Posts
Beyond High Availability: The Importance of FMEA in Ensuring Uninterrupted Operations
Beyond High Availability: The Importance of FMEA in Ensuring Uninterrupted Operations
Introduction
In an increasingly interconnected and data-driven world, high availability is a critical component for any system or infrastructure. High availability ensures that a system can continue to operate and deliver its services, even in the face of hardware failures, software glitches, or other unforeseen disruptions. However, high availability alone is not enough to guarantee uninterrupted operations. To achieve true resilience, it’s essential to complement high availability with a proactive approach to risk assessment and mitigation.
Posts
Skip first line before running xargs
Do you know how to skip first line before data pipe into xargs?
Today I need to export custom resources and want to avoid error messages because the column names line in the output of kubectl. I knew there is a command line option (--no-headers) of kubectl and managed to get the option, but I don’t want to spend time to search the option in future. Is there any way to skip first line before data pipe into xargs?
Posts
Change appsettings.json without restart in app service
Nowadays, zero downtime is normal, you can’t believe that in azure app service changes in "app settings", App Service triggers an app restart. The alternative ways to do avoid that is to use sentinel key with App Configuration. however App Configuration will cost a little. Do we really need to use App Configuration to achieve that ?
The naive and obvious way is that changing appsettings.json files via entering the app services using kudo console.
Posts
Get information from internet in excel, custom function vs powerquery
Last week I worked on filling info package information to a workbooks. I used VBA macro before and thought of it again to save some of my time.
Things is changing very fast, the new javascript based custom fuction is the mainstream. The initial one I followed the tutorial, however I didn’t find any way to add it into "My Addin" as described in microsoft doc site. I don’t have administrator rights on my laptop.
Posts
Generate a customized rule of spectral using chatgpt
Background I didn’t find a rule implementation of spectral at stoplightio and github to lint the rule that resources should be nouns in REST API. stoplight mentions that Use Nouns for Resource Names, however there is no another article about that. I was bothered by that for a while to the point I want to give it a try to implement my rule for that.
There are several existing implementations about this rule.
Posts
Scaffold Identity into an MVC project without existing authorization
Today I tried to integrate identity into mvc projects. The main doc about this is at https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-7.0&tabs=netcore-cli#scaffold-identity-into-an-mvc-project-without-existing-authorization
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design dotnet add package Microsoft.EntityFrameworkCore.Design dotnet add package Microsoft.AspNetCore.Identity.EntityFrameworkCore dotnet add package Microsoft.AspNetCore.Identity.UI dotnet add package Microsoft.EntityFrameworkCore.Tools # add second dbcontext for identity and authorinization, use database sqlite dotnet aspnet-codegenerator identity -dc MyApplication.Data.ApplicationDbContext \ --files "Account.Register;Account.Login" --databaseProvider sqlite dotnet ef migrations add CreateIdentitySchema \ --context MyApplication.Data.ApplicationDbContext dotnet ef database update \ --context MyApplication.
Posts
Kubernetes beyond 5k nodes etcd-sharding
Background I was once asked how to run big scaled kubernetes clusters regarding etcd size limitation. For example how to handle 8G limitations. I was not satisfied with my answers such as increasing memory, compaction & defragmentation as I knew there were several big scale clusters in several companies and 8GB might be a hard limit. However I didn’t have any clues how they make that happened.
Since then, I kept tabs on etcd by reading etcd community meeting (Public).