breezy-salesmen-85534
01/27/2021, 9:09 AMBlueGreenStack
, and provide as an example.
with Network Security Groups (NSGs), Role Based Access Control (RBAC), fluentd, in that stack I don’t think that is possible.
However today i tried setting up a single Kubernetes cluster as a mock in pulumi. I hade a similar issue. If I can get some input how to create KubernetesCluster , then I can probably fix my BlueGreenStack.
Here is thee example and the test tesult.
What can I to test this?
using Moq;
using System.ComponentModel;
using System.Linq;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Azure.ContainerService;
using Pulumi.Azure.ContainerService.Inputs;
using Pulumi.Testing;
using Xunit;
namespace Vipps.Vce.Core.Tests.K8s
{
public class KubernetesClusterStack : Stack
{
public KubernetesClusterStack()
{
KubernetesClusterArgs args = new KubernetesClusterArgs
{
DefaultNodePool = new KubernetesClusterDefaultNodePoolArgs
{
Name = "any node pool name",
VmSize = "any VM size"
},
DnsPrefix = "any string",
ResourceGroupName = "any string"
};
CustomResourceOptions options = new CustomResourceOptions();
var _ = new KubernetesCluster("foo", args, options);
}
}
public class KubernetesClusterTests
{
private async Task<KubernetesCluster> CreateCluster()
{
string projectName = "project";
string stackName = "project-blue";
var mocks = new Mock<IMocks>();
var deployment = await Deployment.TestAsync<KubernetesClusterStack>(mocks.Object,
new TestOptions {ProjectName = projectName, StackName = stackName});
return deployment.OfType<KubernetesCluster>().FirstOrDefault();
}
[Fact]
[Category("pulumi")]
public async Task Test_Create_Cluster()
{
var akscluster = await CreateCluster();
Assert.NotNull(akscluster);
}
}
}
And the related test resultNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by