Quellcode durchsuchen

Adding rancher/my-app

Nefi Munoz vor 1 Jahr
Ursprung
Commit
ea8de4e7b1

BIN
assets/rancher/my-app-0.0.1.tgz


+ 17 - 0
charts/rancher/my-app/Chart.yaml

@@ -0,0 +1,17 @@
+annotations:
+  catalog.cattle.io/certified: rancher
+  catalog.cattle.io/display-name: my-app extension
+  catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.26.0-0'
+  catalog.cattle.io/namespace: cattle-ui-plugin-system
+  catalog.cattle.io/os: linux
+  catalog.cattle.io/permits-os: linux, windows
+  catalog.cattle.io/rancher-version: '>= 2.7.0-0 < 2.8.0-0'
+  catalog.cattle.io/release-name: my-app
+  catalog.cattle.io/scope: management
+  catalog.cattle.io/ui-component: plugins
+apiVersion: v2
+appVersion: 0.0.1
+description: my-app test plugin
+name: my-app
+type: application
+version: 0.0.1

+ 5 - 0
charts/rancher/my-app/README.md

@@ -0,0 +1,5 @@
+## test extensions
+This my-app test extension.  
+
+Enjoy.
+

+ 17 - 0
charts/rancher/my-app/files/nginx.conf

@@ -0,0 +1,17 @@
+events {}
+http {
+    sendfile on;
+    server {
+        listen {{ .Values.pluginServer.service.targetPort }};
+        listen [::]:{{ .Values.pluginServer.service.targetPort }};
+
+        resolver 0.0.0.0;
+        autoindex on;
+
+        server_name _;
+        server_tokens off;
+
+        root /home/plugin-server/plugin-contents;
+        gzip_static on;
+    }
+}

+ 78 - 0
charts/rancher/my-app/templates/_helpers.tpl

@@ -0,0 +1,78 @@
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "plugin-server.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 "plugin-server.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 }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "plugin-server.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "plugin-server.labels" -}}
+helm.sh/chart: {{ include "plugin-server.chart" . }}
+{{ include "plugin-server.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "plugin-server.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "plugin-server.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
+
+{{- define "system_default_registry" -}}
+{{- if .Values.global.cattle.systemDefaultRegistry -}}
+{{- printf "%s/" .Values.global.cattle.systemDefaultRegistry -}}
+{{- else -}}
+{{- "" -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Windows cluster will add default taint for linux nodes, 
+add below linux tolerations to workloads could be scheduled to those linux nodes
+*/}}
+{{- define "linux-node-tolerations" -}}
+- key: "cattle.io/os"
+  value: "linux"
+  effect: "NoSchedule"
+  operator: "Equal"
+{{- end -}}
+
+{{- define "linux-node-selector" -}}
+{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
+beta.kubernetes.io/os: linux
+{{- else -}}
+kubernetes.io/os: linux
+{{- end -}}
+{{- end -}}

+ 14 - 0
charts/rancher/my-app/templates/cr.yaml

@@ -0,0 +1,14 @@
+{{- if .Values.plugin.enabled }}
+apiVersion: catalog.cattle.io/v1
+kind: UIPlugin
+metadata:
+  name: {{ include "plugin-server.fullname" . }}
+  namespace: {{ .Release.Namespace }}
+  labels: {{ include "plugin-server.labels" . | nindent 4 }}
+spec:
+  plugin: # should initially follow the design of the Helm Chart.yaml fields, could discuss modifying this
+    name: {{ include "plugin-server.fullname" . }}
+    version: {{ (semver (default .Chart.AppVersion .Values.plugin.versionOverride)).Original }}
+    endpoint: https://raw.githubusercontent.com/nflondo/my-app/gh-pages/extensions/test/0.0.1
+    noCache: {{ .Values.plugin.noCache }}
+{{- end }}

+ 30 - 0
charts/rancher/my-app/values.yaml

@@ -0,0 +1,30 @@
+global:
+  cattle:
+    systemDefaultRegistry: ""
+  kubectl:
+    repository: rancher/kubectl
+    tag: v1.20.2
+    pullPolicy: IfNotPresent
+  imagePullSecrets: []
+nameOverride: ""
+fullnameOverride: ""
+pluginServer:
+  image:
+    repository: /ui-extension-test
+    pullPolicy: Always
+    tag: 0.0.1
+  service:
+    type: ClusterIP
+    port: 80
+    targetPort: 8080
+  deployment:
+    replicas: 1
+  resources: {}
+  securityContext: {}
+  nodeSelector: {}
+  tolerations: []
+  affinity: {}
+plugin:
+  enabled: true
+  versionOverride: ""
+  noCache: false

+ 22 - 0
index.yaml

@@ -1,5 +1,27 @@
 apiVersion: v1
 entries:
+  my-app:
+  - annotations:
+      catalog.cattle.io/certified: rancher
+      catalog.cattle.io/display-name: my-app extension
+      catalog.cattle.io/kube-version: '>= 1.16.0-0 < 1.26.0-0'
+      catalog.cattle.io/namespace: cattle-ui-plugin-system
+      catalog.cattle.io/os: linux
+      catalog.cattle.io/permits-os: linux, windows
+      catalog.cattle.io/rancher-version: '>= 2.7.0-0 < 2.8.0-0'
+      catalog.cattle.io/release-name: my-app
+      catalog.cattle.io/scope: management
+      catalog.cattle.io/ui-component: plugins
+    apiVersion: v2
+    appVersion: 0.0.1
+    created: "2023-06-02T11:29:48.336129537-06:00"
+    description: my-app test plugin
+    digest: a98490d32a0f265c5f99bf3e70b22f2db7cdf497381574809d8b0fdedbe9abbe
+    name: my-app
+    type: application
+    urls:
+    - assets/rancher/my-app-0.0.1.tgz
+    version: 0.0.1
   test:
   - annotations:
       catalog.cattle.io/certified: rancher

+ 2 - 2
packages/rancher/test/upstream.yaml

@@ -1,5 +1,5 @@
 GitRepo: https://github.com/nflondo/my-app.git
 GitBranch: gh-pages
-GitSubdirectory: charts/test/0.1.2
+GitSubdirectory: charts/test/0.0.1
 Vendor: Rancher
-DisplayName: my-appgit  extension
+DisplayName: my-app extension