Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gitops/argocd/apps/krm/values-aws-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ argocd-apps:
- list:
elements:
- appName: kro
namespace: home
namespace: krm
targetRevision: HEAD
- appName: ack
namespace: home
namespace: krm
targetRevision: HEAD
template:
metadata:
Expand Down
2 changes: 1 addition & 1 deletion gitops/argocd/apps/krm/values-talos-homelab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ argocd-apps:
- list:
elements:
- appName: kro
namespace: home
namespace: krm
targetRevision: HEAD
- appName: ack
namespace: krm
Expand Down
61 changes: 0 additions & 61 deletions gitops/argocd/charts/krm/ack/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
---
# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
type: application
name: ack
Expand All @@ -24,48 +8,3 @@ dependencies:
- name: ack-chart
repository: oci://public.ecr.aws/aws-controllers-k8s
version: 46.46.0
# - name: apigatewayv2-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.19
# - name: cloudfront-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.3
# - name: ec2-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.3.2
# - name: ecr-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.21
# - name: eks-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.5.4
# - name: elbv2-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.3
# - name: eventbridge-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.17
# - name: iam-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.3.15
# - name: kms-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.19
# # - name: organizations-chart
# # repository: oci://public.ecr.aws/aws-controllers-k8s
# # version: 1.0.2
# - name: s3-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.21
# - name: secretsmanager-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.2
# - name: sns-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.1.3
# - name: sqs-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.1.4
# - name: wafv2-chart
# repository: oci://public.ecr.aws/aws-controllers-k8s
# version: 1.0.2
16 changes: 0 additions & 16 deletions gitops/argocd/charts/krm/ack/values-talos-homelab.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
---
# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

ack-chart:
apigatewayv2:
deployment:
Expand Down
16 changes: 0 additions & 16 deletions gitops/argocd/charts/krm/ack/values.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
---
# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

ack-chart:
apigatewayv2:
enabled: true
Expand Down
10 changes: 10 additions & 0 deletions gitops/argocd/charts/krm/kro-apps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: v2
type: application
name: kro-apps
version: 1.0.0
appVersion: 1.0.0
dependencies:
- name: kro-factory
repository: oci://ghcr.io/portefaix/charts
version: 0.1.0
87 changes: 87 additions & 0 deletions gitops/argocd/charts/krm/kro-apps/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "kro-apps.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "kro-apps.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "kro-apps.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kro-apps.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "kro-apps.labels" -}}
helm.sh/chart: {{ include "kro-apps.chart" . }}
{{ include "kro-apps.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/part-of: {{ include "kro-apps.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.additionalLabels }}
{{ toYaml .Values.additionalLabels }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "kro-apps.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kro-apps.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Kubernetes labels
*/}}
{{- define "kro.k8s.labels" -}}
app.kubernetes.io/component: k8s
{{- end }}

{{/*
AWS labels
*/}}
{{- define "kro.aws.labels" -}}
app.kubernetes.io/component: aws
{{- end }}

{{/*
GCP labels
*/}}
{{- define "kro.gcp.labels" -}}
app.kubernetes.io/component: gcp
{{- end }}
33 changes: 33 additions & 0 deletions gitops/argocd/charts/krm/kro-apps/templates/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: kro.run/v1alpha1
kind: Application
metadata:
name: cloud-native-1
namespace: {{ template "kro-apps.namespace" . }}
labels:
{{- include "kro-apps.labels" . | nindent 4 }}
app.kubernetes.io/component: kro-app
{{- with .Values.additionalAnnotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
name: cloud-native-1
namespace: {{ template "kro-apps.namespace" . }}
metadata:
labels:
{{- include "kro-apps.labels" . | nindent 6 }}
app.kubernetes.io/component: kro-app
annotations: {}
k8s:
image: candonov/s3-demo-app
port: 8888
replicas: 2
service:
enabled: true
ingress:
enabled: false
aws:
s3bucket:
name: portefaix-cloud-native-1
access: write
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
apiVersion: kro.run/v1alpha1
kind: ResourceGraphDefinition
metadata:
name: application.portefaix.kro.run
namespace: {{ template "kro-apps.namespace" . }}
labels:
{{- include "kro-apps.labels" . | nindent 4 }}
app.kubernetes.io/component: kro
{{- with .Values.additionalAnnotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
schema:
apiVersion: v1alpha1
kind: Application
spec:
name: string
namespace: string
metadata:
labels: 'map[string]string'
selectorLabels: 'map[string]string'
annotations: 'map[string]string'
k8s:
image: string
port: integer | default=8080
replicas: integer | default=1
service:
enabled: boolean | default=true
ingress:
enabled: boolean | default=false
{{- if index .Values "aws.enabled" }}
aws:
s3bucket:
name: string
access: string | default=write
{{- end }}
status:
deploymentConditions: ${stack.status.conditions}
availableReplicas: ${stack.status.availableReplicas}
url: ${stack.status.url}
{{- if index .Values "aws.enabled" }}
s3ARN: ${s3bucket.status.s3ARN}
{{- end }}

resources:

- id: stack
template:
apiVersion: kro.run/v1alpha1
kind: Stack
metadata:
name: ${schema.spec.name}
namespace: ${schema.spec.namespace}
annotations: ${schema.spec.metadata.annotations}
labels: ${schema.spec.metadata.labels}
spec:
name: ${schema.spec.name}
image: ${schema.spec.image}
port: ${schema.spec.port}
replicas: ${schema.spec.replicas}
serviceAccount: ${podidentity.status.serviceAccount}
service:
enabled: ${schema.spec.service.enabled}
ingress:
enabled: ${schema.spec.ingress.enabled}
s3bucketName: ${s3bucket.status.s3ARN.substring(13)}

{{- if index .Values "aws.enabled" }}

- id: s3bucket
template:
apiVersion: kro.run/v1alpha1
kind: S3Bucket
metadata:
name: ${schema.spec.s3bucket.name}
namespace: ${schema.spec.namespace}
annotations: ${schema.spec.metadata.annotations}
labels: ${schema.spec.metadata.labels}
spec:
name: ${schema.spec.s3bucket.name}
access: ${schema.spec.s3bucket.access}

- id: podidentity
template:
apiVersion: kro.run/v1alpha1
kind: PodIdentity
metadata:
name: ${schema.spec.name}
namespace: ${schema.spec.namespace}
annotations: ${schema.spec.metadata.annotations}
labels: ${schema.spec.metadata.labels}
spec:
name: ${schema.spec.name}
policyARN: ${s3bucket.status.s3PolicyARN}

{{- end }}
4 changes: 4 additions & 0 deletions gitops/argocd/charts/krm/kro-apps/values-aws-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
kro-factory:
aws:
enabled: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
4 changes: 4 additions & 0 deletions gitops/argocd/charts/krm/kro-apps/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
kro-factory:
additionalLabels:
portefaix.xyz/version: v1.3.0
16 changes: 0 additions & 16 deletions gitops/argocd/charts/krm/kro/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
---
# Copyright (C) Nicolas Lamirault <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0

apiVersion: v2
type: application
name: kro
Expand Down
Loading
Loading