You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+33-3Lines changed: 33 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,8 @@ This is just a simple demonstration to get a basic understanding of how kubernet
62
62
-[Scheduling to one specific node](#scheduling-to-one-specific-node)
63
63
-[Annotating pods](#Annotating-pods)
64
64
-[Looking up an objects annotations](#looking-up-an-objects-annotations)
65
+
-[Adding and modifying annotations](#adding-and-modifying-annotations)
66
+
-[Using namespace to group resources](#using-namespace-to-group-resources)
65
67
66
68
4.[Todo](#todo)
67
69
@@ -280,7 +282,7 @@ Now that you have your app packaged inside a container image and made available
280
282
281
283
Setting up a full-fledged, multi-node Kubernetes cluster isn’t a simple task, especially if you’re not well-versed in Linux and networking administration. A proper Kubernetes install spans multiple physical or virtual machines and requires the networking to be set up properly so that all the containers running inside the Kubernetes cluster can connect to each other through the same flat networking space.
282
284
283
-
####Running a local single node Kubernetes cluster with Minikube
285
+
### Running a local single node Kubernetes cluster with Minikube
284
286
285
287
The simplest and quickest path to a fully functioning Kubernetes cluster is by using Minikube. Minikube is a tool that sets up a single-node cluster that’s great for both testing Kubernetes and developing apps locally.
286
288
@@ -692,11 +694,39 @@ A great use to annotating pods is to add desciption to each pod or other API obj
692
694
693
695
Let’s see an example of an annotation that Kubernetes added automatically to the pod you created in the previous section. To see the annotations, you’ll need to request the full YAML of the pod or use the `kubectl describe` command. You’ll use the first option in the following listing.
Without going into too many details, as you can see, the `kubernetes.io/created-by`
709
+
annotation holds JSON data about the object that created the pod. That’s not something
710
+
you’d want to put into a label. Labels should be **short**, whereas annotations can
711
+
contain relatively large blobs of data **(up to 256 KB in total)**.
712
+
713
+
**Important**:- The kubernetes.io/created-by annotations was deprecated in version
714
+
`1.8`and will be removed in `1.9`, so you will no longer see it in the YAML.
715
+
716
+
#### Adding and modifying annotations
717
+
718
+
Annotations can obviously be added to pods at creation time, the same way label can. But we can also add it after using the following command. Let's try adding this to `kubia-manual` pod now.
719
+
720
+
`kubectl annotate pod kubia-manual knrt10.github.io/someannotation="messi ronaldo"`
721
+
722
+
You added the annotation `knrt10.github.io/someannotation` with the value `messi ronaldo`. It’s a good idea to use this format for annotation keys to prevent key collisions. When different tools or libraries add annotations to objects, they may accidentally override each other’s annotations if they don’t use unique prefixes like you did here. You can check your pod now using following command
723
+
724
+
`kubectl describe po kubia-manual`
725
+
726
+
### Using namespace to group resources
727
+
728
+
Previously we saw how labels organize pods and objects into groups.
0 commit comments