Download URL:

  1. Input the “name” of the pod and “namespace” of the pod to the “xxx.json”. Example is “example/test.json
  2. Run “./k8sTcpdump -p xxx.json” and it will bring up pods on the corresponding nodes to capture the network traces of the target pods. The ‘.cap’ file will be downloaded to the current folder.

You could refer to the GIF https://github.com/Shuanglu/k8sTcpdump/blob/main/doc/k8sTcpdump.gif as well

Glossary:

  1. Native client

A type of client application that is installed natively on a device. It’s behalf of the human user while authenticating with AAD. We name it “kubectl app” in this article.

2. Web Client

A type of client application that executes all code on a web server, and…

Access the Azure Container Registry using Azure Managed Identity programatically

  1. Install the MSI to the VM

2. Get the ARM access token from the MSI endpoint

response=$(curl 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fmanagement.azure.com%2F' -H Metadata:true -s) access_token=$(echo $response | python -c 'import sys, json; print (json.load(sys.stdin)["access_token"])') client_id=$(echo $response | python -c 'import sys, json; print…
  1. Change the timezone in the image(below commands needs to be modified according to the Linux distribution)
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Singapore /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata

2. Change the timezone via k8s mount hostPath

spec:containers:- name: nginximage: nginxports:- containerPort: 80name: nginxvolumeMounts:- name: tz-configmountPath: /etc/localtimevolumes:- name: tz-confighostPath:path:  /usr/share/zoneinfo/Asia/Singapore

ShuangLu

Interested in CloudNative | CKA&Azure Associate Admin&ITIL | https://github.com/Shuanglu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store