Skip to content

Commit d16655a

Browse files
committed
feat: copy charts to pvc
1 parent 5aad02e commit d16655a

File tree

6 files changed

+70
-19
lines changed

6 files changed

+70
-19
lines changed

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ dockers:
108108
- hack/addons/mindthegap-helm-registry/repos.yaml
109109
build_flag_templates:
110110
- "--platform=linux/amd64"
111+
- '--version=v{{ trimprefix .Version "v" }}'
111112
- "--pull"
112113
- "--label=org.opencontainers.image.created={{.CommitDate}}"
113114
- "--label=org.opencontainers.image.title=caren-helm-reg"
@@ -124,6 +125,7 @@ dockers:
124125
build_flag_templates:
125126
- "--platform=linux/arm64"
126127
- "--pull"
128+
- '--version=v{{ trimprefix .Version "v" }}'
127129
- "--label=org.opencontainers.image.created={{.CommitDate}}"
128130
- "--label=org.opencontainers.image.title=caren-helm-reg"
129131
- "--label=org.opencontainers.image.revision={{.FullCommit}}"

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
3232
| deployment.replicas | int | `1` | |
3333
| env | object | `{}` | |
3434
| helmAddonsConfigMap | string | `"default-helm-addons-config"` | |
35-
| helmRepositoryImage.pullPolicy | string | `"IfNotPresent"` | |
36-
| helmRepositoryImage.repository | string | `"ghcr.io/nutanix-cloud-native/caren-helm-reg"` | |
37-
| helmRepositoryImage.tag | string | `""` | |
35+
| helmChartsImage.pullPolicy | string | `"IfNotPresent"` | |
36+
| helmChartsImage.repository | string | `"ghcr.io/nutanix-cloud-native/caren-helm-reg"` | |
37+
| helmChartsImage.tag | string | `""` | |
3838
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
3939
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-aws-ccm-helm-values-template"` | |
4040
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.27" | string | `"v1.27.9"` | |
@@ -86,6 +86,9 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
8686
| image.repository | string | `"ghcr.io/nutanix-cloud-native/cluster-api-runtime-extensions-nutanix"` | |
8787
| image.tag | string | `""` | |
8888
| imagePullSecrets | list | `[]` | Optional secrets used for pulling the container image |
89+
| mindthegap.pullPolicy | string | `"IfNotPresent"` | |
90+
| mindthegap.repository | string | `"ghcr.io/mesosphere/mindthegap"` | |
91+
| mindthegap.tag | string | `"v1.14.4"` | |
8992
| namespaceSync.enabled | bool | `true` | |
9093
| namespaceSync.sourceNamespace | string | `""` | |
9194
| namespaceSync.targetNamespaceLabelKey | string | `"caren.nutanix.com/namespace-sync"` | |

charts/cluster-api-runtime-extensions-nutanix/templates/helm-repository.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ spec:
2626
kind: Issuer
2727
secretName: helm-repository-tls
2828
---
29+
apiVersion: v1
30+
kind: PersistentVolumeClaim
31+
metadata:
32+
finalizers:
33+
- kubernetes.io/pvc-protection
34+
name: charts-pvc
35+
namespace: default
36+
spec:
37+
accessModes:
38+
- ReadWriteOnce
39+
resources:
40+
requests:
41+
storage: 2Gi
42+
volumeMode: Filesystem
43+
---
2944
apiVersion: apps/v1
3045
kind: Deployment
3146
metadata:
@@ -45,18 +60,34 @@ spec:
4560
labels:
4661
app: helm-repository # pods have this label, and Service and Deployment depend on it
4762
spec:
63+
initContainers:
64+
- name: init-container
65+
image: "{{ .Values.helmChartsImage.repository }}:{{ default $.Chart.AppVersion .Values.helmChartsImage.tag }}"
66+
command: ["/bin/sh", "-c", "cp /charts/*.tar /helm-charts"]
67+
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
4868
containers:
4969
- name: helm-repository
5070
ports:
5171
- name: serve
5272
protocol: TCP
5373
containerPort: 5000
54-
image: "{{ .Values.helmRepositoryImage.repository }}:{{ default $.Chart.AppVersion .Values.helmRepositoryImage.tag }}"
55-
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
74+
image: "{{ .Values.mindthegap.repository }}:{{ .Values.mindthegap.tag }}"
75+
imagePullPolicy: "{{ .Values.mindthegap.pullPolicy }}"
76+
args:
77+
- serve
78+
- bundle
79+
- --bundle=/helm-charts/helm-charts-*.tar
80+
- --listen-port=5000
81+
- --listen-address=0.0.0.0
82+
- --tls-private-key-file=/certs/tls.key
83+
- --tls-cert-file=/certs/tls.crt
5684
volumeMounts:
5785
- name: certs-vol
5886
mountPath: "/certs"
5987
readOnly: true
88+
- name: charts-volume
89+
mountPath: "/helm-charts"
90+
readOnly: true
6091
livenessProbe:
6192
tcpSocket:
6293
port: serve
@@ -73,6 +104,9 @@ spec:
73104
- name: certs-vol
74105
secret:
75106
secretName: helm-repository-tls
107+
- name: charts-volume
108+
persistentVolumeClaim:
109+
claimName: charts-pvc
76110
---
77111
apiVersion: v1
78112
kind: Service

