From 43438d9a8cddb2a617e94cafbc93b7f71f27a5a9 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Sun, 17 Nov 2024 20:30:52 +0000 Subject: [PATCH] feat(homepage): use secret for the config --- registry/components/homepage/all.yaml | 252 ++++++++++++++++++ .../components/homepage/kustomization.yaml | 12 +- 2 files changed, 263 insertions(+), 1 deletion(-) create mode 100644 registry/components/homepage/all.yaml diff --git a/registry/components/homepage/all.yaml b/registry/components/homepage/all.yaml new file mode 100644 index 0000000..8717ad4 --- /dev/null +++ b/registry/components/homepage/all.yaml @@ -0,0 +1,252 @@ +--- +# Source: homepage/templates/common.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: homepage + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 +secrets: + - name: homepage-sa-token +--- +# Source: homepage/templates/common.yaml +apiVersion: v1 +kind: Secret +type: kubernetes.io/service-account-token +metadata: + name: homepage-sa-token + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 + annotations: + kubernetes.io/service-account.name: homepage +--- +# Source: homepage/templates/common.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: homepage + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 +rules: + - apiGroups: + - "" + resources: + - namespaces + - pods + - nodes + verbs: + - get + - list + - apiGroups: + - extensions + - networking.k8s.io + resources: + - ingresses + verbs: + - get + - list + - apiGroups: + - traefik.containo.us + - traefik.io + resources: + - ingressroutes + verbs: + - get + - list + - apiGroups: + - metrics.k8s.io + resources: + - nodes + - pods + verbs: + - get + - list + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions/status + verbs: + - get +--- +# Source: homepage/templates/common.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: homepage + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: homepage +subjects: + - kind: ServiceAccount + name: homepage + namespace: default +--- +# Source: homepage/templates/common.yaml +apiVersion: v1 +kind: Service +metadata: + name: homepage + labels: + app.kubernetes.io/service: homepage + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 + annotations: +spec: + type: ClusterIP + ports: + - port: 3000 + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/instance: homepage + app.kubernetes.io/name: homepage +--- +# Source: homepage/templates/common.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: homepage + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 + annotations: + configmap.reloader.stakater.com/reload: homepage + values-checksum: e571022cadec2383a11f62ded26db2f306534124e636c12c4bee171a25c02d07 +spec: + revisionHistoryLimit: 3 + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app.kubernetes.io/name: homepage + app.kubernetes.io/instance: homepage + template: + metadata: + labels: + app.kubernetes.io/name: homepage + app.kubernetes.io/instance: homepage + spec: + + serviceAccountName: homepage + automountServiceAccountToken: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + containers: + - name: homepage + image: "ghcr.io/gethomepage/homepage:v0.9.6" + imagePullPolicy: + ports: + - name: http + containerPort: 3000 + protocol: TCP + volumeMounts: + - name: homepage-config + subPath: bookmarks.yaml + mountPath: /app/config/bookmarks.yaml + - name: homepage-config + subPath: docker.yaml + mountPath: /app/config/docker.yaml + - name: homepage-config + subPath: kubernetes.yaml + mountPath: /app/config/kubernetes.yaml + - name: homepage-config + subPath: services.yaml + mountPath: /app/config/services.yaml + - name: homepage-config + subPath: settings.yaml + mountPath: /app/config/settings.yaml + - name: homepage-config + subPath: widgets.yaml + mountPath: /app/config/widgets.yaml + - name: logs + mountPath: /app/config/logs + livenessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + initialDelaySeconds: 0 + periodSeconds: 10 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + startupProbe: + failureThreshold: 30 + initialDelaySeconds: 0 + periodSeconds: 5 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + volumes: + - name: homepage-config + configMap: + name: homepage + - name: logs + emptyDir: + {} +--- +# Source: homepage/templates/common.yaml +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: homepage + labels: + app.kubernetes.io/instance: homepage + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: homepage + app.kubernetes.io/version: v0.9.6 + helm.sh/chart: homepage-2.0.1 + annotations: + cert-manager.io/cluster-issuer: letsencrypt + kubernetes.io/tls-acme: "true" + nginx.ingress.kubernetes.io/auth-realm: Authentication Required + nginx.ingress.kubernetes.io/auth-secret: basic-auth + nginx.ingress.kubernetes.io/auth-type: basic +spec: + ingressClassName: nginx + tls: + - hosts: + - "homepage.simonemms.com" + secretName: "homepage-tls" + rules: + - host: "homepage.simonemms.com" + http: + paths: + - path: "/" + pathType: Prefix + backend: + service: + name: homepage + port: + number: 3000 diff --git a/registry/components/homepage/kustomization.yaml b/registry/components/homepage/kustomization.yaml index 834a07f..cd813b4 100644 --- a/registry/components/homepage/kustomization.yaml +++ b/registry/components/homepage/kustomization.yaml @@ -1,6 +1,16 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - application.yaml + - all.yaml - configmap.yaml - namespace.yaml +patches: + - target: + group: apps + version: v1 + kind: Deployment + name: homepage + patch: |- + - op: replace + path: /spec/replicas + value: 2