neutrinos-cli 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/.configs/auth.json +5 -0
  2. package/.configs/preferences.json +5 -0
  3. package/.env +6 -0
  4. package/README.md +173 -0
  5. package/bin/cli.js +239 -0
  6. package/cli-auth/auth.js +54 -0
  7. package/cli-auth/publish.js +7 -0
  8. package/cli-auth/server.js +44 -0
  9. package/cli-auth/services/auth-utils.js +68 -0
  10. package/commands/alpha-publish.js +219 -0
  11. package/commands/attribute.js +155 -0
  12. package/commands/build.js +83 -0
  13. package/commands/deprecate.js +88 -0
  14. package/commands/dev.js +21 -0
  15. package/commands/generate.js +19 -0
  16. package/commands/new-workspace.js +142 -0
  17. package/commands/publish.js +334 -0
  18. package/commands/select-packages.mjs +36 -0
  19. package/commands/serve.js +27 -0
  20. package/package.json +34 -0
  21. package/setup.js +55 -0
  22. package/templates/assets/default-icon.png +0 -0
  23. package/templates/component/.component.ts.hbs +126 -0
  24. package/templates/component/.spec.ts.hbs +15 -0
  25. package/templates/component/.styles.ts.hbs +2 -0
  26. package/templates/module/.module.js.hbs +11 -0
  27. package/templates/plugins-server/index.js +18 -0
  28. package/templates/project/.vscode/extensions.json +6 -0
  29. package/templates/project/ATTRIBUTE.md +127 -0
  30. package/templates/project/Dockerfile +15 -0
  31. package/templates/project/helmchart/.helmignore +23 -0
  32. package/templates/project/helmchart/Chart.yaml +24 -0
  33. package/templates/project/helmchart/templates/NOTES.txt +22 -0
  34. package/templates/project/helmchart/templates/_helpers.tpl +62 -0
  35. package/templates/project/helmchart/templates/deployment.yaml +69 -0
  36. package/templates/project/helmchart/templates/ingress.yaml +62 -0
  37. package/templates/project/helmchart/templates/service.yaml +14 -0
  38. package/templates/project/helmchart/values.yaml +74 -0
  39. package/templates/project/index.html +24 -0
  40. package/templates/project/index.ts +86 -0
  41. package/templates/project/public-api.ts +0 -0
  42. package/templates/project/tsconfig.json +27 -0
  43. package/utils/attribute-utils.js +149 -0
  44. package/utils/check-valid-ws.js +21 -0
  45. package/utils/copy-utils.js +68 -0
  46. package/utils/create-client.js +23 -0
  47. package/utils/file-utils.js +43 -0
  48. package/utils/generate-component.js +101 -0
  49. package/utils/generate-module.js +51 -0
  50. package/utils/get-package-info.js +53 -0
  51. package/utils/get-packages.js +15 -0
  52. package/utils/inquirer-utils.js +49 -0
  53. package/utils/logger.js +35 -0
  54. package/utils/marketplace-api-utils.js +34 -0
  55. package/utils/path-utils.js +40 -0
  56. package/utils/prettify.js +36 -0
  57. package/utils/user-seesion-utils.js +43 -0