charts/cluster-api-runtime-extensions-nutanix/values.schema.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"helmAddonsConfigMap": {
3939
"type": "string"
4040
},
41-
"helmRepositoryImage": {
41+
"helmChartsImage": {
4242
"properties": {
4343
"pullPolicy": {
4444
"type": "string"
@@ -505,6 +505,20 @@
505505
"imagePullSecrets": {
506506
"type": "array"
507507
},
508+
"mindthegap": {
509+
"properties": {
510+
"pullPolicy": {
511+
"type": "string"
512+
},
513+
"repository": {
514+
"type": "string"
515+
},
516+
"tag": {
517+
"type": "string"
518+
}
519+
},
520+
"type": "object"
521+
},
508522
"namespaceSync": {
509523
"properties": {
510524
"enabled": {

charts/cluster-api-runtime-extensions-nutanix/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,16 @@ image:
132132
tag: ""
133133
pullPolicy: IfNotPresent
134134

135-
helmRepositoryImage:
135+
helmChartsImage:
136136
repository: ghcr.io/nutanix-cloud-native/caren-helm-reg
137137
tag: ""
138138
pullPolicy: IfNotPresent
139139

140+
mindthegap:
141+
repository: ghcr.io/mesosphere/mindthegap
142+
tag: "v1.14.4"
143+
pullPolicy: IfNotPresent
144+
140145
# -- Optional secrets used for pulling the container image
141146
imagePullSecrets: []
142147
# - name: Secret with Registry credentials
Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1-
ARG MINDTHEGAP_VERSION=v1.14.4
2-
1+
ARG VERSION
2+
ARG MINDTHEGAP_VERSION
33
FROM --platform=${BUILDPLATFORM} ghcr.io/mesosphere/mindthegap:${MINDTHEGAP_VERSION} as bundle_builder
44
# this gets called by goreleaser so the copy source has to be the path relative to the repo root.
55
RUN --mount=source=./hack/addons/mindthegap-helm-registry/repos.yaml,target=/repos.yaml \
6-
["/ko-app/mindthegap", "create", "bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts.tar"]
6+
["/ko-app/mindthegap", "create", "bundle", "--helm-charts-file=/repos.yaml", "--output-file=/tmp/helm-charts-${VERSION}.tar"]
77

8-
FROM --platform=${TARGETPLATFORM} ghcr.io/mesosphere/mindthegap:${MINDTHEGAP_VERSION}
9-
COPY --from=bundle_builder /tmp/helm-charts.tar /tmp/helm-charts.tar
10-
VOLUME /certs
11-
CMD [ "serve", "bundle", \
12-
"--bundle=/tmp/helm-charts.tar", \
13-
"--listen-port=5000", \
14-
"--listen-address=0.0.0.0", \
15-
"--tls-private-key-file=/certs/tls.key", \
16-
"--tls-cert-file=/certs/tls.crt" ]
8+
FROM --platform=${TARGETPLATFORM} alpine
9+
COPY --from=bundle_builder /tmp/helm-charts-${VERSION}.tar /charts/helm-charts-${VERSION}.tar

0 commit comments

Comments
 (0)