Skip to content

Commit

Permalink
handbook: fix cms ingress prefix, mount cms-config via secret (#158)
Browse files Browse the repository at this point in the history
* handbook: fix cms ingress prefix, mount cms-config via secret

* staticjscms-deployment: fix template
  • Loading branch information
lyind authored Oct 17, 2023
1 parent a50c17f commit a3d6b64
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ COPY . /src
RUN cd themes/docsy && npm install
# build static site
RUN hugo --verbose --gc --minify --enableGitInfo --cleanDestinationDir --destination /src/public
RUN mkdir -p /src/public/admin && cp /src/cms/cms-config.yaml /src/public/admin/config.yml

# use minimal nginx alpine image for serving static html
FROM quay.io/giantswarm/nginx-unprivileged:1.21-alpine
Expand Down
9 changes: 1 addition & 8 deletions helm/handbook/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,7 @@ spec:
name: handbook
port:
number: 8080
- path: /admin/config.yml
pathType: Prefix
backend:
service:
name: handbook
port:
number: 8080
- path: /admin/
- path: /admin
pathType: Prefix
backend:
service:
Expand Down
4 changes: 4 additions & 0 deletions helm/handbook/templates/staticjscms-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ spec:
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 2
volumeMounts:
{{- .Values.volumeMounts | toYaml | nindent 12 }}
volumes:
{{- .Values.volumes | toYaml | nindent 8 }}
serviceAccount: handbook
serviceAccountName: handbook
imagePullSecrets:
Expand Down
25 changes: 21 additions & 4 deletions helm/handbook/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,31 @@ secrets:
- name: staticjscms-secret
data:
- key: ORIGINS
value: aHR0cHM6Ly9oYW5kYm9vay5naWFudHN3YXJtLmlv
value: "aHR0cHM6Ly9oYW5kYm9vay5naWFudHN3YXJtLmlv"
- key: OAUTH_CLIENT_ID
value: MjE5OTEyMzk5MWFzZGVhZGJlZWY=
value: "MjE5OTEyMzk5MWFzZGVhZGJlZWY="
- key: OAUTH_CLIENT_SECRET
value: YWFkc3NhZGFkYWRhZGFkMTIzMTIzMTIzMWFkYWRhZDEyMzEyM2FiYw==
value: "YWFkc3NhZGFkYWRhZGFkMTIzMTIzMTIzMWFkYWRhZDEyMzEyM2FiYw=="
- key: GIT_HOSTNAME
value: ""
- name: staticjscms-hugo-standalone-pull-secret
data:
- key: .dockerconfigjson
value: ewogICAgICAgICAgICAiYXV0aHMiOiB7CiAgICAgICAgICAgICAgImdoY3IuaW8iOiB7CiAgICAgICAgICAgICAgICAiYXV0aCI6ICJZbXhoWW14aE9tSnNZV0pzWVFvPSIKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0=
value: "ewogICAgICAgICAgICAiYXV0aHMiOiB7CiAgICAgICAgICAgICAgImdoY3IuaW8iOiB7CiAgICAgICAgICAgICAgICAiYXV0aCI6ICJZbXhoWW14aE9tSnNZV0pzWVFvPSIKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0="
- name: cms-config
data:
- key: config.yml
value: "YmFja2VuZDoKICBuYW1lOiBnaXRodWIKICByZXBvOiBnaWFudHN3YXJtL2hhbmRib29rCiAgYmFzZV91cmw6IGh0dHBzOi8vaGFuZGJvb2suZ2lhbnRzd2FybS5pbwogIGJyYW5jaDogbWFpbgogIGNvbW1pdF9tZXNzYWdlczoKICAgIGNyZWF0ZTogIkNyZWF0ZSB7e2NvbGxlY3Rpb259fSDigJx7e3BhdGh9feKAnSIKICAgIHVwZGF0ZTogIlVwZGF0ZSB7e2NvbGxlY3Rpb259fSDigJx7e3BhdGh9feKAnSIKICAgIGRlbGV0ZTogIkRlbGV0ZSB7e2NvbGxlY3Rpb259fSDigJx7e3BhdGh9feKAnSIKICAgIHVwbG9hZE1lZGlhOiAiVXBsb2FkIOKAnHt7cGF0aH194oCdIgogICAgZGVsZXRlTWVkaWE6ICJEZWxld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dGluZyBlbnRyeSB3aWxsIG1vdmUgdGhlIGVudGlyZSBzdWJ0cmVlIG9mIHRoZSBlbnRyeSB0byB0aGUgbmV3IGxvY2F0aW9uCiAgICBtZXRhOiB7IHBhdGg6IHsgd2lkZ2V0OiBzdHJpbmcsIGxhYmVsOiAnUGF0aCcsIGluZGV4X2ZpbGU6ICdfaW5kZXgnIH0gfQogICAgZmllbGRzOgogICAgICAtIHsgbGFiZWw6ICJUaXRsZSIsIG5hbWU6IHRpdGxlLCB3aWRnZXQ6ICJzdHJpbmciIH0KICAgICAgLSB7IGxhYmVsOiAiRGVzY3JpcHRpb24iLCBuYW1lOiBkZXNjcmlwdGlvbiwgd2lkZ2V0OiAic3RyaW5nIiB9CiAgICAgIC0gbGFiZWw6ICJDb25maWRlbnRpYWxpdHkiCiAgICAgICAgbmFtZTogY29uZmlkZW50aWFsaXR5CiAgICAgICAgd2lkZ2V0OiAic2VsZWN0IgogICAgICAgIG9wdGlvbnM6IFsicHVibGljIiwgIm9wZXJhdGlvbmFsIiwgInByaXZhdGUiXQogICAgICAtIHsgbGFiZWw6ICJCb2R5IiwgbmFtZTogYm9keSwgd2lkZ2V0OiAibWFya2Rvd24iIH0="

volumes:
- name: cms-config
secret:
secretName: cms-config
items:
- key: config.yml
path: config.yml

volumeMounts:
- name: cms-config
mountPath: "/app/config.yml"
subPath: "config.yml"

0 comments on commit a3d6b64

Please sign in to comment.