diff --git a/etc/k8s/azure/build-push.yaml b/etc/k8s/azure/build-push.yaml new file mode 100644 index 00000000..f9c8eef9 --- /dev/null +++ b/etc/k8s/azure/build-push.yaml @@ -0,0 +1,54 @@ +variables: + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: 'volosoft-reg' + buildContextBasePath: '$(Build.SourcesDirectory)' + # tag: $[replace(variables['Build.SourceBranch'], 'refs/tags/', '')] + tag: $(Build.BuildNumber) + DOCKER_BUILDKIT: 1 + +trigger: + branches: + include: + - refs/heads/main + +pool: + vmImage: "ubuntu-latest" + +steps: + - task: UseDotNet@2 + displayName: "Use .NET sdk" + inputs: + packageType: sdk + version: 7.0.x + installationPath: $(Agent.ToolsDirectory)/dotnet + includePreviewVersions: true + + - task: PowerShell@2 + displayName: Build docker images + inputs: + filePath: "build/build-images.ps1" + arguments: "-version $(tag)" + + - task: Docker@2 + displayName: Login to ACR + inputs: + containerRegistry: $(dockerRegistryServiceConnection) + command: "login" + + - task: PowerShell@2 + displayName: Push images to ACR + inputs: + filePath: "etc/k8s/azure/scripts/push-images-az.ps1" + arguments: "-version $(tag)" + + - bash: | + sed -i "s/tag: latest/tag: \"\${tag}\"/g" etc/k8s/azure/values-az-cr.yaml + + + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(buildContextBasePath)/etc/k8s' + artifact: helm + publishLocation: pipeline + diff --git a/etc/k8s/azure/scripts/push-images-az.ps1 b/etc/k8s/azure/scripts/push-images-az.ps1 new file mode 100644 index 00000000..ac1a0bd7 --- /dev/null +++ b/etc/k8s/azure/scripts/push-images-az.ps1 @@ -0,0 +1,54 @@ +param ($version='latest') + +az acr login --name volosoft + +docker tag eshoponabp/app-web:$version volosoft.azurecr.io/eshoponabp/app-web:$version +docker push volosoft.azurecr.io/eshoponabp/app-web:$version +docker tag volosoft.azurecr.io/eshoponabp/app-web:$version volosoft.azurecr.io/eshoponabp/dbmigrator:latest + +docker tag eshoponabp/app-authserver:$version volosoft.azurecr.io/eshoponabp/app-authserver:$version +docker push volosoft.azurecr.io/eshoponabp/app-authserver:$version +docker tag volosoft.azurecr.io/eshoponabp/app-authserver:$version volosoft.azurecr.io/eshoponabp/app-authserver:latest + +docker tag eshoponabp/app-publicweb:$version volosoft.azurecr.io/eshoponabp/app-publicweb:$version +docker push volosoft.azurecr.io/eshoponabp/app-publicweb:$version +docker tag volosoft.azurecr.io/eshoponabp/app-publicweb:$version volosoft.azurecr.io/eshoponabp/app-publicweb:latest + +docker tag eshoponabp/gateway-web:$version volosoft.azurecr.io/eshoponabp/gateway-web:$version +docker push volosoft.azurecr.io/eshoponabp/gateway-web:$version +docker tag volosoft.azurecr.io/eshoponabp/gateway-web:$version volosoft.azurecr.io/eshoponabp/gateway-web:latest + +docker tag eshoponabp/gateway-web-public:$version volosoft.azurecr.io/eshoponabp/gateway-web-public:$version +docker push volosoft.azurecr.io/eshoponabp/gateway-web-public:$version +docker tag volosoft.azurecr.io/eshoponabp/gateway-web-public:$version volosoft.azurecr.io/eshoponabp/gateway-web-public:latest + +docker tag eshoponabp/service-identity:$version volosoft.azurecr.io/eshoponabp/service-identity:$version +docker push volosoft.azurecr.io/eshoponabp/service-identity:$version +docker tag volosoft.azurecr.io/eshoponabp/service-identity:$version volosoft.azurecr.io/eshoponabp/service-identity:latest + +docker tag eshoponabp/service-administration:$version volosoft.azurecr.io/eshoponabp/service-administration:$version +docker push volosoft.azurecr.io/eshoponabp/service-administration:$version +docker tag volosoft.azurecr.io/eshoponabp/service-administration:$version volosoft.azurecr.io/eshoponabp/service-administration:latest + +docker tag eshoponabp/service-catalog:$version volosoft.azurecr.io/eshoponabp/service-catalog:$version +docker push volosoft.azurecr.io/eshoponabp/service-catalog:$version +docker tag volosoft.azurecr.io/eshoponabp/service-catalog:$version volosoft.azurecr.io/eshoponabp/service-catalog:latest + +docker tag eshoponabp/service-basket:$version volosoft.azurecr.io/eshoponabp/service-basket:$version +docker push volosoft.azurecr.io/eshoponabp/service-basket:$version +docker tag volosoft.azurecr.io/eshoponabp/service-basket:$version volosoft.azurecr.io/eshoponabp/service-basket:latest + +docker tag eshoponabp/service-payment:$version volosoft.azurecr.io/eshoponabp/service-payment:$version +docker push volosoft.azurecr.io/eshoponabp/service-payment:$version +docker tag volosoft.azurecr.io/eshoponabp/service-payment:$version volosoft.azurecr.io/eshoponabp/service-payment:latest + +docker tag eshoponabp/service-ordering:$version volosoft.azurecr.io/eshoponabp/service-ordering:$version +docker push volosoft.azurecr.io/eshoponabp/service-ordering:$version +docker tag volosoft.azurecr.io/eshoponabp/service-ordering:$version volosoft.azurecr.io/eshoponabp/service-ordering:latest + +docker tag eshoponabp/service-cmskit:$version volosoft.azurecr.io/eshoponabp/service-cmskit:$version +docker push volosoft.azurecr.io/eshoponabp/service-cmskit:$version +docker tag volosoft.azurecr.io/eshoponabp/service-cmskit:$version volosoft.azurecr.io/eshoponabp/service-cmskit:latest + + + diff --git a/etc/k8s/azure/values-az-cr.yaml b/etc/k8s/azure/values-az-cr.yaml new file mode 100644 index 00000000..ce1a0911 --- /dev/null +++ b/etc/k8s/azure/values-az-cr.yaml @@ -0,0 +1,402 @@ +# auth-server sub-chart override +authserver: + config: + selfUrl: https://auth.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com,https://identity.eshoponabp.com,https://administration.eshoponabp.com,https://basket.eshoponabp.com,https://catalog.eshoponabp.com,https://order.eshoponabp.com,https://cmskit.eshoponabp.com,https://payment.eshoponabp.com,https://admin.eshoponabp.com,https://www.eshoponabp.com + allowedRedirectUrls: https://admin.eshoponabp.com + authServer: + authority: https://auth.eshoponabp.com + requireHttpsMetadata: "false" + connectionStrings: + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + identityService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + ingress: + host: auth.eshoponabp.com + tlsSecret: eshop-wildcard-tls + image: + repository: "volosoft.azurecr.io/eshoponabp/app-authserver" + tag: latest + +# web sub-chart override +web: + config: + selfUrl: https://admin.eshoponabp.com + gatewayUrl: https://gateway.eshoponabp.com + authServer: + authority: https://auth.eshoponabp.com + requireHttpsMetadata: false + responseType: "code" + strictDiscoveryDocumentValidation: false + skipIssuerCheck: true + ingress: + host: admin.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/app-web" + tag: latest + +# public-web sub-chart override +public-web: + config: + selfUrl: https://www.eshoponabp.com + gatewayUrl: https://gateway-public.eshoponabp.com/ + authServer: + authority: https://auth.eshoponabp.com + requireHttpsMetadata: "false" + isOnProd: "true" + metaAddress: http://eshop-az-authserver + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + + ingress: + host: eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/app-publicweb" + tag: latest + +# identity-service sub-chart override +identity: + config: + selfUrl: https://identity.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com + connectionStrings: + identityService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Identity;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + identityServerClients: # Seeded Clients + webRootUrl: https://admin.eshoponabp.com/ + publicWebRootUrl: https://www.eshoponabp.com/ + webGatewayRootUrl: https://gateway.eshoponabp.com/ + publicWebGatewayRootUrl: https://gateway-public.eshoponabp.com/ + identityServiceRootUrl: https://identity.eshoponabp.com/ + administrationServiceRootUrl: https://administration.eshoponabp.com/ + accountServiceRootUrl: https://auth.eshoponabp.com + basketServiceRootUrl: https://basket.eshoponabp.com/ + catalogServiceRootUrl: https://catalog.eshoponabp.com + orderingServiceRootUrl: https://order.eshoponabp.com + cmskitServiceRootUrl: https://cmskit.eshoponabp.com + paymentServiceRootUrl: https://payment.eshoponabp.com + ingress: + host: identity.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/service-identity" + tag: latest + +# administration sub-chart override +administration: + config: + selfUrl: https://administration.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com,https://eshop-az-gateway-internal + connectionStrings: + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: https://identity.eshoponabp.com + useCurrentToken: "false" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + synchedCommunication: # Used for server-to-server (client-credentials) communication with identityService for user permissions + authority: https://auth.eshoponabp.com + ingress: + host: administration.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/service-administration" + tag: latest + +# gateway-web sub-chart override +gateway-web: + config: + selfUrl: https://gateway.eshoponabp.com + corsOrigins: https://admin.eshoponabp.com + globalConfigurationBaseUrl: http://eshop-az-gateway-public + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + ingress: + host: gateway.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/gateway-web" + tag: latest + reRoutes: + accountService: + url: http://eshop-az-authserver + identityService: + url: http://eshop-az-identity + administrationService: + url: http://eshop-az-administration + catalogService: + url: http://eshop-az-catalog + orderingService: + url: http://eshop-az-ordering + cmskitService: + url: http://eshop-az-cmskit + +# gateway-web-public sub-chart override +gateway-web-public: + config: + selfUrl: https://gateway-public.eshoponabp.com + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + ingress: + host: gateway-public.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/gateway-web-public" + tag: latest + reRoutes: + accountService: + url: http://eshop-az-authserver + identityService: + url: http://eshop-az-identity + administrationService: + url: http://eshop-az-administration + catalogService: + url: http://eshop-az-catalog + basketService: + url: http://eshop-az-basket + orderingService: + url: http://eshop-az-ordering + cmskitService: + url: http://eshop-az-cmskit + paymentService: + url: http://eshop-az-payment + +# basket-service sub-chart override +basket: + config: + selfUrl: https://basket.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com,https://www.eshoponabp.com + connectionStrings: + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + remoteServices: + catalogBaseUrl: http://eshop-az-catalog:80 + catalogGrpcUrl: http://eshop-az-catalog:81 + ingress: + host: basket.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/service-basket" + tag: latest + +# catalog-service sub-chart override +catalog: + config: + selfUrl: https://catalog.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com,https://www.eshoponabp.com,https://admin.eshoponabp.com + connectionStrings: + catalogService: "mongodb://eshop-az-mongodb/EShopOnAbp_Catalog" + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + kestrel: + httpUrl: http://eshop-az-catalog:80 + httpProtocols: Http1AndHttp2 + grpcUrl: http://eshop-az-catalog:81 + grpcProtocols: Http2 + ingress: + host: catalog.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/service-catalog" + tag: latest + +# ordering-service sub-chart override +ordering: + config: + selfUrl: https://order.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com + connectionStrings: + orderingService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Ordering;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + ingress: + host: order.eshoponabp.com + image: + repository: "volocr.azurecr.io/eshoponabp/service-ordering" + tag: latest + +# cmskit-service sub-chart override +cmskit: + config: + selfUrl: https://cmskit.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com + connectionStrings: + cmskitService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Cmskit;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + remoteServices: + abpIdentityBaseUrl: https://identity.eshoponabp.com + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + synchedCommunication: # Used for server-to-server (client-credentials) communication with identityService for user permissions + authority: https://auth.eshoponabp.com + ingress: + host: cmskit.eshoponabp.com + image: + repository: "volocr.azurecr.io/eshoponabp/service-cmskit" + tag: latest + +# payment-service sub-chart override +payment: + config: + selfUrl: https://payment.eshoponabp.com + corsOrigins: https://gateway.eshoponabp.com,https://gateway-public.eshoponabp.com + connectionStrings: + paymentService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Payment;User ID=postgres;password=myPassw0rd;Pooling=false" + administrationService: "Host=eshop-az-postgresdb;Port=5432;Database=EShopOnAbp_Administration;User ID=postgres;password=myPassw0rd;Pooling=false" + authServer: + authority: http://eshop-az-authserver + requireHttpsMetadata: "false" + swaggerClientId: WebGateway_Swagger + swaggerClientSecret: "1q2w3e*" + dotnetEnv: Production + redisHost: eshop-az-redis + rabbitmqHost: eshop-az-rabbitmq + elasticsearchHost: eshop-az-elasticsearch + ingress: + host: payment.eshoponabp.com + image: + repository: "volosoft.azurecr.io/eshoponabp/service-payment" + tag: latest + +# Default values for eshoponabp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} \ No newline at end of file diff --git a/etc/k8s/eshoponabp/values.azure.yaml b/etc/k8s/azure/values.azure.yaml similarity index 98% rename from etc/k8s/eshoponabp/values.azure.yaml rename to etc/k8s/azure/values.azure.yaml index 7bd5b34b..83e53bd8 100644 --- a/etc/k8s/eshoponabp/values.azure.yaml +++ b/etc/k8s/azure/values.azure.yaml @@ -265,8 +265,8 @@ ordering: ingress: host: order.eshoponabp.com image: - repository: "volocr.azurecr.io/eshoponabp/service-ordering" - tag: 1.0.5 + repository: "ghcr.io/volosoft/eshoponabp/service-ordering" + tag: 1.0.1 # cmskit-service sub-chart override cmskit: @@ -292,8 +292,8 @@ cmskit: ingress: host: cmskit.eshoponabp.com image: - repository: "volocr.azurecr.io/eshoponabp/service-cmskit" - tag: 1.0.5 + repository: "ghcr.io/volosoft/eshoponabp/service-cmskit" + tag: 1.0.1 # payment-service sub-chart override payment: