diff --git a/k8s/prod/deployAll.cmd b/k8s/prod/deployAll.cmd index 1ec061c..089aaf3 100644 --- a/k8s/prod/deployAll.cmd +++ b/k8s/prod/deployAll.cmd @@ -6,8 +6,7 @@ set location=%~dp0/environment echo "Deploying K8s resources from [%location%] into namespace [%namespace%]" -echo "Creating Namespaces..." -kubectl create ns "%namespace%" +REM namespace is created via Pulumi in production echo "Using namespace [%namespace%] going forward..." diff --git a/k8s/prod/destroyAll.cmd b/k8s/prod/destroyAll.cmd index 2af4aef..5c99597 100644 --- a/k8s/prod/destroyAll.cmd +++ b/k8s/prod/destroyAll.cmd @@ -1,4 +1,31 @@ @echo off -REM destroys all K8s services in "phobos-web" namespace +REM destroys all K8s services in "akkastress" namespace +REM we don't destroy the namespace itself since it contains the Azure Storage secrets we need for Akka.Persistence.Azure -kubectl delete ns akkastress \ No newline at end of file +set namespace=akkastress +set location=%~dp0/environment + +echo "Destroying K8s resources from [%location%] in namespace [%namespace%]" + +echo "Using namespace [%namespace%] going forward..." + +echo "Creating configurations from YAML files in [%location%/configs]" +for %%f in (%location%/configs/*.yaml) do ( + echo "Deploying %%~nxf" + kubectl delete -f "%location%/configs/%%~nxf" -n "%namespace%" +) + +echo "Creating environment-specific services from YAML files in [%location%]" +for %%f in (%location%/*.yaml) do ( + echo "Deploying %%~nxf" + kubectl delete -f "%location%/%%~nxf" -n "%namespace%" +) + +echo "Creating all services..." +for %%f in (%~dp0/services/*.yaml) do ( + echo "Deploying %%~nxf" + kubectl delete -f "%~dp0/services/%%~nxf" -n "%namespace%" +) + +echo "All services started... Printing K8s output.." +kubectl get all -n "%namespace%" \ No newline at end of file diff --git a/k8s/prod/services/prod-services.yaml b/k8s/prod/services/prod-services.yaml index 5abebc4..e0c59b7 100644 --- a/k8s/prod/services/prod-services.yaml +++ b/k8s/prod/services/prod-services.yaml @@ -78,7 +78,7 @@ spec: emptyDir: {} containers: - name: frontend - image: akkalargescaleimagesdd1c690b.azurecr.io/akkadotnet.frontend:0.4.1 + image: akkalargescaleimages64b06635.azurecr.io/akkadotnet.frontend:0.4.3 env: - name: POD_NAME valueFrom: @@ -207,7 +207,7 @@ spec: emptyDir: {} containers: - name: backend - image: akkalargescaleimagesdd1c690b.azurecr.io/akkadotnet.backend:0.4.1 + image: akkalargescaleimages64b06635.azurecr.io/akkadotnet.backend:0.4.3 env: - name: POD_NAME valueFrom: @@ -220,7 +220,7 @@ spec: - name: StressOptions__PersistenceOptions__AzureStorageConnectionString valueFrom: secretKeyRef: - name: azure-storage-connection + name: azure-connection-string key: AzureConnectionString envFrom: - configMapRef: diff --git a/prod/aks-cluster/MyStack.cs b/prod/aks-cluster/MyStack.cs index 33aa88e..95d2436 100644 --- a/prod/aks-cluster/MyStack.cs +++ b/prod/aks-cluster/MyStack.cs @@ -223,6 +223,27 @@ public MyStack() } }, k8sCustomResourceOptions); + var appnamespace = new Pulumi.Kubernetes.Core.V1.Namespace("akkastress", new NamespaceArgs() + { + Metadata = new ObjectMetaArgs(){ + Name = "akkastress" + }, + ApiVersion = "v1", + Kind = "Namespace" + }, k8sCustomResourceOptions); + + var appNamespaceProvider = new Pulumi.Kubernetes.Provider("k8s-akkastress-provider", new Pulumi.Kubernetes.ProviderArgs() + { + KubeConfig = KubeConfig, + Namespace = appnamespace.Metadata.Apply(c => c.Name) + }); + + var k8sCustomAppResourceOptions = new CustomResourceOptions + { + Provider = appNamespaceProvider, + }; + + // need to create this resource in the `akkastress` namespace var azureConnectionStringSecret = new Pulumi.Kubernetes.Core.V1.Secret("azure-storage-secret", new SecretArgs() { StringData = @@ -234,7 +255,7 @@ public MyStack() { Name = "azure-connection-string" } - }); + }, k8sCustomAppResourceOptions); } [Output("kubeconfig")] public Output KubeConfig { get; set; } diff --git a/prod/apm-kubernetes/install-helm-charts.cmd b/prod/apm-kubernetes/install-helm-charts.cmd new file mode 100644 index 0000000..be5b5d5 --- /dev/null +++ b/prod/apm-kubernetes/install-helm-charts.cmd @@ -0,0 +1,7 @@ +@echo off +REM installs all Helm charts + +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts +helm repo add datalust https://helm.datalust.co +helm repo add bitnami https://charts.bitnami.com/bitnami +helm repo update \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props index b11ec72..4a64e79 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -3,7 +3,7 @@ Copyright © 2022 Petabridge Petabridge 0.4.3 - • Testing deployments. + • Bumped Akka.Remote max-frame-size to 1mb%2C buffer sizes to 2mb.