diff --git a/CHANGELOG.md b/CHANGELOG.md index bb1a694..4f04f65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.2.0 + +### Added + +- Support for imagepullsecret flag on krayt create command + - Allows pulling from private container registries by specifying an image pull secret + ## 0.1.0 ### Added diff --git a/README.md b/README.md index 01ff9fb..fc9dd26 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,12 @@ This will install the `krayt` command to `/usr/local/bin`. # Create a new inspector and apply it directly krayt create | kubectl apply -f - +# Use a custom image +krayt create --image custom-image:latest | kubectl apply -f - + +# Use a private image with pull secret +krayt create --image private-registry.com/image:latest --imagepullsecret my-registry-secret | kubectl apply -f - + # Or review the manifest first krayt create > inspector.yaml kubectl apply -f inspector.yaml diff --git a/krayt.py b/krayt.py index 1edee10..d602a34 100755 --- a/krayt.py +++ b/krayt.py @@ -336,6 +336,7 @@ def create_inspector_job( volume_mounts: list, volumes: list, image: str = "alpine:latest", + imagepullsecret: Optional[str] = None, ): """Create a Krayt inspector job with the given mounts""" timestamp = int(time.time()) @@ -532,6 +533,7 @@ def create_inspector_job( } ], "volumes": [format_volume(v) for v in volumes if format_volume(v)], + "imagePullSecrets": [{"name": imagepullsecret}] if imagepullsecret else None, "restartPolicy": "Never", }, }, @@ -777,6 +779,11 @@ def create( "-i", help="Container image to use for the inspector pod", ), + imagepullsecret: Optional[str] = typer.Option( + None, + "--imagepullsecret", + help="Name of the image pull secret to use for pulling private images", + ), ): """ Krack open a Krayt dragon! Create an inspector pod to explore what's inside your volumes. @@ -804,6 +811,7 @@ def create( volume_mounts, volumes, image=image, + imagepullsecret=imagepullsecret, ) # Output the job manifest diff --git a/version b/version index 6e8bf73..0ea3a94 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.1.0 +0.2.0