sparse-nail-47035
01/04/2023, 8:02 PMval k8sCluster = new ManagedCluster(...)
I do not see any function in the ManagedCluster class that I can use to export the KubeConfig object. Is there any mechanism in the API that can be used to build a KubeConfig from a clsuer instance?billowy-army-68599
01/04/2023, 8:05 PMctx.export
method:
import com.pulumi.Context;
ctx.export("kubeconfig" ...)
many-telephone-49025
01/04/2023, 8:09 PMkubeconfig
Output<String> kubeconfig = Output.all(minecraftGroup.name(), mc.name()).apply(values -> {
try {
CompletableFuture<ListManagedClusterUserCredentialsResult> cred = ContainerserviceFunctions.listManagedClusterUserCredentials(ListManagedClusterUserCredentialsArgs.builder()
.resourceGroupName(values.get(0))
.resourceName(values.get(1)).build());
String kubeconfigString = cred.get().kubeconfigs().get(0).value();
byte[] decodedBytes = Base64.getDecoder().decode(kubeconfigString);
return Output.of(new String(decodedBytes));
} catch (Exception e) {
throw new RuntimeException(e);
}
});
sparse-nail-47035
01/04/2023, 8:14 PMmany-telephone-49025
01/04/2023, 8:18 PMsparse-nail-47035
01/04/2023, 8:19 PMmany-telephone-49025
01/04/2023, 8:19 PMsparse-nail-47035
01/04/2023, 8:22 PMmany-telephone-49025
01/04/2023, 8:23 PMsparse-nail-47035
01/04/2023, 8:23 PMmany-telephone-49025
01/04/2023, 8:24 PMsparse-nail-47035
01/04/2023, 8:24 PMmany-telephone-49025
01/04/2023, 8:27 PMsparse-nail-47035
01/04/2023, 8:28 PMlibraryDependencies += "com.pulumi" % "pulumi" % "0.7.1",
libraryDependencies += "com.pulumi" % "azure" % "5.28.0",
libraryDependencies += "com.pulumi" % "command" % "4.5.0"
many-telephone-49025
01/04/2023, 8:29 PMsparse-nail-47035
01/04/2023, 8:29 PMmany-telephone-49025
01/04/2023, 8:29 PMlibraryDependencies += "com.pulumi" % "azure-native" % "1.90.0",
sparse-nail-47035
01/04/2023, 8:33 PMval cred: Output[ListManagedClusterUserCredentialsResult]
many-telephone-49025
01/04/2023, 8:38 PMsparse-nail-47035
01/04/2023, 8:39 PMmany-telephone-49025
01/04/2023, 8:40 PMsparse-nail-47035
01/04/2023, 8:45 PM/**
* The list of credential result response.
* API Version: 2021-03-01.
*
*/
public static Output<ListManagedClusterMonitoringUserCredentialsResult> listManagedClusterMonitoringUserCredentials(ListManagedClusterMonitoringUserCredentialsArgs args) {
return listManagedClusterMonitoringUserCredentials(args, InvokeOptions.Empty);
}
/**
* The list of credential result response.
* API Version: 2021-03-01.
*
*/
public static CompletableFuture<ListManagedClusterMonitoringUserCredentialsResult> listManagedClusterMonitoringUserCredentialsPlain(ListManagedClusterMonitoringUserCredentialsPlainArgs args) {
return listManagedClusterMonitoringUserCredentialsPlain(args, InvokeOptions.Empty);
}
/**
* The list of credential result response.
* API Version: 2021-03-01.
*
*/
public static Output<ListManagedClusterMonitoringUserCredentialsResult> listManagedClusterMonitoringUserCredentials(ListManagedClusterMonitoringUserCredentialsArgs args, InvokeOptions options) {
return Deployment.getInstance().invoke("azure-native:containerservice:listManagedClusterMonitoringUserCredentials", TypeShape.of(ListManagedClusterMonitoringUserCredentialsResult.class), args, Utilities.withVersion(options));
}
/**
* The list of credential result response.
* API Version: 2021-03-01.
*
*/
public static CompletableFuture<ListManagedClusterMonitoringUserCredentialsResult> listManagedClusterMonitoringUserCredentialsPlain(ListManagedClusterMonitoringUserCredentialsPlainArgs args, InvokeOptions options) {
return Deployment.getInstance().invokeAsync("azure-native:containerservice:listManagedClusterMonitoringUserCredentials", TypeShape.of(ListManagedClusterMonitoringUserCredentialsResult.class), args, Utilities.withVersion(options));
}
many-telephone-49025
01/04/2023, 9:02 PMsparse-nail-47035
01/04/2023, 9:13 PM