Skip to content
/ emkr Public

Extract the manifest of a specific kubernetes resource from multiple yaml documents.

License

Notifications You must be signed in to change notification settings

homirun/emkr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emkr

emkr is Extract the Manifest for a specific Kubernetes Resource

Usage

Extract Kubernetes manifests that match the specified key and value.

$ cat multiple_documents.yaml | emkr -k kind -v Deployment

> ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: hoge-deployment
    labels:
      app: hoge
  spec:
    replicas: 3
    selector:
      matchLabels:
        app: hoge
    template:
      metadata:
        labels:
          app: hoge
      spec:
        containers:
        - name: apps
          image: hogeapp:1.0
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: fuga-deployment
    labels:
      app: fuga
  spec:
    replicas: 3
    selector:
      matchLabels:
        app: fuga
    template:
      metadata:
        labels:
          app: fuga
      spec:
        containers:
        - name: apps
          image: fugaapp:1.0
$ cat multiple_documents.yaml | emkr -k metadata.labels.app -v hoge

>  ---
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: hoge-deployment
     labels:
       app: hoge
   spec:
     replicas: 3
     selector:
       matchLabels:
         app: hoge
     template:
       metadata:
         labels:
           app: hoge
       spec:
         containers:
         - name: apps
           image: hogeapp:1.0

About

Extract the manifest of a specific kubernetes resource from multiple yaml documents.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages