In this blog post, we focus on: Writing Linting Building the Dockerfile. Our goal is to have: Cleaner Dockerfiles Smaller & Secure Images Faster builds Writing FROM Always use slim images instead of using images with whole OS in it example, use debian:stretch-slim instead of debian If possible, use official maintained images such as use node instead of debian Always give tags, example: node:10-alpine, if you dont provide tag or use latest, this might break image cache or even container image.
Continuing with previous post, Editor of your choice By default, kubectl uses default editor (which is most of the time vim or nano), you can set editor of your choice by setting the following environment variable with editor of you choice. export KUBE_EDITOR=`code --wait` Edit while you create You can edit the resource definition right before deploying whether from a file or remote link. This helps when you are deploying sample application from remote link and want to edit something before deploying.
It’s always bit of confusing about OpenShift 4 :D here’s how we can add user in OpenShift 4. Create htpasswd file as below and users and their passwords, $ htpasswd -cb users.htpasswd user1 user1pass $ htpasswd -b users.htpasswd user2 user2pass Through console, login with kube:admin user, navigate to Administration > Cluster Settings > Global Configuration Click on Edit YAML in front of Oauth Click on Overview, under Identity Providers section, Click on Add and select HTPasswd
A NodeJS developer named Warlock, recently joined his dream company as an Enterprise Developer. On day 1, his boss gave him a Code Repository & his OpenShift Platform Credentials to work his magic. Warlock got his code, git clone https://github.com/sclorg/nodejs-ex But was unclear about how to proceed as he had no idea about OpenShift. He then referred to the OpenShift docs but got confused and overwhelmed by all the new terminologies, DeploymentConfigs, Pods, Services, and Routes mentioned in it.
While exploring, I came across ko tool by google & found interesting since it buids and deploy golang applications to kubernetes easily. This post is for minikube only since I am focussing on local development. Pre-Flight Checks Installing ko go get github.com/google/go-containerregistry/cmd/ko That’s it :) Verify your installation by which ko We can mention any docker registry (local or remote) using KO_DOCKER_REPO env variable, but as we are focussing on local development, we will publish images to minikube’s docker daemon
What’s client-go ? Where’s client-go ? you can find it in kubernetes/kubernetes/staging directory and published by bot to k8s.io/client-go, kubernetes also uses client-go. it’s interesting if you see client-go from kubernetes vendor, it has symlinks to kubernetes/kubernetes/staging In this Adventure, very first step is to see how to connect to API Server :) Connecting to API Server There are two ways to talk to cluster using any go program: outside cluster: if your program is standalone and if you have either kubeconfig file or master URL.
If you have kubeconfig file already in place, kubeconfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}) There is one more function clientcmd.NewInteractiveDeferredLoadingClientConfig but as per code, we can use it only when password is allowed Namespace given by current context, namespace, _, err := kubeconfig.Namespace() REST config needed to operations restconfig, err := kubeconfig.ClientConfig() if you want kubeconfig as a struct clientcmdapi.Config, err := kubeconfig.RawConfig() Here, kubeconfig is interface of following type:
we got restConfig and namespace, connection is set up Yay From this restconfig, Now we need to create respective clients for further operations we will need following package: import k8s.io/client-go/kubernetes create basic kubernetes client: kubeClient, err := kubernetes.NewForConfig(restConfig) it returns clients for APIgroups like: Apps CoreV1 Batch StorageV1 If you have some custom controller, generated code will have NewForConfig function which you have call separately, For example, In case of service catalog,
To check devices: nmcli device status Overall status of NetworkManager: nmcli general status Display connections: nmcli connection show display only active connections: nmcli connection show --active WI-FI Check wifi status nmcli radio wifi Turn on the wifi nmcli radio wifi on Turn off the wifi nmcli radio wifi off List available wifi access points nmcli device wifi list Refresh the access point list nmcli device wifi rescan Connect to wifi nmcli device wifi connect <SSID> Connect to password protected access point nmcli device wifi connect <SSID> password <password>
Hello Folks, I appeared for the exam on 19th October 2018 and yesterday(20th Oct 2018), I got the result & I scored 92%, Yay :) I got so many request about How to prepare for the exam, Here’s my experience with preparation for the exam. A bit about Exam: Duration: 3 hours (which is fair time if you do lot of practice, I completed in 2 hours 15 mins) Questions: 24 Clusters: 6 After clearing 9 certs to become RHCA (Red Hat Certified Architect), exam environment was kind of familiar to me.