Wednesday, April 1, 2020

You can be a Certified Kubernetes Application Developer too!

What is CKAD

The Certified Kubernetes Application Developer (CKAD) program has been developed by the Cloud Native Computing Foundation (CNCF), in collaboration with The Linux Foundation, to help expand the Kubernetes ecosystem through standardized training and certification. As one of the highest velocity projects in the history of open source, Kubernetes use is exploding.

Why CKAD

The Cloud Native Computing Foundation is committed to growing the community of Kubernetes-knowledgeable application developers, thereby enabling continued growth across the broad set of organizations a using the technology. Certification is a key step in that process, allowing certified application developers to quickly establish their credibility and value in the job market, and also allowing companies to more quickly hire high-quality teams to support their growth.
Once I learned that CKAD is all hands on labs, it immediately caught my attention for serveral reasons:
  • Challenging than multiple choice
  • A certificate that not many have obtained so far
  • Microsoft Loves opensource and I love Kubernetes

Preparation #1

I didn't prepare much, I thought i'm good at exams! Ok, I was, I ranked 4th out of 140,000 students in college entrance exam but I clearly forgot how I achieved that. I thought I know kubernetes well, both as an architect and as a developer, I've read books, and have plenty of hands on POC built, and worst scenario, I have a free retake exam even if I failed. So I booked the exam and took it.
I did however googled a few prep exercise and "looked" at it. All those commands look familiar and simple, I can do it... Thought swimming is simple by just looking, correct? Big mistake here.
Yes, I failed my first exam... 55%... need 66% to pass, and I was very close, I just didn't have enough time, After 1h 40 minutes, I realise I just finished a little bit over half of the questions. I had a panic attack. Some of the questions were easy but I often missed a bit of here and there, resulting in debugging that is time consuming...

Preparation #2

I learned the lesson, I need to practice. It took about 2-3 days very intense practise. That's it, no tips, just practise all the questions here. There are some duplicates, but does that matter, it just means practise twice. Total of 300 questions. If you can do these (not in your head) in a cluster, you can do the exam.
Familiarise myself with all the tasks and tutorials in the official https://kubernetes.io webiste. I had O'Reilly subscription which give me a sandbox Kubernetes environment in a few clicks and I can practise whenever I want.
I used all the tips that was mentioned in the articles listed below, and here are few of mine that you won't find anywhere else:
  • Before the exam starts, use the notebook to write down 1 to 19. When the exam starts and you start to solve problems, you can write the point % next to the number, as well as if you are 100% confident, or need to review, is it hard or is it time consuming, or simply passed because it doesn't worth much.
  • 20 minutes before the exam finishes, have a look at your notebook and decides which problem gives you the best bang for bucks. You should be able to solve 3 problems in 20 minutes, and get those that offer best points for time.
  • Use a direct command instead of declarative definition, but save the yaml to q_id.yaml file so you can always go back to edit it.
  • If you know how to validate, i think it is still worse validate your solution. However, you need to be very fast!
  • Take the exam and you will see the need to practise, then take the retake like me :)
I passed the exam with 92% the second time. The question is different to my first attempt but do share some similarity. Admittedly I didn't even see all the questions from my first attempt. I finished all the questions, probably most in the first 1h30 minutes. I have confident that they are all correct as i run command against to validate the results. I'd say it is a very simple exam if you practise.
Certified Kubernetes Application Developer CKAD

Final tips

Linux foundation is running a 30% discount promotion so secure your exam today and you can take that in the next 12 months! Offer ends 7th April.

Other articles you should read to better prepare CKAD

Monday, July 8, 2019

Docker inspect image content tricks

Sometimes one might wonder what exactly the image looks like once run as a container. This is particularly useful for debugging. 

Docker run command help us solve this problem. 

docker run -it --rm to do two things, first, automatically use the current terminal to connect to the container, and then when the container finishes, remove it.  Now we change the entry point to use bash (or cmd.exe for windows containers).

c:\Docker>docker run -it --rm --entrypoint "bash" reposit:v4
root@35b518b7b518:/home/reposit# ls
data  node_modules  package-lock.json  package.json  repositConnector.js
root@35b518b7b518:/home/reposit#

Sunday, June 9, 2019

Export Azure DevOps TFVC repo to Github

Step 1:
Azure TFVC Repo -> Azure Git Repo 
https://docs.microsoft.com/en-us/azure/devops/learn/git/migrate-from-tfvc-to-git

Step 2:
Azure Git Repo -> GitHub

  1. Enable alternate authentication credentials and specify user name and password
  2. Go to a repository of your project (Code=>Files), click Clone to get the HTTPS URL.
  3. Go to Github=>Import repository
  4. Type repository URL (step 2)
  5. Type alternate authentication credentials (step 1) when it asks for credential
https://developercommunity.visualstudio.com/content/problem/449985/export-devops-repos-to-github.html

Wednesday, February 26, 2014

Microsoft.SqlServer.Management.SMO

Hi All,

I’ve been using SMO heavily in my OSR data migration piece of work, and I’d like to share that with you.  To put SMO into context, I consider it as a programmatic way to interact with SSMS.
For CRUD actions, SqlClient is still very good. Very flexible compared to entity framework.
However, when we need extra flexibility, e.g., create/backup database, create/alter tables, especially running SQL with GO statement, SMO is the way to go.   

I’ve attached a Util class that demonstrates how it can be wrapped, and the dynamic SQL that gets generated by my program and executed via the Util class.

If you would like to know more, plenty of articles on MSND:
SQL Server Management Objects (SMO) is a collection of objects that are designed for programming all aspects of managing Microsoft SQL Server


Sqlserver nvarchar ntext difference

Thanks to Graeme for asking an interesting question about the difference between nvarchar and varchar. Since my first language can’t be stored in ACSII, I know nvarchar is the way to go.
Further reading on nvarchar(max) prompted us to think the differences between nvarchar and ntext, and we found the following in MSDN. 

ntext , text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

Don’t panic, further version doesn’t include SQLServer 2012.  Read more here: