bitnamicharts/aspnet-core

Verified Publisher

By VMware

Updated 8 days ago

Bitnami Helm chart for ASP.NET Core

Image
Artifact
Helm
Languages & frameworks
API management
Web servers
0

500K+

bitnamicharts/aspnet-core repository overview

Bitnami Secure Images Helm chart for ASP.NET Core

ASP.NET Core is an open-source framework for web application development created by Microsoft. It runs on both the full .NET Framework, on Windows, and the cross-platform .NET Core.

Overview of ASP.NET Core

Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

TL;DR

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/aspnet-core

Note: You need to substitute the placeholders REGISTRY_NAME and REPOSITORY_NAME with a reference to your Helm chart registry and repository.

Introduction

Bitnami charts for Helm are carefully engineered, actively maintained and are the quickest and easiest way to deploy containers on a Kubernetes cluster that are ready to handle production workloads.

This chart bootstraps an ASP.NET Core deployment on a Kubernetes cluster using the Helm package manager.

Before you begin

  • Kubernetes 1.23+
  • Helm 3.8.0+

Installing the Chart

To install the chart with the release name my-release:

helm install my-release oci://REGISTRY_NAME/REPOSITORY_NAME/aspnet-core

These commands deploy a ASP.NET Core application on the Kubernetes cluster in the default configuration.

Tip: List all releases using helm list

Configuration and installation details

This section describes credentials, configuration, and other installation options.

Resource requests and limits

Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the resources value (check parameter table). Setting requests is essential for production workloads and these should be adapted to your specific use case.

To make this process easier, the chart contains the resourcesPreset values, which automatically sets the resources section according to different presets. Check these presets in the bitnami/common chart. However, in production workloads using resourcesPreset is discouraged as it may not fully adapt to your specific needs. Find more information on container resource management in the official Kubernetes documentation.

Rolling VS Immutable tags

It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.

Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.

Backup and restore

To back up and restore Helm chart deployments on Kubernetes, you need to back up the persistent volumes from the source deployment and attach them to a new deployment using Velero, a Kubernetes backup/restore tool. Find the instructions for using Velero in this guide.

Deploying your custom ASP.NET Core application

The ASP.NET Core chart allows you to deploy a custom application using one of the following methods:

  • Using a Docker image containing your ASP.NET Core application ready to be executed.
  • Cloning your ASP.NET Core application code from a GIT repository.
  • Mounting your ASP.NET Core application from an existing PVC
Using a Docker image containing your ASP.NET Core application ready to be executed

You can build your own Docker image containing your ASP.NET Core application ready to be executed. To do so, overwrite the default image setting the image.* parameters, and set your custom command and arguments setting the command and args parameters:

appFromExternalRepo.enabled=false
image.registry=docker.io
image.repository=your-image
image.tag=your-tag
command=[command]
args=[arguments]
Cloning your ASP.NET Core application code from a GIT repository

This is done using two different init containers:

To use this feature, set the appFromExternalRepo.enabled to true and set the repository and branch to use setting the appFromExternalRepo.clone.repository and appFromExternalRepo.clone.revision parameters. Then, specify the sub folder under the Git repository containing the ASP.NET Core app setting the appFromExternalRepo.publish.subFolder parameter. Finally, provide the start command to use setting the appFromExternalRepo.startCommand.

Note: you can append any custom flag for the "dotnet publish" command setting the appFromExternalRepo.publish.extraFlags parameter.

For example, you can deploy a sample OCMinimal using the parameters below:

appFromExternalRepo.enabled=true
appFromExternalRepo.clone.repository=https://github.com/dotnet/AspNetCore.Docs.git
appFromExternalRepo.clone.revision=main
appFromExternalRepo.publish.aspnetcore/performance/caching/output/samples/7.x/
appFromExternalRepo.startCommand[0]=dotnet
appFromExternalRepo.startCommand[1]=OCMinimal.dll
Mounting your ASP.NET Core application from an existing PVC

