private async Task CreateNamespace(string name) { if (!await KubernetesHelper.NamespaceExists(name)) { await KubernetesHelper.CreateNamespace(name); } }
public async override Task RunAsync() { if (DryRun) { ColoredConsole.WriteLine(KubernetesHelper.GetKedaResources(Namespace)); if (!KedaOnly) { ColoredConsole.WriteLine(KubernetesHelper.GetOsirisResources(Namespace)); } } else { var sb = new StringBuilder(); sb.AppendLine(KubernetesHelper.GetKedaResources(Namespace)); if (!KedaOnly) { sb.AppendLine(KubernetesHelper.GetOsirisResources(Namespace)); } if (!await KubernetesHelper.NamespaceExists(Namespace)) { await KubernetesHelper.CreateNamespace(Namespace); } await KubectlHelper.KubectlApply(sb.ToString(), showOutput : true); } }
public async override Task RunAsync() { if (DryRun) { ColoredConsole.WriteLine(KubernetesHelper.GetKedaResources(Namespace)); } else { if (!await KubernetesHelper.NamespaceExists(Namespace)) { await KubernetesHelper.CreateNamespace(Namespace); } await KubectlHelper.KubectlApply(KubernetesHelper.GetKedaResources(Namespace), showOutput : true); } }
public override async Task RunAsync() { (var resolvedImageName, var shouldBuild) = ResolveImageName(); TriggersPayload triggers = null; if (DryRun) { if (shouldBuild) { // don't build on a --dry-run. // read files from the local dir triggers = await GetTriggersLocalFiles(); } else { triggers = await DockerHelpers.GetTriggersFromDockerImage(resolvedImageName); } } else { if (shouldBuild) { await DockerHelpers.DockerBuild(resolvedImageName, Environment.CurrentDirectory); } triggers = await DockerHelpers.GetTriggersFromDockerImage(resolvedImageName); } (var resources, var funcKeys) = await KubernetesHelper.GetFunctionsDeploymentResources( Name, resolvedImageName, Namespace, triggers, _secretsManager.GetSecrets(), PullSecret, SecretsCollectionName, ConfigMapName, UseConfigMap, PollingInterval, CooldownPeriod, ServiceType, MinReplicaCount, MaxReplicaCount, KeysSecretCollectionName, MountFuncKeysAsContainerVolume); if (DryRun) { ColoredConsole.WriteLine(KubernetesHelper.SerializeResources(resources, OutputSerializationOptions.Yaml)); } else { if (!await KubernetesHelper.NamespaceExists(Namespace)) { await KubernetesHelper.CreateNamespace(Namespace); } if (shouldBuild) { await DockerHelpers.DockerPush(resolvedImageName); } foreach (var resource in resources) { await KubectlHelper.KubectlApply(resource, showOutput : true, ignoreError : IgnoreErrors, @namespace : Namespace); } //Print the function keys message to the console await KubernetesHelper.PrintFunctionsInfo($"{Name}-http", Namespace, funcKeys, triggers); } }