Skip to content

Commit 2225720

Browse files
committed
mount up-config for auth with marketplace
1 parent 1ba9ab3 commit 2225720

File tree

4 files changed

+84
-13
lines changed

4 files changed

+84
-13
lines changed

.github/workflows/ci.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
- name: Run Unit Tests
103103
run: make test
104104

105-
publish-artifacts:
105+
publish-image:
106106
runs-on: ubuntu-latest
107107
needs:
108108
- detect-noop
@@ -156,3 +156,63 @@ jobs:
156156
env:
157157
XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
158158
XPKG_TOKEN: ${{ secrets.XPKG_TOKEN }}
159+
160+
publish-addon:
161+
runs-on: ubuntu-latest
162+
needs:
163+
- detect-noop
164+
- unit-tests
165+
- lint
166+
- publish-image
167+
steps:
168+
- name: Checkout
169+
uses: actions/checkout@v4
170+
with:
171+
submodules: true
172+
173+
- name: Install up
174+
uses: upbound/action-up@v1
175+
with:
176+
skip-login: true
177+
channel: main
178+
version: v0.39.0-384.g0a0c8634
179+
180+
- name: Login to Upbound Marketplace
181+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
182+
with:
183+
registry: xpkg.upbound.io/upbound
184+
username: ${{ secrets.XPKG_ACCESS_ID }}
185+
password: ${{ secrets.XPKG_ACCESS_TOKEN }}
186+
187+
- name: Build chart
188+
run: |
189+
make helm.build
190+
191+
- name: Create working directory
192+
run: |
193+
mkdir -p tmp-addon-xpkg
194+
cd tmp-addon-xpkg
195+
196+
- name: Build and Publish
197+
working-directory: tmp-addon-xpkg
198+
if: env.XPKG_ACCESS_ID != ''
199+
run: |
200+
CHART_VERSION=$(make --no-print-directory -C ../ helm.version)
201+
cp ../crossplane.yaml .
202+
203+
# Build resources
204+
mkdir helm
205+
mv ../_output/charts/martetplace-mcp-server-${CHART_VERSION}.tgz helm/chart.tgz
206+
207+
# Build artifact
208+
up xpkg build
209+
210+
# Find artifact
211+
XPKG_FILENAME=$(find . -name "*.xpkg" -type f -printf "%f\n")
212+
echo $XPKG_FILENAME
213+
214+
# Publish artifact
215+
export ADDON_NAME=addon-$(printf '%s' "$GITHUB_REPOSITORY" | sed 's/.*\///')
216+
echo $ADDON_NAME
217+
218+
up xpkg push xpkg.upbound.io/upbound/$ADDON_NAME:$CHART_VERSION -f $XPKG_FILENAME

cluster/charts/marketplace-mcp-server/templates/_helpers.tpl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{/*
22
Expand the name of the chart.
33
*/}}
4-
{{- define "controlplane-mcp-server.name" -}}
4+
{{- define "marketplace-mcp-server.name" -}}
55
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
66
{{- end }}
77

@@ -10,7 +10,7 @@ Create a default fully qualified app name.
1010
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1111
If release name contains chart name it will be used as a full name.
1212
*/}}
13-
{{- define "controlplane-mcp-server.fullname" -}}
13+
{{- define "marketplace-mcp-server.fullname" -}}
1414
{{- if .Values.fullnameOverride }}
1515
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
1616
{{- else }}
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
2626
{{/*
2727
Create chart name and version as used by the chart label.
2828
*/}}
29-
{{- define "controlplane-mcp-server.chart" -}}
29+
{{- define "marketplace-mcp-server.chart" -}}
3030
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
3131
{{- end }}
3232

3333
{{/*
3434
Common labels
3535
*/}}
36-
{{- define "controlplane-mcp-server.labels" -}}
37-
helm.sh/chart: {{ include "controlplane-mcp-server.chart" . }}
38-
{{ include "controlplane-mcp-server.selectorLabels" . }}
36+
{{- define "marketplace-mcp-server.labels" -}}
37+
helm.sh/chart: {{ include "marketplace-mcp-server.chart" . }}
38+
{{ include "marketplace-mcp-server.selectorLabels" . }}
3939
{{- if .Chart.AppVersion }}
4040
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4141
{{- end }}
@@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
4545
{{/*
4646
Selector labels
4747
*/}}
48-
{{- define "controlplane-mcp-server.selectorLabels" -}}
49-
app.kubernetes.io/name: {{ include "controlplane-mcp-server.name" . }}
48+
{{- define "marketplace-mcp-server.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "marketplace-mcp-server.name" . }}
5050
app.kubernetes.io/instance: {{ .Release.Name }}
5151
{{- end }}
5252

5353
{{/*
5454
Create the name of the service account to use
5555
*/}}
56-
{{- define "controlplane-mcp-server.serviceAccountName" -}}
56+
{{- define "marketplace-mcp-server.serviceAccountName" -}}
5757
{{- if .Values.serviceAccount.create }}
58-
{{- default (include "controlplane-mcp-server.fullname" .) .Values.serviceAccount.name }}
58+
{{- default (include "marketplace-mcp-server.fullname" .) .Values.serviceAccount.name }}
5959
{{- else }}
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}

cluster/charts/marketplace-mcp-server/templates/deploymentruntimeconfig.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,12 @@ spec:
3434
args:
3535
{{- with .Values.extraArgs.controlplaneMcpServer }}
3636
{{- toYaml . | nindent 12 }}
37-
{{- end }}
37+
{{- end }}
38+
volumeMounts:
39+
- mountPath: /mcp/.up/
40+
name: up-config
41+
readOnly: true
42+
volumes:
43+
- name: up-config
44+
secret:
45+
secretName: {{ .Values.upConfig.secretName }}

cluster/charts/marketplace-mcp-server/values.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ extraArgs:
1515
# packageRuntime:
1616
# - --debug
1717
packageRuntime: []
18-
# controlplaneMcpServer is the name of the controlplane-mcp-server sidecar.
18+
# marketplaceMcpServer is the name of the marketplace-mcp-server sidecar.
1919
# example
2020
# marketplaceMcpServer:
2121
# - --debug
2222
marketplaceMcpServer: []
23+
24+
upConfig:
25+
secretName: up-config

0 commit comments

Comments
 (0)