Set–ClusterConfig - anongitmous/k8sShell GitHub Wiki

Load cluster configuration settings into the current PowerShell session.

Syntax

Set-ClusterConfig

[-ClusterKey] <String>
[-PersistedConfig <String>]
[-PassThru]
[<CommonParameters>]

Description

Load cluster configuration settings into the current PowerShell session, optionally loading a new persisted configuration file as well.

When a new ClusterKey is specified, the console title is updated with the key value.

In this way, it's easy to see which console is configured for a given cluster.

See the example output.

Examples

ℹ️ See A Note about the Examples

1. Load the cluster configuration for the 'qa1' cluster

Set-ClusterConfig qa1

  • To see the updated values, add the -PassThru switch parameter.
  • Using aliasing, the above can be shortened to
    ksscc qa1

2. Load the persisted configuration file config.json and the cluster configuration for the 'production 4' cluster

Set-ClusterConfig prod4 -PersistedConfig config.json

  • To see the updated values, add the -PassThru switch parameter.
  • Using aliasing, the above can be shortened to
    ksscc prod4 -PersistedConfig config.json

Parameters

-ClusterKey

  • The key used to locate the target cluster configuration.
Type: <String>
Aliases:
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PersistedConfig

Type: <String>
Aliases:
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-PassThru

  • Switch parameter that controls whether the newly-loaded values are output to the console.
Type: SwitchParameter
Aliases:
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

Outputs

Mtf.Kubernetes.Config.RuntimeConfiguration

Example

image

Notes

K8sShell includes the following alias for Set-ClusterConfig:

  • ksscc

Related

⚠️ **GitHub.com Fallback** ⚠️