Kubernetes User Interface - kubernetes

I was going through a Kubernetes tutorial on Youtube and found the following UI which demonstrates pod and service arrangements of Kubernetes cluster.How can I install this UI in my Kubernetes setup?

In order to use this UI, go to the saturnism/gcp-live-k8s-visualizer GitHub repo and follow the steps, there.

The code for that UI is from https://github.com/brendandburns/gcp-live-k8s-visualizer.

the visualizer expects some specific tags to be on the pods / services for them to be displayed. It was built for a demo and I don't think it was generalized to work on arbitrary deployments
As Robert Bailey pointed out, the versions of brendendburns and saturnism are not generealized scripts, but require little modifications on your resource labels (such as labeling things with "name" or "uses").
Maybe this version can help you:
https://github.com/0ortmann/k8s-visualizer
It features minimalistic configuration options. You can configure labels you want the script to use. You do not need to change your actual setup.
Please contact me if you run into issues.

Related

how should i create YAML files for the apps i intend to deploy?

i'm completely new to Kubernetes so forgive me if im asking some dumb questions :-0
when you deploy apps to k8s, you usually write up some yaml files for the app right?
how do you know which k8s objects you should make config file for?
for example, im following a tutorial that deploys mysql on k8s and it says i would need deployment.yaml, secret.yaml, pv.yaml, pvc.yaml and service.yaml but how do you know in the first place you need these config files in order to successfully deploy mysql app?
are there any guide or standard to follow on this matter? all the tutorials or documentations i been watching and reading dont tell me which objects to define for a particular app and why.
i feel like i dont understand k8s at all or seriously missing some import points here
thanks for the answer in advance!!
i've been googling to find answers on the question but can't find any concrete one yet :(
To answer your question in short:
Use Visual Studio Code Kubernetes Tools for a quick generation of deployment manifests (yaml files)
Learn what each key and value in deployment manifests means by reading the docs and modify generated manifests accordingly.
This is way to broad to give a decent answer for, but to make it short. Mentioned files "deployment.yaml, secret.yaml, pv.yaml, pvc.yaml and service.yam" are not specific to only mysql, it's just what you need to deploy your app on Kubernetes. It's not exactly a entry friendly topic and there is just about no reason to write down entire tutorial just for this post, as there is plenty of sources available, so I will just recommend those that I remember helped me:
"you need to learn Kubernetes RIGHT NOW!!" By NetworkChuck
https://www.youtube.com/watch?v=7bA0gTroJjw
"Kubernetes Tutorial for Beginners" by TechWorld with Nana
https://www.youtube.com/watch?v=X48VuDVv0do
And then there is official documentation: https://kubernetes.io/docs/home/
I'd also not skip on paying for some test clusters with the hosting provider, as you will find out that quite a chunk of those files are pre-generated by them.
Hope this helps

WSO2 API Manager Kubernetes deployment

so I'm using this repo
https://github.com/wso2/kubernetes-apim/blob/master/simple/am-single/README.md
To deploy WSO2 to an AKS service.
I have my pods setup, as well as services and ingresses.
The thing is I can't access my services.
In the beginning it told me to install the nginx-ingress, I suppose it has something to do with that. If anyone can help me get through this, it would be huge.
Yes, you have to create an Ingress Controller which allows you to bring traffic into the K8S cluster. You can refer to this document. Make sure you follow the AKS-specific section from the document. This will provision IAAS provider-specific infrastructure components that are required along with NginX. After Installing the ingress follow the instructions here.
I usually hate this kind of "rtm" answer, but it's really not worth doing a duplicata of this great documentation here.
It's worth going through the whole walkthrough even if at some point you figured out what's wrong. You'll learn a lot :)

How to modify Kubeflow source code before deploying it with Kubernetes?

I encountered the same issue as in https://github.com/kubeflow/kubeflow/issues/6014 with my Kubeflow app. The fix is very simple (just a type casting), then I would like to fix it myself and redeploy Kubeflow.
The problem is that I am running a k3s cluster on my local machine where I have installed Kubeflow bundle via Juju. Then, I cannot change the source code.
How to modify Kubeflow source code before deploying it with Kubernetes?
Should I use the manifest installation https://github.com/kubeflow/manifests#installation ? or a totally different method?
Thank you.
The bug was fixed in the last version of the manifests, then I have finally installed kubeflow directly from the manifests.
But still I am in touch with one Kubeflow developer, I will post here the right way to do modify/deploy if interested.
You got to check out their Github repo. Make changes and use kustomize to install like explained in their wiki. If you check the example folder you can see that it points to all other component folders.
https://github.com/kubeflow/manifests#install-with-a-single-command
One another hack could be, just look for the controllers in Kubernetes eg., deployments created for kubeflow, then modify them; works only if your changes are only related to Kubernetes resource definitions. I suggest going with the first option above for a clean development experience, and hey, that way can you contribute back to the kubeflow project as well, if you changes will benefit others.

Can someone explain me some use cases of helm?

I’m currently using kubernetes and I came across of helm.
Let’s say I don’t like the idea of “infecting” my kubernetes cluster with a process that is not related to my applications but I would gladly accept it if it could be beneficial.
So I made some researches but I still can’t find anything I can’t easily do by using my yaml descriptor and kubectl so for now I can’t find an use except,maybe, for the environizing.
For example (taking it from guides I read:
you can easily install application, eg. helm install nginx —> I add an nginx image to my deployment descriptor, done
repositories -> I have docker ones (where I pull my images from)
you can easily helm rollback in case of release failure-> I just change the image version to the previous one in my kubernetes descriptor, easy
What bothers me is that, at level of commands, I do pretty much the same effort (helm update->kubectl apply).
In exchange for that I have a lot of boilerplate because of keeping the directory structure helm wants and I feel like missing the control I have with plain deployment descriptors ...what am I missing?
It is totally understandable your question. For small and simple deploys the benefits is not actually that great. But when the deploy of something is very complex Helm helps a lot.
Think that you have a couple squads that develop microservice for some company. If you can make a Chart that works for most of them, the deploy of each microservices would differ only by the image and the resources required. This way you get an standardized deployment and easier to all developers.
Another use case is deploying applications which requires a lot of moving parts. For example, if you want to deploy a Grafana server on Kubernetes you're probably going to need at least a Deployment and a Configmap, then you would need a service that matches this deployment. And if you want to expose it to the internet you need an ingress too.
One relatively simple application, would require 4 different YAMLs that you would to manually configure and make sure everything is correct instead you could do a simple helm install and reuse the configuration that someone has already made, sometimes even the company who created the Application.
There are a lot of other use cases, but these two are the ones that I would say are the most common.
Here's three suggestions of ways Helm can be useful:
Your continuous deployment system somewhat routinely produces new builds and wants to send them to the Kubernetes cluster. You can use templating to specify the image name and tag in a deployment, and so helm upgrade ... --set tag=201907211931 to request a specific tag.
You might have various service-specific controls like the log level or external database hostnames. The Helm values mechanism gives a uniform way to specify them, without having to know the details of the Kubernetes YAML files.
There is a repository of pre-packaged application charts, so if you want replicated PostgreSQL with in-cluster persistent storage, that's already built for you and you can just depend on it, rather than figuring out the right combination of StatefulSets and PersistentVolumeClaims yourself.
You can combine these in interesting (and potentially complex) ways: use an in-cluster database for developer testing but use a cloud-hosted and backed-up database for production, for example, and compute the database host name based on what combination of settings are provided.
There are, of course, alternative ways to do all of these things. Kustomize in particular can change the image value fairly straightforwardly, and is notable for having been included in the kubectl tool since Kubernetes 1.14 (see also Declarative Management of Kubernetes Objects Using Kustomize in the Kubernetes documentation). The "operator" pattern gives an alternate path to install software in your cluster, but even more so than Helm you're trusting an arbitrary program with API access.

Deploying Custom Kubernetes

I have made some custom changes to k8s.io/kubernetes/kubernetes, specifically in the pkg/controllers to support some functionality of a project i’m working on. What is the canonical way to deploy & test these changes? Is there like an optional in kubectl to use a custom image of kubernetes? Thanks.
There is a ton of documentation. Try: https://github.com/kubernetes/community/blob/master/contributors/devel/testing.md
kubectl just talks to what it hopes is an API service. kubectl and the various server bits are versioned independently, and there are documented expectations for cross-version interoperability.