iot-usecase-k8
Deploy InfluxDB and Grafana on my kubernetes cluster
Tasks
-
Pass the namespace as Gitlab environment variable
Can I mention the environment variable inside themanifest/grafana-pv.yml
file and issue the scriptkubectl apply -f manifest/grafana-pv.yml
?
No: Because these are gitlab environment variable andkubectl
command usually do not update the yml files before applyting the resource.kubectl
expect that file contains all the necessary information and do not require any preprocessing where the variables will be replace by the actuall value -
Can I access the container in
-it
(interactive mode) present in the pod?
It is assumed that that pod contain single containery.
In this case, the syntax iskubectl exec -it [pod name] -- [command]
. For examplekubectl exec -it influxdb-78c5898b88-2l5zt -- sh
will let you invoke thesh
terminal in the container present ininfluxdb-78c5898b88-2l5zt
pod. -
What a Gitlab-agent for kubernets can do?
Please follow this section https://about.gitlab.com/blog/2021/09/10/setting-up-the-k-agent/#roles-and-bindings -
How to assign a worker role to a node?
Go to the the terminal of any node and enter thekubectl label
command:kubectl label node [nodename] node-role.kubernetes.io/worker=worker
for example:kubectl label node node2 node-role.kubernetes.io/worker=worker
-
if you delete the a node with
kubectl delete node node2
command, how can you get that back?
Simply apply the following resource usingkubectl apply
command\
{
"kind": "Node",
"apiVersion": "v1",
"metadata": {
"name": "node2",
"labels": {
"name": "node2",
"node-role.kubernetes.io/master":"master",
"kubernetes.io/hostname":"node2",
"node-role.kubernetes.io/control-plane":"control-plane"
}
}
}
-
If I have two nodes and both are having
control-plane
andmaster
, how can update the role of one node toworker
and delte the old role?
Next Tasks
-
Create a folder, for the persistent volume for the
grafana-pv.yml
andinfluxdb-pv.yml
. So instead of creating the directory for the volume manually, I want to check and create the directory automatically. - Can we have two agents?
kubernetes + GitlabCICD
[x] Install Gitlab agent on kubernetes cluster
src: https://docs.gitlab.com/ee/user/clusters/agent/install/ STATUS: Completed
[] Install Kubernetes Dashboard from Gitlab Repo
STATUS: Completed
[] Install Grafana Dashboard from Gitlab Repo
STATUS: Completed
[] Install influxDB from Gitlab Repo
STATUS: Completed
[] Install GraphDB from Gitlab Repo
Manually, I have attached a new volume of 40GB HDD to node3.
STATUS: WIP
Creation of the related resources (including PV, PVC, deployments, etc) are created from the CLI
SRC: https://hub.docker.com/r/ontotext/graphdb/