cloud-builders icon indicating copy to clipboard operation
cloud-builders copied to clipboard

[FR] Could you provide any way to add '--internal-ip' flag when we do 'clusters get-credential'?

Open river-kang opened this issue 3 years ago • 1 comments

Notice

To request a feature in the hosted Google Cloud Build service, please contact your Google Cloud Support representative or suggest your feature using Google's public issue tracker.

This GitHub issue tracker is intended for feature requests in the officially supported builder images only. This issue tracker is not the right place to request features like triggers or notifications.

If you're not sure where to suggest your feature, use Google's public issue tracker.

Detailed Feature Information

Which builder is relevant to this request? kubectl

Is your feature request related to a problem? Please describe. My Cloud Build Private Pool requires direct access to GKE private cluster's control plane using its private IP for CD pipeline configuration. (VPN Tunneling has been enabled already according to the guide https://cloud.google.com/architecture/accessing-private-gke-clusters-with-cloud-build-private-pools. However, current kubectl build does not provide any way to add '--internal-ip' flag when cluster credential is fetched.

Describe the solution you'd like Example: Add an environment variable which indicates the setting of '--internal-ip' flag. If I set that env variable is true, then '--internal-ip' flag is added during fetching cluster credentials as below.

gcloud container clusters get-credentials --internal-ip --zone "$CLOUDSDK_COMPUTE_ZONE" "$CLOUDSDK_CONTAINER_CLUSTER"

Describe alternatives you've considered

Additional context In kubectl.bash, following lines may be modified.

if [ -n "$region" ]; then echoerr "Running: gcloud container clusters get-credentials --project="$project" --region="$region" "$cluster"" gcloud container clusters get-credentials --project="$project" --region="$region" "$cluster" || exit else echoerr "Running: gcloud container clusters get-credentials --project="$project" --zone="$zone" "$cluster"" gcloud container clusters get-credentials --project="$project" --zone="$zone" "$cluster" || exit fi

river-kang avatar Mar 04 '22 00:03 river-kang

@river-kang I think this is a duplication from #810

tiaguinho avatar Mar 24 '22 18:03 tiaguinho

Closing this as duplicate for #810

haroonc avatar Feb 27 '24 22:02 haroonc