how to write a kubernetes manifest file cause there is no details to explan the parameters? - kubernetes

I deployed kubernetes 1.5 cluster on the aws, when I want to deploy a LNMP stack on the k8s cluster, but I find that it's difficult to wirte the manifest file, I can't find any examples on k8s official docs. so ,is there any detailed list of manifest parameters and also explan what the parameters meanings?
sorry for my poor english, hope somebody can help me ,thx

There is a full reference on their website:
k8s.io -> Documentation -> Reference -> Select your "Kubernetes API Versions"
For 1.10: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/
Unfortunately this is hard to read for a beginner. Also, there are many examples on the GitHub repo:
For 1.9: https://github.com/kubernetes/kubernetes/tree/release-1.9/examples
Since 1.10: https://github.com/kubernetes/examples

Related

where can I check the documentation of prometheus metric

In the Kubernetes environment, I'm using Prometheus.
And there, I can view lots of metrics such as kube_node_status_allocatable, kube_resourcequota,...
I want to know what this metric means. But I can't find any documentation about it.
In the repo of Kubernetes, I found this page. https://github.com/kubernetes/kube-state-metrics/blob/main/docs/resourcequota-metrics.md
But the explanation is too short.
I want to know where can I check the official documentation about it.
I want to figure out what the type means in kube_resourcequota metric.
I already checked prometheus homepages. But It can't be found.
Do I have to dig the source codes?
do you mean what is resource quota?
https://kubernetes.io/docs/concepts/policy/resource-quotas/
You'll find kube_resourcequota is same as kubectl get resourcequotas -A.

Spawning pods dynamically at runtime from another pod

Is it possible for a pod to act like a spawner? When someone calls the api service in the first pod, it should spawn a new pod. This seems like a very simple thing but I cant really figure out where to look in the docs. Someone already mentioned using operators but I dont really see how that would aid me.
Im currenlty migrating a project which uses docker as a spawner to create other dockers. I somehow need this principle to work in kubernetes pods.
Kind regards
Have you looked into Kubespawner part of JupyterHub ?
I have been trying to find alternatives to Kubespawner and Kubernetes Operators might be the answer. https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
GL

How to connect applications with services created through Kubernetes operators?

I am looking for best practices to connect applications with services. I have a database operator which creates a service, and there is an application pod which needs to connect to it. Is the following approach going to work?
The operator injects the access details into the pods as Secret and ConfigMap.
The operator identifies application pods through label selectors (e.g., connects-to: mysql).
The application pod receives service access details through environment variables.
The operator can document the environment variables and the label selectors.
If the above flow is going to work, how can I inject values into pods?
I can see a few mechanisms. Which one would be better?
PodPreset (alpha since 2017)
Initializer
MutatingAdmissionWebhook
This is the expected interaction between controllers and actors (PodPreset can be substituted with other choices):
your question is not completely clear.
if I understand your question , you can use helm with multiple values file to it.
helm install ./repo/ --name repo --values ./values.file
you can also --set command to the help to add values that are not in the values file for some reason
Looking into the question it seems to general.
For example you can find more information about "CONTAINERS & KUBERNETES - Best practices for building Kubernetes Operators and stateful apps" here.
As per documentation the most important are:
Operators exercise one of the most valuable capabilities of Kubernetes—its extensibility—through the use of CRDs and custom controllers. Operators extend the Kubernetes API to support the modernization of different categories of workloads and provide improved lifecycle management, scheduling.
Please refer to "Application management made easier with Kubernetes Operators on GCP Marketplace" As you can see - in GCP was published a set of Kubernetes operators to encapsulate best practices and end-to-end solutions for specific applications.
In stack overflow you can find discussion about CRD
As an example please see postgress opeartor with comparison between two methods to set the Postgres Operator configuration here.
In this case "The CRD-based configuration is more powerful than the one based on ConfigMaps and should be used unless there is a compatibility requirement to use an already existing configuration"
Here you can also find information "When to use configMap or a custom resource?"
Hope this help

Where is the Kubernetes YAML/JSON configuration files documentation?

Hei,
I'm looking for the documentation for Kubernetes's configuration files. The ones used by kubectl (e.g. kubectl create -f whatever.yaml).
Basically, the Kubernetes equivalent of this Docker Compose document.
I did search a lot but I didn't find much, or 404 links from old stackoverflow questions.
You could use the official API docs but a much more user-friendly way on the command line is the explain command, for example, I never remember what exactly goes into the spec of a pod, so I do:
$ kubectl explain Deployment.spec.template.spec

pod creation through kubernete api

I want to create pod using kubernete API from a code written in java. I went through the documentation available https://kubernetes.io/docs/api-reference/v1.6/#pod-v1-core but did not find it any helpful. I need to understand how the values are received to the respective API's and which fields are mandatory and optional while creation of pods.
From https://github.com/kubernetes/community/blob/master/contributors/devel/client-libraries.md
Java (OSGi)
Java (Fabric8, OSGi)