Month: April 2019

Five Minute Tip: Kubernetes helm in multiple namespaces

Five Minute Tip: Kubernetes helm in multiple namespaces

A while ago I’ve upgraded the infrastructure to work in Kubernetes and having the application separated though namespaces. I’ve created deployment files and use helm to install applications in the cluster. I’ve found that using helm in multiple namespaces requires a bit extra editing to make it work.

Assuming helm client has been installed and ready to go. We’ll create a service account:

kubectl -n myapp create serviceaccount tiller

This basically creates a serviceaccount called tiller in a namespace called myapp. Now will need to create a cluster role binding for the account.

kubectl create clusterrolebinding tiller -n myapp --clusterrole=cluster-admin --serviceaccount=myapp:tiller

The –clusterrole=cluster-admin is defining what role is the account going to have. In this case, a cluster-admin role. The account can go beyond a namespace and view resources cluster-wide. The last part –serviceaccount=myapp:some-tiller-account tells Kubernetes where to install the service account. In this case, inside the namespace myapp.

Then install helm into that namespace:

helm init --service-account tiller --tiller-namespace myapp

Oh wait, what if we need helm to work in multiple namespaces? That easy! We can recycle the last command and installed a to install a service account into a different namespace:

kubectl create clusterrolebinding some-tiller-account -n mydata --clusterrole=cluster-admin --serviceaccount=mydata:tiller

Next, will need to update the clusterrolebinding so that helm can see what’s inside of another namespace.

kubectl edit clusterrolebinding tiller -n myapp

Origonal:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: tiller
  namespace: myapp

Updated:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: tiller
  namespace: myapp
- <span style="color: rgb(255, 0, 0);" data-mce-style="color: #ff0000;">kind: ServiceAccount</span>
<span style="color: rgb(255, 0, 0);" data-mce-style="color: #ff0000;">  name: tiller</span>
<span style="color: rgb(255, 0, 0);" data-mce-style="color: #ff0000;">  namespace: mydata</span>

That it! When you do a helm install or helm ls you should beable to see inside both namespaces.

Linux: Five Minute tip

Linux: Five Minute tip

I remember when I first started as Linux System Administrator, I would google Linux command lines. Expectedly if I was looking for a command but not sure what it might be called. It was not until I came across a command called apropos. It has saved my bacon and time when I was in a bind.

Looking at the command apropos:

In computingapropos is a command to search the man page files in Unix and Unix-like operating systems. apropos takes its name from the English word with the same spelling that means relevant. It is particularly useful when searching for commands without knowing their exact names. – source: wiki – apropos

basically, this command will search through the manpages in the description and manuals for the command that is being searched. Seeing the command I action:

apropos dmesg

dmesg (1) – print or control the kernel ring buffer
vmcore-dmesg (8) – This is just a placeholder until real man page has been written

 

That’s really cool how a simple the command it. You use the man command to read the manual of the command to go more in-depth with it.

My take on this; I’m glad that I’ve found this command and it has served my well up to the is.

The Vow my wife made to me!

The Vow my wife made to me!

Letter to Frank:

From The Catburgler…

Dr. Horrible, it’s been an interesting time getting to know you. In the beginning, you were shy and I couldn’t really read you. All I knew is that your very friendly. I couldn’t tell exactly what, but I knew there was something different about you. Over the course of the following months, I got to know you more and started to like you more. Like turned to love and love turned to deep and unconditional love and respect. I remember how unsure we both were then and how confident we are now. We have changed since we met and in the best ways. You lift me up when I’m down, you show me love and respect, your considerate and logical yet love having fun. Your adventurous. When we travel together, we share an insatiable appetite for culture, good food and history. Your quiet and yet enjoy dancing with me to good jazz. When we cook, it’s like we can read each other’s thoughts and create amazing dishes together. We truly bring out the best in each other. Our personalities may be different, our schedules may be really different but at the end of the day, we make time to spend with each other. We show appreciation and gratitude toward each other. We tackle any issue fiercely together. Being married to you will be an adventure; it will have ups and downs, but I know that at the end of the day, as long as we work together, we can handle anything and have fun with life along the way.

These are my promises to you as your wife:

  1. I promise to always love you.
  2. I promise to always dance with you.
  3. I promise to encourage laughter and adventure.
  4. I promise that whatever issue we face, we face together.
  5. I promise to always be the Catburgler to your Dr. Horrible (inside joke)
  6. just like you always are positive for me, I promise to lift you up when you are down and be a positive force for both of us.
  7. I will always be your adventure and cooking buddy.
  8. I promise Dr. Potato and Fig Newton will be encouraged to tolerate each other.
  9. I promise to regularly tell you how incredible you are.
  10. Most importantly, I Promise to always be your friend, your love and your partner in life

Frank, I love you so much and I’m in awe that we get to do life together.

====

Thoughts,

I really enjoyed the letter my wife wrote to me. When she read it to me, I can feel the emotions that she was trying to express to me along the expression of joy her face. The whole time, It made feel happy and proud to be her husband.

%d bloggers like this: