Skip to content

Commit

Permalink
Adding Kustomize and Helm Charts, to be used in separate use cases, n…
Browse files Browse the repository at this point in the history
…ot at same time
  • Loading branch information
jorgearteiro committed Sep 11, 2024
1 parent 9d6120e commit 6c7b2f2
Show file tree
Hide file tree
Showing 28 changed files with 617 additions and 0 deletions.
5 changes: 5 additions & 0 deletions complete/AppHost/aspirate-output/Chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: AspireProject
description: A Helm chart to Deploy your Aspire Project to Kubernetes.
appVersion: 1.0.0
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
data:
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: in_memory
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "8080"
OTEL_EXPORTER_OTLP_ENDPOINT: http://aspire-dashboard:18889
OTEL_SERVICE_NAME: api
kind: ConfigMap
metadata:
annotations: {}
labels:
app: api
name: api
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
app: api
name: api
spec:
minReadySeconds: 60
replicas: 1
selector:
matchLabels:
app: api
strategy:
type: Recreate
template:
metadata:
annotations: {}
labels:
app: api
spec:
containers:
- args: []
envFrom:
- configMapRef:
name: api
- secretRef:
name: api
image: '{{ .Values.images.api }}'
imagePullPolicy: Always
name: api
ports:
- containerPort: 8080
name: http
- containerPort: 8443
name: https
terminationGracePeriodSeconds: 180
10 changes: 10 additions & 0 deletions complete/AppHost/aspirate-output/Chart/templates/api-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
ConnectionStrings__cache: Y2FjaGU6NjM3OQ==
kind: Secret
metadata:
annotations: {}
labels:
app: api
name: api
type: Opaque
18 changes: 18 additions & 0 deletions complete/AppHost/aspirate-output/Chart/templates/api-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: api
name: api
spec:
ports:
- name: http
port: 8080
targetPort: 0
- name: https
port: 8443
targetPort: 0
selector:
app: api
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: aspire-dashboard
name: aspire-dashboard
spec:
replicas: 1
selector:
matchLabels:
app: aspire-dashboard
template:
metadata:
labels:
app: aspire-dashboard
spec:
containers:
- env:
- name: DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS
value: "true"
image: '{{ .Values.images.aspiredashboard }}'
name: aspire-dashboard
ports:
- containerPort: 18888
name: dashboard-ui
- containerPort: 18889
name: otlp
resources:
limits:
memory: 512Mi
requests:
cpu: 500m
memory: 512Mi
terminationGracePeriodSeconds: 30
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: aspire-dashboard
spec:
ports:
- name: dashboard-ui
port: 18888
protocol: TCP
targetPort: 18888
- name: otlp
port: 18889
protocol: TCP
targetPort: 18889
selector:
app: aspire-dashboard
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
data:
OTEL_EXPORTER_OTLP_ENDPOINT: http://aspire-dashboard:18889
OTEL_SERVICE_NAME: cache
kind: ConfigMap
metadata:
annotations: {}
labels:
app: cache
name: cache
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
app: cache
name: cache
spec:
minReadySeconds: 60
replicas: 1
selector:
matchLabels:
app: cache
strategy:
type: Recreate
template:
metadata:
annotations: {}
labels:
app: cache
spec:
containers:
- args: []
envFrom:
- configMapRef:
name: cache
image: '{{ .Values.images.cache }}'
imagePullPolicy: Always
name: cache
ports:
- containerPort: 6379
name: tcp
terminationGracePeriodSeconds: 180
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: cache
name: cache
spec:
ports:
- name: tcp
port: 6379
targetPort: 0
selector:
app: cache
type: ClusterIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
data:
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: in_memory
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
HTTP_PORTS: "8080"
services__api__http__0: http://api:8080
OTEL_EXPORTER_OTLP_ENDPOINT: http://aspire-dashboard:18889
OTEL_SERVICE_NAME: myweatherhub
kind: ConfigMap
metadata:
annotations: {}
labels:
app: myweatherhub
name: myweatherhub
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
annotations: {}
labels:
app: myweatherhub
name: myweatherhub
spec:
minReadySeconds: 60
replicas: 1
selector:
matchLabels:
app: myweatherhub
strategy:
type: Recreate
template:
metadata:
annotations: {}
labels:
app: myweatherhub
spec:
containers:
- args: []
envFrom:
- configMapRef:
name: myweatherhub
image: '{{ .Values.images.myweatherhub }}'
imagePullPolicy: Always
name: myweatherhub
ports:
- containerPort: 8080
name: http
- containerPort: 8443
name: https
terminationGracePeriodSeconds: 180
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Service
metadata:
annotations: {}
labels:
app: myweatherhub
name: myweatherhub
spec:
ports:
- name: http
port: 8080
targetPort: 0
- name: https
port: 8443
targetPort: 0
selector:
app: myweatherhub
type: ClusterIP
5 changes: 5 additions & 0 deletions complete/AppHost/aspirate-output/Chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
images:
cache: docker.io/library/redis:7.4
api: jorgearteiro/api:latest
myweatherhub: jorgearteiro/myweatherhub:latest
aspiredashboard: mcr.microsoft.com/dotnet/aspire-dashboard:8.0
35 changes: 35 additions & 0 deletions complete/AppHost/aspirate-output/api/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
app: api
spec:
minReadySeconds: 60
replicas: 1
selector:
matchLabels:
app: api
strategy:
type: Recreate
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: jorgearteiro/api:latest
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
- name: https
containerPort: 8443
envFrom:
- configMapRef:
name: api-env
- secretRef:
name: api-secrets
terminationGracePeriodSeconds: 180
23 changes: 23 additions & 0 deletions complete/AppHost/aspirate-output/api/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resources:
- deployment.yaml
- service.yaml

generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: api-env
literals:
- OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES=true
- OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES=true
- OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY=in_memory
- ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
- HTTP_PORTS=8080
- OTEL_EXPORTER_OTLP_ENDPOINT=http://aspire-dashboard:18889
- OTEL_SERVICE_NAME=api
- ASPNETCORE_URLS=http://+:8080;

secretGenerator:
- name: api-secrets
envs:
- .api.secrets
16 changes: 16 additions & 0 deletions complete/AppHost/aspirate-output/api/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Service
metadata:
name: api
spec:
type: ClusterIP
selector:
app: api
ports:
- name: http
port: 8080
targetPort: 8080
- name: https
port: 8443
targetPort: 8443
Loading

0 comments on commit 6c7b2f2

Please sign in to comment.