If you previously created a PVC with your application code ready to be executed, you can mount it in the ASP.NET Core container setting the appFromExistingPVC.enabled parameter to true. Then, specify the name of your existing PVC setting the appFromExistingPVC.existingClaim parameter.

For example, if you created a PVC named my-custom-apsnet-core-app containing your application, use the parameters below:

appFromExistingPVC.enabled=true
appFromExistingPVC.existingClaim=my-custom-apsnet-core-app
Adding extra environment variables

In case you want to add extra environment variables (useful for advanced operations like custom init scripts), you can use the extraEnvVars property.

kong:
  extraEnvVars:
    - name: LOG_LEVEL
      value: error

Alternatively, you can use a ConfigMap or a Secret with the environment variables. To do so, use the extraEnvVarsCM or the extraEnvVarsSecret values.

Sidecars and Init Containers

If you have a need for additional containers to run within the same pod as the ASP.NET Core app (e.g. an additional metrics or logging exporter), you can do so via the sidecars config parameter. Simply define your container according to the Kubernetes container spec.

sidecars:
  - name: your-image-name
    image: your-image
    imagePullPolicy: Always
    ports:
      - name: portname
       containerPort: 1234

Similarly, you can add extra init containers using the initContainers parameter.

initContainers:
  - name: your-image-name
    image: your-image
    imagePullPolicy: Always
    ports:
      - name: portname
        containerPort: 1234
Deploying extra resources

There are cases where you may want to deploy extra objects, such a ConfigMap containing your app's configuration or some extra deployment with a micro service used by your app For covering this case, the chart allows adding the full specification of other objects using the extraDeploy parameter. The following example would create a ConfigMap including some app's configuration, and it will mount it in the ASP.NET Core app's container:

extraDeploy: |-
  - apiVersion: v1
    kind: ConfigMap
    metadata:
      name: aspnet-core-configuration
      labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
      {{- if .Values.commonAnnotations }}
      annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 6 }}
      {{- end }}
    data:
      appsettings.json: |-
        {
          "AllowedHosts": "*"
        }
extraVolumeMounts:
  - name: configuration
    mountPath: /app/config/
    readOnly: true
extraVolumes:
  - name: configuration
    configMap:
      name: aspnet-core-configuration
Setting Pod's affinity

This chart allows you to set your custom affinity using the affinity parameter. Find more information about Pod's affinity in the kubernetes documentation.

As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the bitnami/common chart. To do so, set the podAffinityPreset, podAntiAffinityPreset, or nodeAffinityPreset parameters.

Gateway API

This chart provides support for exposing the ASP.NET Core application using the Gateway API and its HTTPRoute resource. If you have a Gateway controller installed on your cluster, such as APISIX, Contour, Envoy Gateway, NGINX Gateway Fabric or Kong Ingress Controller you can utilize the Gateway controller to serve your application. To enable Gateway API integration, set httpRoute.enabled to true. The Gateway to be used can be customized by setting the httpRoute.parentRefs parameter. By default, it will reference a Gateway named gateway in the same namespace as the release.

You can specify the list of hostnames to be mapped to the deployment using the httpRoute.hostnames parameter. Additionally, you can customize the rules used to route the traffic to the service by modifying the httpRoute.matches and httpRoute.filters parameters or adding new rules using the httpRoute.extraRules parameter.

Ingress

This chart provides support for Ingress resources. If you have an ingress controller installed on your cluster, such as nginx-ingress-controller or contour you can utilize the ingress controller to serve your application.

To enable ingress integration, please set ingress.enabled to true.

Hosts

Most likely you will only want to have one hostname that maps to this ASP.NET Core installation. If that's your case, the property ingress.hostname will set it. However, it is possible to have more than one host. To facilitate this, the ingress.extraHosts object can be specified as an array. You can also use ingress.extraTLS to add the TLS configuration for extra hosts.

