Kubernetes Fundamentals by Himanshu Agrawal
Author:Himanshu Agrawal
Language: eng
Format: epub
ISBN: 9781484297292
Publisher: Apress
Listing 5-12 A Pod Object with Annotation
You can put the template/specification code shown in Listing 5-12 in a YAML file and execute it using the kubectl create -f <<<YAML_FILE_NAME>>> command. Once the object is created, you can use the kubectl describe pod ha-annotation-pod command to check those annotations got successfully added to the pod object, as shown in Figure 5-30.
Figure 5-30 Execution logs depicting the specified annotations got successfully attached to the pod
Using annotations, you cannot select objects in the same way as in the case of labels. But using an external JSON parsing tool like the jq tool, you can select objects based on annotations. You can use the following command and verify that the pod can be selected based on annotations, as shown in Figure 5-31: kubectl get pods --output=json | jq -r '["KIND","NAME","UID","STATUS"],(.items[]|[select(.metadata.annotations["chapter-number"]="five")|.kind,.metadata.name,.metadata.uid,.status.phase])|@tsv' | column --table --separator $' '
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7748)
Grails in Action by Glen Smith Peter Ledbrook(7670)
Configuring Windows Server Hybrid Advanced Services Exam Ref AZ-801 by Chris Gill(6255)
Azure Containers Explained by Wesley Haakman & Richard Hooper(6215)
Running Windows Containers on AWS by Marcio Morales(5742)
Kotlin in Action by Dmitry Jemerov(5022)
Microsoft 365 Identity and Services Exam Guide MS-100 by Aaron Guilmette(4744)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4399)
Combating Crime on the Dark Web by Nearchos Nearchou(4333)
Microsoft Cybersecurity Architect Exam Ref SC-100 by Dwayne Natwick(4006)
The Ruby Workshop by Akshat Paul Peter Philips Dániel Szabó and Cheyne Wallace(3996)
The Age of Surveillance Capitalism by Shoshana Zuboff(3917)
Python for Security and Networking - Third Edition by José Manuel Ortega(3557)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3493)
Mastering Python for Networking and Security by José Manuel Ortega(3324)
Mastering Azure Security by Mustafa Toroman and Tom Janetscheck(3314)
Blockchain Basics by Daniel Drescher(3277)
The Ultimate Docker Container Book by Schenker Gabriel N.;(3234)
TCP IP by Todd Lammle(2962)
