Skip to content

[kots]: add firewall check for the pull registry #11111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions install/kots/manifests/kots-preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,32 @@ spec:
- '{{repl ConfigOption "store_s3_access_key_id" }}' # S3_ACCESS_KEY_ID
- '{{repl ConfigOption "store_s3_secret_access_key" }}' # S3_SECRET_ACCESS_KEY
- '{{repl ConfigOption "store_s3_bucket" }}' # S3_BUCKET_NAME
- run:
# Check that the pull registry is accessible from the cluster
collectorName: ping-registry
image: alpine/curl
name: ping-registry
command:
- /bin/sh
- -c
args:
- |
CONNECTION="error"

if [ '{{repl HasLocalRegistry }}' = "true" ];
then
# Don't test for airgapped
CONNECTION="ok"
else
URL="https://eu.gcr.io/v2/"
echo "ping ${URL}"
if curl --silent --max-time 5 "${URL}" > /dev/null;
then
CONNECTION="ok"
fi
fi

echo "connection: ${CONNECTION}"
analyzers:
- clusterVersion:
outcomes:
Expand Down Expand Up @@ -206,3 +232,13 @@ spec:
message: Object storage connection is valid
- fail:
message: Object storage connection is invalid. Please check your settings and that the resource is accessible from your cluster
- textAnalyze:
checkName: Pull registry is accessible from cluster
fileName: ping-registry/ping-registry.log
regexGroups: 'connection: (?P<Connection>\w+)'
outcomes:
- pass:
when: "Connection == ok"
message: Registry is accessible
- fail:
message: Registry is inaccessible. Please check your network and firewall settings
25 changes: 25 additions & 0 deletions install/kots/manifests/kots-support-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,31 @@ spec:
- '{{repl ConfigOption "store_s3_access_key_id" }}' # S3_ACCESS_KEY_ID
- '{{repl ConfigOption "store_s3_secret_access_key" }}' # S3_SECRET_ACCESS_KEY
- '{{repl ConfigOption "store_s3_bucket" }}' # S3_BUCKET_NAME
- run:
collectorName: ping-registry
image: alpine/curl
name: ping-registry
command:
- /bin/sh
- -c
args:
- |
CONNECTION="error"

if [ '{{repl HasLocalRegistry }}' = "true" ];
then
# Don't test for airgapped
CONNECTION="ok"
else
URL="https://eu.gcr.io/v2/"
echo "ping ${URL}"
if curl --silent --max-time 5 "${URL}" > /dev/null;
then
CONNECTION="ok"
fi
fi

echo "connection: ${CONNECTION}"
- clusterInfo: {}
- clusterResources: {}
- logs:
Expand Down