For each host indicated at ingress.extraHosts, please indicate a name, path, and any annotations that you may want the ingress controller to know about.

For annotations, please see this document. Not all annotations are supported by all ingress controllers, but this document does a good job of indicating which annotation is supported by many popular ingress controllers.

FIPS parameters

The FIPS parameters only have effect if you are using images from the Bitnami Secure Images catalog.

For more information on this new support, please refer to the FIPS Compliance section.

Parameters

The following subsections list global, common, and component-specific parameters.

Global parameters
NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.defaultStorageClassGlobal default StorageClass for Persistent Volume(s)""
global.storageClassDEPRECATED: use global.defaultStorageClass instead""
global.defaultFipsDefault value for the FIPS configuration (allowed values: '', restricted, relaxed, off). Can be overridden by the 'fips' objectrestricted
global.security.allowInsecureImagesAllows skipping image verificationfalse
global.compatibility.openshift.adaptSecurityContextAdapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation)auto
Common parameters
NameDescriptionValue
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override aspnet-core.fullname""
fullnameOverrideString to fully override aspnet-core.fullname""
namespaceOverrideString to fully override common.names.namespace""
commonLabelsLabels to add to all deployed objects{}
commonAnnotationsAnnotations to add to all deployed objects{}
clusterDomainKubernetes cluster domain namecluster.local
extraDeployArray of extra objects to deploy with the release[]
ASP.NET Core parameters
NameDescriptionValue
image.registryASP.NET Core image registryREGISTRY_NAME
image.repositoryASP.NET Core image repositoryREPOSITORY_NAME/aspnet-core
image.digestASP.NET Core image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
image.pullPolicyASP.NET Core image pull policyIfNotPresent
image.pullSecretsASP.NET Core image pull secrets[]
image.debugEnable image debug modefalse
commandOverride default container command (useful when using custom images)[]
argsOverride default container args (useful when using custom images)[]
bindURLsURLs to bindhttp://+:8080
extraEnvVarsExtra environment variables to be set on ASP.NET Core container[]
extraEnvVarsCMConfigMap with extra environment variables""
extraEnvVarsSecretSecret with extra environment variables""
ASP.NET Core deployment parameters
NameDescriptionValue
replicaCountNumber of ASP.NET Core replicas to deploy1
fips.opensslConfigure OpenSSL FIPS mode: '', 'restricted', 'relaxed', 'off'. If empty (""), 'global.defaultFips' would be used""
schedulerNameName of the k8s scheduler (other than default)""
runtimeClassNameName of the runtime class to be used by pod(s)""
priorityClassNameASP.NET Core pod priority class name""
topologySpreadConstraintsTopology Spread Constraints for pod assignment[]
automountServiceAccountTokenMount Service Account token in podfalse
hostAliasesASP.NET Core pod host aliases[]
extraVolumesOptionally specify extra list of additional volumes for ASP.NET Core pods[]
extraVolumeMountsOptionally specify extra list of additional volumeMounts for ASP.NET Core container(s)[]
sidecarsAdd additional sidecar containers to the ASP.NET Core pods[]
initContainersAdd additional init containers to the ASP.NET Core pods[]
lifecycleHooksAdd lifecycle hooks to the ASP.NET Core deployment

Note: the README for this chart is longer than the DockerHub length limit of 25000, so it has been trimmed. The full README can be found at https://techdocs.broadcom.com/us/en/vmware-tanzu/bitnami-secure-images/bitnami-secure-images/services/bsi-app-doc/apps-charts-aspnet-core-index.html

Tag summary

Content type

Image

Digest

sha256:e5e2d7641

Size

7.8 kB

Last updated

8 days ago

docker pull bitnamicharts/aspnet-core:sha256-ae333d39216f7585ae2585402b221f48cc7e91f94cc824afb17b1c105a38580c

This week's pulls

Pulls:

5,199

Jun 29 to Jul 5

Bitnami