@@ -0,0 +1,126 @@
1
+ import { ATTRIBUTE_TYPE, AlphaAttribute, AlphaComponent, UI_TYPE, adoptAlphaCommonStyle } from '@jatahworx/alpha-annotations-lib';
2
+ import { LitElement, html } from 'lit';
3
+ import { property } from 'lit/decorators.js';
4
+ import { componentStyles } from './{{componentSelector}}.styles.ts';
5
+
6
+ @AlphaComponent({
7
+ componentName: '{{componentSelector}}',
8
+ componentVersion: '1.0.0',
9
+ label: '{{componentLabel}}',
10
+ selector: '{{componentSelectorPrefix}}-{{componentSelector}}',
11
+ category: 'Input',
12
+ icon: 'sample.png',
13
+ })
14
+ @adoptAlphaCommonStyle()
15
+ export class {{componentClassName}} extends LitElement {
16
+ static styles = componentStyles;
17
+
18
+
19
+ /**
20
+ * @description
21
+ * Attribute for property for the component
22
+ * @param type -- ATTRIBUTE_TYPE.PROPERTY
23
+ * @param uiType -- type of the component by which the value can get to this property
24
+ * @param label -- Label on the editable component
25
+ * @param defaultValue -- Default value to the property
26
+ * @param placeholder -- placeholder on the editable component
27
+ * @param fieldMappings -- the value of this attribute will assign to the path/property name defined here
28
+ */
29
+ @AlphaAttribute({
30
+ type: ATTRIBUTE_TYPE.PROPERTY,
31
+ uiType: UI_TYPE.INPUT,
32
+ label: 'Initial Count',
33
+ defaultValue: 0,
34
+ placeholder: 'Enter label',
35
+ fieldMappings: 'value'
36
+ })
37
+ @property({ type: Number })
38
+ value = 0;
39
+
40
+ @AlphaAttribute({
41
+ uiType: UI_TYPE.TYPED_INPUT,
42
+ type: ATTRIBUTE_TYPE.PROPERTY,
43
+ label: 'Value',
44
+ category: 'Binding Variable',
45
+ options: [
46
+ { name: 'CO', value: 'co' },
47
+ { name: 'CMS', value: 'cms' },
48
+ { name: 'Case Instance', value: 'case_instance' },
49
+ { name: 'Task Instance', value: 'task_instance' },
50
+ { name: 'Local', value: 'local' },
51
+ ],
52
+ fieldMappings: {
53
+ type: 'options.mappingType',
54
+ value: 'options.modelPath',
55
+ },
56
+ })
57
+ options = {
58
+ mappingType: '',
59
+ modelPath: ''
60
+ }
61
+
62
+ @property({ type: Boolean })
63
+ disabled = false;
64
+
65
+ @property({ type: Boolean })
66
+ readonly = false;
67
+
68
+
69
+ render() {
70
+ return html`
71
+ <button @click=${this.increment}>+</button>
72
+ ${this.value || 0}
73
+ <button @click=${this.decrement}>-</button>
74
+ `;
75
+ }
76
+
77
+
78
+ /**
79
+ * @description
80
+ * Attribute for Event from the component
81
+ * @param type -- ATTRIBUTE_TYPE.EVENT
82
+ * @param label -- Label of the Event to show in the trigger list
83
+ * @param event -- Actual event name on which event listner will add
84
+ */
85
+ @AlphaAttribute({
86
+ type: ATTRIBUTE_TYPE.EVENT,
87
+ label: 'On Increment',
88
+ event: 'onIncrement',
89
+ })
90
+ increment(event) {
91
+ this.change(1);
92
+ const eventOptions = {
93
+ detail: {
94
+ event,
95
+ element: this,
96
+ value: this.value,
97
+ },
98
+ bubbles: true,
99
+ composed: true,
100
+ };
101
+ this.dispatchEvent(new CustomEvent('onIncrement', eventOptions));
102
+ }
103
+
104
+ @AlphaAttribute({
105
+ type: ATTRIBUTE_TYPE.EVENT,
106
+ label: 'On Decrement',
107
+ event: 'onDecrement',
108
+ })
109
+ decrement(event) {
110
+ this.change(-1);
111
+ const eventOptions = {
112
+ detail: {
113
+ event,
114
+ element: this,
115
+ value: this.value,
116
+ },
117
+ bubbles: true,
118
+ composed: true,
119
+ };
120
+ this.dispatchEvent(new CustomEvent('onDecrement', eventOptions));
121
+ }
122
+
123
+ private change(delta: number) {
124
+ this.value = Number(this.value) + delta;
125
+ }
126
+ }
@@ -0,0 +1,15 @@
1
+ import { expect, fixture } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import './{{componentSelector}}';
4
+ import { {{componentClassName}} } from './{{componentSelector}}';
5
+
6
+ describe('alpha-hue', () => {
7
+ beforeEach(async () => {
8
+ // Things to do before each test
9
+ });
10
+
11
+ it('should render', async () => {
12
+ const element: Hue = await fixture(html\`<{{componentSelector}}></{{componentSelector}}>\`);
13
+ expect(element).shadowDom.to.equalSnapshot();
14
+ });
15
+ });
@@ -0,0 +1,2 @@
1
+ import { css } from 'lit'; const style = css` :host { display: block; } `;
2
+ export const componentStyles = [style];
@@ -0,0 +1,11 @@
1
+ class {{pluginClassName}} {
2
+ init() {
3
+ console.log('initialosed');
4
+ }
5
+
6
+ onRegister() {
7
+ console.log(`Plugin registered and available as alpha['{{plginId}}']`);
8
+ }
9
+
10
+ }
11
+ alpha.registerPlugins('{{plginId}}', new {{pluginClassName}}());
@@ -0,0 +1,18 @@
1
+ import express from 'express';
2
+ import { env } from 'node:process';
3
+
4
+ const router = express.Router();
5
+ const app = express();
6
+ const port = env.PORT || 3000;
7
+ const basePath = env.BASE_PATH || '';
8
+
9
+ app.listen(port, () => {
10
+ console.log(`Server started at http://localhost:${port}${basePath}`);
11
+ });
12
+
13
+ router.get('/ping', (req, res) => {
14
+ res.send({ message: 'Hello World!' });
15
+ });
16
+ router.use('/plugins', express.static('plugins'));
17
+
18
+ app.use(basePath, router);
@@ -0,0 +1,6 @@
1
+ {
2
+ "recommendations": [
3
+ "runem.lit-plugin",
4
+ "bierner.markdown-preview-github-styles"
5
+ ]
6
+ }
@@ -0,0 +1,127 @@
1
+ # Component Attributes
2
+
3
+ This command provides functionality to manage attributes for components in a component. It allows adding various types of attributes to components with different UI types and field mappings.
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ neutrinos generate attribute [componentName] [Options] | neutrinos g a [componentName] [Options]
9
+ ```
10
+
11
+ ### Arguments:
12
+
13
+ - `[componentName]` Name of the component to generate an attribute
14
+
15
+ ### Options
16
+
17
+ - `-t` , `--type <attributeType>` Type of attribute can be property, event, validation
18
+ - `-u` , `--ui-type <uiType>` Ui-type of attribute can be ===> input, toggle, dropdown, multi-select, typed-input, range, color-picker,data-source, data-set, table-actions, data-mapping
19
+ - `-l` , `--label <label>` Label for an attribute
20
+ - `-e` , `--event <event>` Event name for an attribute if -t/--type is event
21
+ - `-c` , `--category <category>` Category for an attribute
22
+ - `-p` , `--placeholder <placeholder>` Placeholder for an attribute
23
+ - `-d` , `--defaultValue <defaultValue>` DefaultValue for an attribute
24
+ - `-o` , `--options <options...>` Options for an attribute
25
+ - `-f` , `--fieldMappings <FieldMappings>` FieldMappings for package
26
+ - `-n` , `--validation <validation>` Validation for an attribute
27
+
28
+ ## Attribute Inteface
29
+
30
+ ```ts
31
+ Interface AlphaAttribute {
32
+ type: 'property' | 'event' | 'validation',
33
+ uiType: 'input' | 'toggle ' | 'dropdown' |'multi-select' | 'typed-input' | 'range' |'color-picker' | 'data-source' | 'data-set' | 'table-actions' | 'data-mapping',
34
+ label: string;
35
+ event: string;
36
+ category: string;
37
+ placeholder: string;
38
+ defaultValue: boolean | string | number | any[] | object;
39
+ options:
40
+ Array<{
41
+ displayText: string | number; value: string | number | boolean
42
+ }> |
43
+ Array<{
44
+ name:'CMS' | 'CO' | 'Task Instance' | 'Case Instance' | 'String' | 'Language' | 'Local';
45
+ value: 'cms' | 'co' | 'task_instance' | 'case_instance' | 'string' | 'lang' | 'local';
46
+ }> |
47
+ {
48
+ minLabel: string;
49
+ maxLabel: string;
50
+ minRange: number;
51
+ maxRange: number;
52
+ } |
53
+ {
54
+ maxLength: number;
55
+ } |
56
+ {
57
+ type: 'text' | 'number';
58
+ };
59
+ fieldMappings: string |
60
+ {
61
+ type: string;
62
+ value: string;
63
+ } |
64
+ {
65
+ response: any;
66
+ label: string;
67
+ value: string;
68
+ } |
69
+ Record<string, string>;
70
+ validation: Record<string, any>;
71
+ }
72
+ ```
73
+
74
+ ## Attribute Types
75
+
76
+ There are three main types of attributes:
77
+
78
+ 1. **property**: Regular attributes that define properties of a component.
79
+ 2. **event**: Attributes that define events for a component.
80
+ 3. **validation**: Attributes that define validation rules for a component.
81
+
82
+ ## UI Types
83
+
84
+ The UI types specify the type of user interface element associated with an attribute. The following UI types are supported:
85
+
86
+ - input
87
+ - toggle
88
+ - dropdown
89
+ - multi-select
90
+ - typed-input
91
+ - range
92
+ - color-picker
93
+ - data-source
94
+ - data-set
95
+ - table-actions
96
+ - data-mapping
97
+
98
+ ## Field Mappings
99
+
100
+ Field mappings is the value of attribute assign to which property of component. These ui type will emmit these values;
101
+
102
+ - **Data mapping**: `response`, `actions`, `columns`, `actionColumn`, `pagination`, `paginationData`
103
+ - **Dataset**: `value`
104
+ - **Datasource**: `response`, `label`, `value`
105
+ - **Typed input**: `type`, `value`
106
+
107
+ ## Options
108
+
109
+ Some UI types required options:
110
+
111
+ - **Drop down**: Requires array of `displayText`, `value`,
112
+
113
+ ```ts
114
+ Array<{
115
+ displayText: string;
116
+ value: string;
117
+ }>;
118
+ ```
119
+
120
+ - **Typed input**: Requires array of `name`, `value`
121
+
122
+ ```ts
123
+ Array<{
124
+ name: string;
125
+ value: string;
126
+ }>;
127
+ ```
@@ -0,0 +1,15 @@
1
+ FROM node:22-alpine3.21
2
+
3
+ WORKDIR /src
4
+
5
+ RUN npm install -g npm@latest
6
+
7
+ COPY ./plugins-server /src
8
+ COPY ./package.json /src
9
+ COPY .npmrc /src
10
+
11
+ RUN npm install --omit=dev
12
+
13
+ EXPOSE 3000
14
+
15
+ CMD ["node", "index.js"]
@@ -0,0 +1,23 @@
1
+ # Patterns to ignore when building packages.
2
+ # This supports shell glob matching, relative path matching, and
3
+ # negation (prefixed with !). Only one pattern per line.
4
+ .DS_Store
5
+ # Common VCS dirs
6
+ .git/
7
+ .gitignore
8
+ .bzr/
9
+ .bzrignore
10
+ .hg/
11
+ .hgignore
12
+ .svn/
13
+ # Common backup files
14
+ *.swp
15
+ *.bak
16
+ *.tmp
17
+ *.orig
18
+ *~
19
+ # Various IDEs
20
+ .project
21
+ .idea/
22
+ *.tmproj
23
+ .vscode/
@@ -0,0 +1,24 @@
1
+ apiVersion: v2
2
+ name: plugins-server
3
+ description: A Helm chart for Kubernetes
4
+
5
+ # A chart can be either an 'application' or a 'library' chart.
6
+ #
7
+ # Application charts are a collection of templates that can be packaged into versioned archives
8
+ # to be deployed.
9
+ #
10
+ # Library charts provide useful utilities or functions for the chart developer. They're included as
11
+ # a dependency of application charts to inject those utilities and functions into the rendering
12
+ # pipeline. Library charts do not define any templates and therefore cannot be deployed.
13
+ type: application
14
+
15
+ # This is the chart version. This version number should be incremented each time you make changes
16
+ # to the chart and its templates, including the app version.
17
+ # Versions are expected to follow Semantic Versioning (https://semver.org/)
18
+ version: 0.1.0
19
+
20
+ # This is the version number of the application being deployed. This version number should be
21
+ # incremented each time you make changes to the application. Versions are not expected to
22
+ # follow Semantic Versioning. They should reflect the version the application is using.
23
+ # It is recommended to use it with quotes.
24
+ appVersion: '1.16.0'
@@ -0,0 +1,22 @@
1
+ 1. Get the application URL by running these commands:
2
+ {{- if .Values.ingress.enabled }}
3
+ {{- range $host := .Values.ingress.hosts }}
4
+ {{- range .paths }}
5
+ http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6
+ {{- end }}
7
+ {{- end }}
8
+ {{- else if contains "NodePort" .Values.service.type }}
9
+ export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "plugins-server.fullname" . }})
10
+ export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11
+ echo http://$NODE_IP:$NODE_PORT
12
+ {{- else if contains "LoadBalancer" .Values.service.type }}
13
+ NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14
+ You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "plugins-server.fullname" . }}'
15
+ export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "plugins-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16
+ echo http://$SERVICE_IP:{{ .Values.service.port }}
17
+ {{- else if contains "ClusterIP" .Values.service.type }}
18
+ export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "plugins-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19
+ export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20
+ echo "Visit http://127.0.0.1:8080 to use your application"
21
+ kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22
+ {{- end }}
@@ -0,0 +1,62 @@
1
+ {{/*
2
+ Expand the name of the chart.
3
+ */}}
4
+ {{- define "plugins-server.name" -}}
5
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6
+ {{- end }}
7
+
8
+ {{/*
9
+ Create a default fully qualified app name.
10
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11
+ If release name contains chart name it will be used as a full name.
12
+ */}}
13
+ {{- define "plugins-server.fullname" -}}
14
+ {{- if .Values.fullnameOverride }}
15
+ {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16
+ {{- else }}
17
+ {{- $name := default .Chart.Name .Values.nameOverride }}
18
+ {{- if contains $name .Release.Name }}
19
+ {{- .Release.Name | trunc 63 | trimSuffix "-" }}
20
+ {{- else }}
21
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22
+ {{- end }}
23
+ {{- end }}
24
+ {{- end }}
25
+
26
+ {{/*
27
+ Create chart name and version as used by the chart label.
28
+ */}}
29
+ {{- define "plugins-server.chart" -}}
30
+ {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31
+ {{- end }}
32
+
33
+ {{/*
34
+ Common labels
35
+ */}}
36
+ {{- define "plugins-server.labels" -}}
37
+ helm.sh/chart: {{ include "plugins-server.chart" . }}
38
+ {{ include "plugins-server.selectorLabels" . }}
39
+ {{- if .Chart.AppVersion }}
40
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41
+ {{- end }}
42
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
43
+ {{- end }}
44
+
45
+ {{/*
46
+ Selector labels
47
+ */}}
48
+ {{- define "plugins-server.selectorLabels" -}}
49
+ app.kubernetes.io/name: {{ include "plugins-server.name" . }}
50
+ app.kubernetes.io/instance: {{ .Release.Name }}
51
+ {{- end }}
52
+
53
+ {{/*
54
+ Create the name of the service account to use
55
+ */}}
56
+ {{- define "plugins-server.serviceAccountName" -}}
57
+ {{- if .Values.serviceAccount.create }}
58
+ {{- default (include "plugins-server.fullname" .) .Values.serviceAccount.name }}
59
+ {{- else }}
60
+ {{- default "default" .Values.serviceAccount.name }}
61
+ {{- end }}
62
+ {{- end }}
@@ -0,0 +1,69 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ include "plugins-server.fullname" . }}
5
+ namespace: {{ .Values.namespace }}
6
+ labels:
7
+ {{- include "plugins-server.labels" . | nindent 4 }}
8
+ spec:
9
+ {{- if not .Values.autoscaling.enabled }}
10
+ replicas: {{ .Values.replicaCount }}
11
+ {{- end }}
12
+ selector:
13
+ matchLabels:
14
+ {{- include "plugins-server.selectorLabels" . | nindent 6 }}
15
+ template:
16
+ metadata:
17
+ {{- with .Values.podAnnotations }}
18
+ annotations:
19
+ {{- toYaml . | nindent 8 }}
20
+ {{- end }}
21
+ labels:
22
+ {{- include "plugins-server.labels" . | nindent 8 }}
23
+ {{- with .Values.podLabels }}
24
+ {{- toYaml . | nindent 8 }}
25
+ {{- end }}
26
+ spec:
27
+ {{- with .Values.imagePullSecrets }}
28
+ imagePullSecrets:
29
+ {{- toYaml . | nindent 8 }}
30
+ {{- end }}
31
+ containers:
32
+ - name: {{ .Chart.Name }}
33
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
34
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
35
+ ports:
36
+ - name: http
37
+ containerPort: {{ .Values.service.port }}
38
+ protocol: TCP
39
+ livenessProbe:
40
+ {{- toYaml .Values.livenessProbe | nindent 12 }}
41
+ readinessProbe:
42
+ {{- toYaml .Values.readinessProbe | nindent 12 }}
43
+ resources:
44
+ {{- toYaml .Values.resources | nindent 12 }}
45
+ env:
46
+ {{- range .Values.env }}
47
+ - name: {{ .name }}
48
+ value: {{ .value | quote }}
49
+ {{- end }}
50
+ {{- with .Values.volumeMounts }}
51
+ volumeMounts:
52
+ {{- toYaml . | nindent 12 }}
53
+ {{- end }}
54
+ {{- with .Values.volumes }}
55
+ volumes:
56
+ {{- toYaml . | nindent 8 }}
57
+ {{- end }}
58
+ {{- with .Values.nodeSelector }}
59
+ nodeSelector:
60
+ {{- toYaml . | nindent 8 }}
61
+ {{- end }}
62
+ {{- with .Values.affinity }}
63
+ affinity:
64
+ {{- toYaml . | nindent 8 }}
65
+ {{- end }}
66
+ {{- with .Values.tolerations }}
67
+ tolerations:
68
+ {{- toYaml . | nindent 8 }}
69
+ {{- end }}
@@ -0,0 +1,62 @@
1
+ {{- if .Values.ingress.enabled -}}
2
+ {{- $fullName := include "plugins-server.fullname" . -}}
3
+ {{- $svcPort := .Values.service.port -}}
4
+ {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5
+ {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
6
+ {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
7
+ {{- end }}
8
+ {{- end }}
9
+ {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10
+ apiVersion: networking.k8s.io/v1
11
+ {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12
+ apiVersion: networking.k8s.io/v1beta1
13
+ {{- else -}}
14
+ apiVersion: extensions/v1beta1
15
+ {{- end }}
16
+ kind: Ingress
17
+ metadata:
18
+ name: {{ $fullName }}
19
+ namespace: {{ .Values.namespace }}
20
+ labels:
21
+ {{- include "plugins-server.labels" . | nindent 4 }}
22
+ {{- with .Values.ingress.annotations }}
23
+ annotations:
24
+ {{- toYaml . | nindent 4 }}
25
+ {{- end }}
26
+ spec:
27
+ {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
28
+ ingressClassName: {{ .Values.ingress.className }}
29
+ {{- end }}
30
+ {{- if .Values.ingress.tls }}
31
+ tls:
32
+ {{- range .Values.ingress.tls }}
33
+ - hosts:
34
+ {{- range .hosts }}
35
+ - {{ . | quote }}
36
+ {{- end }}
37
+ secretName: {{ .secretName }}
38
+ {{- end }}
39
+ {{- end }}
40
+ rules:
41
+ {{- range .Values.ingress.hosts }}
42
+ - host: {{ .host | quote }}
43
+ http:
44
+ paths:
45
+ {{- range .paths }}
46
+ - path: {{ .path }}
47
+ {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
48
+ pathType: {{ .pathType }}
49
+ {{- end }}
50
+ backend:
51
+ {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
52
+ service:
53
+ name: {{ $fullName }}
54
+ port:
55
+ number: {{ $svcPort }}
56
+ {{- else }}
57
+ serviceName: {{ $fullName }}
58
+ servicePort: {{ $svcPort }}
59
+ {{- end }}
60
+ {{- end }}
61
+ {{- end }}
62
+ {{- end }}
@@ -0,0 +1,14 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: { { include "plugins-server.fullname" . } }
5
+ namespace: { { .Values.namespace } }
6
+ labels: { { - include "plugins-server.labels" . | nindent 4 } }
7
+ spec:
8
+ type: { { .Values.service.type } }
9
+ ports:
10
+ - port: { { .Values.service.port } }
11
+ targetPort: { { .Values.service.targetPort } }
12
+ protocol: TCP
13
+ name: http
14
+ selector: { { - include "plugins-server.selectorLabels" . | nindent 4 } }
@@ -0,0 +1,74 @@
1
+ namespace: alpha
2
+
3
+ replicaCount: 1
4
+ image:
5
+ repository: docker.neutrinos.co/plugins-server
6
+ pullPolicy: Always
7
+ tag: '1.0.0'
8
+
9
+ imagePullSecrets:
10
+ - name: regcred
11
+
12
+ nameOverride: 'plugins-service'
13
+ fullnameOverride: 'plugins-service'
14
+ podAnnotations: {}
15
+ podLabels: {}
16
+
17
+ service:
18
+ type: ClusterIP
19
+ port: 4000
20
+ targetPort: 4000
21
+
22
+ ingress:
23
+ enabled: true
24
+ className: nginx
25
+ annotations: {}
26
+ hosts:
27
+ - host: alpha.neutrinos-apps.com
28
+ paths:
29
+ - path: /plugins-service
30
+ pathType: Prefix
31
+ tls: []
32
+
33
+ env:
34
+ - name: PORT
35
+ value: '3000'
36
+
37
+ resources:
38
+ limits:
39
+ cpu: '500m'
40
+ memory: '512Mi'
41
+ requests:
42
+ cpu: '250m'
43
+ memory: '256Mi'
44
+
45
+ livenessProbe:
46
+ httpGet:
47
+ path: /plugins-service/ping
48
+ port: 3000
49
+ initialDelaySeconds: 20
50
+ periodSeconds: 10
51
+ timeoutSeconds: 5
52
+ successThreshold: 1
53
+ failureThreshold: 3
54
+ readinessProbe:
55
+ httpGet:
56
+ path: /plugins-service/ping
57
+ port: 3000
58
+ initialDelaySeconds: 20
59
+ periodSeconds: 10
60
+ timeoutSeconds: 5
61
+ successThreshold: 1
62
+ failureThreshold: 3
63
+
64
+ autoscaling:
65
+ enabled: false
66
+ minReplicas: 1
67
+ maxReplicas: 100
68
+ targetCPUUtilizationPercentage: 80
69
+
70
+ volumes: []
71
+ volumeMounts: []
72
+ nodeSelector: {}
73
+ tolerations: []
74
+ affinity: {}