From c9a2799d8d2039e7ee984177a8526872e1f811be Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 13 Dec 2021 13:17:42 -0500 Subject: [PATCH 1/8] scaffolding new subchart for erc1155 connector Signed-off-by: hfuss --- .../charts/firefly-dev/values-local-acme.yaml | 41 ++++++++++ .../firefly-dev/values-local-randalls.yaml | 41 ++++++++++ deploy/charts/firefly-erc1155/.helmignore | 23 ++++++ deploy/charts/firefly-erc1155/Chart.yaml | 24 ++++++ .../firefly-erc1155/templates/NOTES.txt | 22 +++++ .../firefly-erc1155/templates/_helpers.tpl | 62 ++++++++++++++ .../firefly-erc1155/templates/deployment.yaml | 61 ++++++++++++++ .../charts/firefly-erc1155/templates/hpa.yaml | 28 +++++++ .../firefly-erc1155/templates/ingress.yaml | 61 ++++++++++++++ .../firefly-erc1155/templates/service.yaml | 15 ++++ .../templates/serviceaccount.yaml | 12 +++ .../templates/tests/test-connection.yaml | 15 ++++ deploy/charts/firefly-erc1155/values.yaml | 82 +++++++++++++++++++ .../firefly/templates/erc1155/deployment.yaml | 61 ++++++++++++++ .../firefly/templates/erc1155/service.yaml | 15 ++++ deploy/charts/firefly/values.yaml | 3 + 16 files changed, 566 insertions(+) create mode 100644 deploy/charts/firefly-dev/values-local-acme.yaml create mode 100644 deploy/charts/firefly-dev/values-local-randalls.yaml create mode 100644 deploy/charts/firefly-erc1155/.helmignore create mode 100644 deploy/charts/firefly-erc1155/Chart.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/NOTES.txt create mode 100644 deploy/charts/firefly-erc1155/templates/_helpers.tpl create mode 100644 deploy/charts/firefly-erc1155/templates/deployment.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/hpa.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/ingress.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/service.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/serviceaccount.yaml create mode 100644 deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml create mode 100644 deploy/charts/firefly-erc1155/values.yaml create mode 100644 deploy/charts/firefly/templates/erc1155/deployment.yaml create mode 100644 deploy/charts/firefly/templates/erc1155/service.yaml diff --git a/deploy/charts/firefly-dev/values-local-acme.yaml b/deploy/charts/firefly-dev/values-local-acme.yaml new file mode 100644 index 0000000000..45a264d364 --- /dev/null +++ b/deploy/charts/firefly-dev/values-local-acme.yaml @@ -0,0 +1,41 @@ + +firefly: + config: + debugEnabled: true + preInit: false + adminEnabled: true + organizationName: acme + organizationIdentity: 0x46375df502d7b789f2c39a7be4cc34795230ac06 + fireflyContractAddress: /instances/0xb149aad91748aef8b3c2e4a69f5fcb6428827c8c + # paymentAddress: 0x4b7139c54b9e2d9eb3d52774e5b2cda75500a8f0 + + ethconnectUrl: https://u0w5t5bum3-u0ygwqbxog-connect.us0-aws.kaleido.io/ + ethconnectUsername: u0nh7s3rnf + ethconnectPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + ethconnectPrefixLong: kaleido + ethconnectPrefixShort: kld + + ipfsApiUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io + ipfsApiUsername: u0nh7s3rnf + ipfsApiPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + + ipfsGatewayUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io + ipfsGatewayUsername: u0nh7s3rnf + ipfsGatewayPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + + dataexchange: + apiKey: a-secret + certificate: + enabled: true + issuerRef: + name: selfsigned-ca + kind: ClusterIssuer + + tlsSecret: + enabled: false + +ipfs: + enabled: false + +ethconnect: + enabled: false diff --git a/deploy/charts/firefly-dev/values-local-randalls.yaml b/deploy/charts/firefly-dev/values-local-randalls.yaml new file mode 100644 index 0000000000..e382d95944 --- /dev/null +++ b/deploy/charts/firefly-dev/values-local-randalls.yaml @@ -0,0 +1,41 @@ + +firefly: + config: + debugEnabled: true + preInit: false + adminEnabled: true + organizationName: randalls + organizationIdentity: 0x59fa082cd543ebfa7869423219e32d92cbcd2658 + fireflyContractAddress: /instances/0xb149aad91748aef8b3c2e4a69f5fcb6428827c8c + # paymentAddress: 0x4b7139c54b9e2d9eb3d52774e5b2cda75500a8f0 + + ethconnectUrl: https://u0w5t5bum3-u0xfyqqhwx-connect.us0-aws.kaleido.io/ + ethconnectUsername: u0nh7s3rnf + ethconnectPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + ethconnectPrefixLong: kaleido + ethconnectPrefixShort: kld + + ipfsApiUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io + ipfsApiUsername: u0nh7s3rnf + ipfsApiPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + + ipfsGatewayUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io + ipfsGatewayUsername: u0nh7s3rnf + ipfsGatewayPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ + + dataexchange: + apiKey: a-secret + certificate: + enabled: true + issuerRef: + name: selfsigned-ca + kind: ClusterIssuer + + tlsSecret: + enabled: false + +ipfs: + enabled: false + +ethconnect: + enabled: false diff --git a/deploy/charts/firefly-erc1155/.helmignore b/deploy/charts/firefly-erc1155/.helmignore new file mode 100644 index 0000000000..0e8a0eb36f --- /dev/null +++ b/deploy/charts/firefly-erc1155/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/charts/firefly-erc1155/Chart.yaml b/deploy/charts/firefly-erc1155/Chart.yaml new file mode 100644 index 0000000000..94950c2f93 --- /dev/null +++ b/deploy/charts/firefly-erc1155/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: firefly-erc1155 +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/deploy/charts/firefly-erc1155/templates/NOTES.txt b/deploy/charts/firefly-erc1155/templates/NOTES.txt new file mode 100644 index 0000000000..6d998d7e19 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "firefly-erc1155.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "firefly-erc1155.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "firefly-erc1155.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "firefly-erc1155.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/_helpers.tpl b/deploy/charts/firefly-erc1155/templates/_helpers.tpl new file mode 100644 index 0000000000..799c36b4e1 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "firefly-erc1155.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 "firefly-erc1155.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 "firefly-erc1155.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "firefly-erc1155.labels" -}} +helm.sh/chart: {{ include "firefly-erc1155.chart" . }} +{{ include "firefly-erc1155.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "firefly-erc1155.selectorLabels" -}} +app.kubernetes.io/name: {{ include "firefly-erc1155.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "firefly-erc1155.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "firefly-erc1155.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/deployment.yaml b/deploy/charts/firefly-erc1155/templates/deployment.yaml new file mode 100644 index 0000000000..acadf3afdb --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "firefly-erc1155.fullname" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "firefly-erc1155.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "firefly-erc1155.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "firefly-erc1155.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/hpa.yaml b/deploy/charts/firefly-erc1155/templates/hpa.yaml new file mode 100644 index 0000000000..326f536f91 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "firefly-erc1155.fullname" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "firefly-erc1155.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/ingress.yaml b/deploy/charts/firefly-erc1155/templates/ingress.yaml new file mode 100644 index 0000000000..77ee15b8c9 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "firefly-erc1155.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/service.yaml b/deploy/charts/firefly-erc1155/templates/service.yaml new file mode 100644 index 0000000000..ef0fc2c5e8 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "firefly-erc1155.fullname" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "firefly-erc1155.selectorLabels" . | nindent 4 }} diff --git a/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml b/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml new file mode 100644 index 0000000000..d384afd185 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "firefly-erc1155.serviceAccountName" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml b/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml new file mode 100644 index 0000000000..5e9f883997 --- /dev/null +++ b/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "firefly-erc1155.fullname" . }}-test-connection" + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "firefly-erc1155.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/deploy/charts/firefly-erc1155/values.yaml b/deploy/charts/firefly-erc1155/values.yaml new file mode 100644 index 0000000000..09ab6ed968 --- /dev/null +++ b/deploy/charts/firefly-erc1155/values.yaml @@ -0,0 +1,82 @@ +# Default values for firefly-erc1155. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/deploy/charts/firefly/templates/erc1155/deployment.yaml b/deploy/charts/firefly/templates/erc1155/deployment.yaml new file mode 100644 index 0000000000..acadf3afdb --- /dev/null +++ b/deploy/charts/firefly/templates/erc1155/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "firefly-erc1155.fullname" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "firefly-erc1155.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "firefly-erc1155.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "firefly-erc1155.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/charts/firefly/templates/erc1155/service.yaml b/deploy/charts/firefly/templates/erc1155/service.yaml new file mode 100644 index 0000000000..ef0fc2c5e8 --- /dev/null +++ b/deploy/charts/firefly/templates/erc1155/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "firefly-erc1155.fullname" . }} + labels: + {{- include "firefly-erc1155.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "firefly-erc1155.selectorLabels" . | nindent 4 }} diff --git a/deploy/charts/firefly/values.yaml b/deploy/charts/firefly/values.yaml index 4f5fdeaf04..f04a2a8520 100644 --- a/deploy/charts/firefly/values.yaml +++ b/deploy/charts/firefly/values.yaml @@ -304,3 +304,6 @@ dataexchange: subPath: "" size: 2Gi storageClass: "" + +erc1155: + # TODO ... From 6eb88547462801f7919f8a74fc56ff8a3eaadb8c Mon Sep 17 00:00:00 2001 From: hfuss Date: Sun, 2 Jan 2022 09:39:16 -0500 Subject: [PATCH 2/8] finished erc1155 deployment; just need the config Signed-off-by: hfuss --- deploy/charts/firefly-erc1155/.helmignore | 23 ------ deploy/charts/firefly-erc1155/Chart.yaml | 24 ------ .../firefly-erc1155/templates/NOTES.txt | 22 ----- .../firefly-erc1155/templates/_helpers.tpl | 62 -------------- .../firefly-erc1155/templates/deployment.yaml | 61 -------------- .../charts/firefly-erc1155/templates/hpa.yaml | 28 ------- .../firefly-erc1155/templates/ingress.yaml | 61 -------------- .../firefly-erc1155/templates/service.yaml | 15 ---- .../templates/serviceaccount.yaml | 12 --- .../templates/tests/test-connection.yaml | 15 ---- deploy/charts/firefly-erc1155/values.yaml | 82 ------------------- deploy/charts/firefly/templates/_helpers.tpl | 22 +++-- .../firefly/templates/erc1155/deployment.yaml | 38 ++++----- .../firefly/templates/erc1155/service.yaml | 12 +-- deploy/charts/firefly/values.yaml | 47 ++++++++++- 15 files changed, 86 insertions(+), 438 deletions(-) delete mode 100644 deploy/charts/firefly-erc1155/.helmignore delete mode 100644 deploy/charts/firefly-erc1155/Chart.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/NOTES.txt delete mode 100644 deploy/charts/firefly-erc1155/templates/_helpers.tpl delete mode 100644 deploy/charts/firefly-erc1155/templates/deployment.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/hpa.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/ingress.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/service.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/serviceaccount.yaml delete mode 100644 deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml delete mode 100644 deploy/charts/firefly-erc1155/values.yaml diff --git a/deploy/charts/firefly-erc1155/.helmignore b/deploy/charts/firefly-erc1155/.helmignore deleted file mode 100644 index 0e8a0eb36f..0000000000 --- a/deploy/charts/firefly-erc1155/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/deploy/charts/firefly-erc1155/Chart.yaml b/deploy/charts/firefly-erc1155/Chart.yaml deleted file mode 100644 index 94950c2f93..0000000000 --- a/deploy/charts/firefly-erc1155/Chart.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: v2 -name: firefly-erc1155 -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "1.16.0" diff --git a/deploy/charts/firefly-erc1155/templates/NOTES.txt b/deploy/charts/firefly-erc1155/templates/NOTES.txt deleted file mode 100644 index 6d998d7e19..0000000000 --- a/deploy/charts/firefly-erc1155/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "firefly-erc1155.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "firefly-erc1155.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "firefly-erc1155.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "firefly-erc1155.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/_helpers.tpl b/deploy/charts/firefly-erc1155/templates/_helpers.tpl deleted file mode 100644 index 799c36b4e1..0000000000 --- a/deploy/charts/firefly-erc1155/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "firefly-erc1155.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 "firefly-erc1155.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 "firefly-erc1155.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "firefly-erc1155.labels" -}} -helm.sh/chart: {{ include "firefly-erc1155.chart" . }} -{{ include "firefly-erc1155.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "firefly-erc1155.selectorLabels" -}} -app.kubernetes.io/name: {{ include "firefly-erc1155.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "firefly-erc1155.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "firefly-erc1155.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/deployment.yaml b/deploy/charts/firefly-erc1155/templates/deployment.yaml deleted file mode 100644 index acadf3afdb..0000000000 --- a/deploy/charts/firefly-erc1155/templates/deployment.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "firefly-erc1155.fullname" . }} - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "firefly-erc1155.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "firefly-erc1155.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "firefly-erc1155.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: 80 - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/hpa.yaml b/deploy/charts/firefly-erc1155/templates/hpa.yaml deleted file mode 100644 index 326f536f91..0000000000 --- a/deploy/charts/firefly-erc1155/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "firefly-erc1155.fullname" . }} - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "firefly-erc1155.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/ingress.yaml b/deploy/charts/firefly-erc1155/templates/ingress.yaml deleted file mode 100644 index 77ee15b8c9..0000000000 --- a/deploy/charts/firefly-erc1155/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "firefly-erc1155.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/service.yaml b/deploy/charts/firefly-erc1155/templates/service.yaml deleted file mode 100644 index ef0fc2c5e8..0000000000 --- a/deploy/charts/firefly-erc1155/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "firefly-erc1155.fullname" . }} - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "firefly-erc1155.selectorLabels" . | nindent 4 }} diff --git a/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml b/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml deleted file mode 100644 index d384afd185..0000000000 --- a/deploy/charts/firefly-erc1155/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "firefly-erc1155.serviceAccountName" . }} - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml b/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml deleted file mode 100644 index 5e9f883997..0000000000 --- a/deploy/charts/firefly-erc1155/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "firefly-erc1155.fullname" . }}-test-connection" - labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "firefly-erc1155.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/deploy/charts/firefly-erc1155/values.yaml b/deploy/charts/firefly-erc1155/values.yaml deleted file mode 100644 index 09ab6ed968..0000000000 --- a/deploy/charts/firefly-erc1155/values.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# Default values for firefly-erc1155. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nginx - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} diff --git a/deploy/charts/firefly/templates/_helpers.tpl b/deploy/charts/firefly/templates/_helpers.tpl index 47f61c851b..7b30d44814 100644 --- a/deploy/charts/firefly/templates/_helpers.tpl +++ b/deploy/charts/firefly/templates/_helpers.tpl @@ -43,9 +43,6 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} app.kuberentes.io/part-of: {{ .Chart.Name }} {{- end }} -{{/* -Common labels -*/}} {{- define "firefly.dataexchangeLabels" -}} helm.sh/chart: {{ include "firefly.chart" . }} {{ include "firefly.dataexchangeSelectorLabels" . }} @@ -56,6 +53,16 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} app.kuberentes.io/part-of: {{ .Chart.Name }} {{- end }} +{{- define "firefly.erc1155Labels" -}} +helm.sh/chart: {{ include "firefly.chart" . }} +{{ include "firefly.erc1155SelectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kuberentes.io/part-of: {{ .Chart.Name }} +{{- end }} + {{/* Selector labels */}} @@ -65,15 +72,18 @@ app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: core {{- end }} -{{/* -Selector labels -*/}} {{- define "firefly.dataexchangeSelectorLabels" -}} app.kubernetes.io/name: {{ include "firefly.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/component: dx {{- end }} +{{- define "firefly.erc1155SelectorLabels" -}} +app.kubernetes.io/name: {{ include "firefly.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/component: erc1155 +{{- end }} + {{- define "firefly.dataexchangeP2PHost" -}} {{- if .Values.dataexchange.ingress.enabled }} {{- (index .Values.dataexchange.ingress.hosts 0).host }} diff --git a/deploy/charts/firefly/templates/erc1155/deployment.yaml b/deploy/charts/firefly/templates/erc1155/deployment.yaml index acadf3afdb..ae9c2b0a09 100644 --- a/deploy/charts/firefly/templates/erc1155/deployment.yaml +++ b/deploy/charts/firefly/templates/erc1155/deployment.yaml @@ -1,42 +1,41 @@ +{{- if .Values.erc1155.enabled }} apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "firefly-erc1155.fullname" . }} + name: {{ include "firefly.fullname" . }}-erc1155 labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} + {{- include "firefly.erc1155Labels" . | nindent 4 }} spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} + replicas: 1 selector: matchLabels: - {{- include "firefly-erc1155.selectorLabels" . | nindent 6 }} + {{- include "firefly.erc1155SelectorLabels" . | nindent 6 }} template: metadata: - {{- with .Values.podAnnotations }} + {{- with .Values.erc1155.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "firefly-erc1155.selectorLabels" . | nindent 8 }} + {{- include "firefly.erc1155SelectorLabels" . | nindent 8 }} spec: - {{- with .Values.imagePullSecrets }} + {{- with .Values.erc1155.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "firefly-erc1155.serviceAccountName" . }} securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- toYaml .Values.erc1155.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- toYaml .Values.erc1155.securityContext | nindent 12 }} + image: "{{ .Values.erc1155.image.repository }}:{{ .Values.erc1155.image.tag }}" + imagePullPolicy: {{ .Values.erc1155.image.pullPolicy }} ports: - name: http - containerPort: 80 + containerPort: {{ .Values.erc1155.service.port }} protocol: TCP + # TODO livenessProbe: httpGet: path: / @@ -46,16 +45,17 @@ spec: path: / port: http resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} + {{- toYaml .Values.erc1155.resources | nindent 12 }} + {{- with .Values.erc1155.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.erc1155.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.erc1155.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} +{{- end }} diff --git a/deploy/charts/firefly/templates/erc1155/service.yaml b/deploy/charts/firefly/templates/erc1155/service.yaml index ef0fc2c5e8..dfc3d245eb 100644 --- a/deploy/charts/firefly/templates/erc1155/service.yaml +++ b/deploy/charts/firefly/templates/erc1155/service.yaml @@ -1,15 +1,17 @@ +{{- if .Values.erc1155.enabled }} apiVersion: v1 kind: Service metadata: - name: {{ include "firefly-erc1155.fullname" . }} + name: {{ include "firefly.fullname" . }}-erc1155 labels: - {{- include "firefly-erc1155.labels" . | nindent 4 }} + {{- include "firefly.erc1155Labels" . | nindent 4 }} spec: - type: {{ .Values.service.type }} + type: {{ .Values.erc1155.service.type }} ports: - - port: {{ .Values.service.port }} + - port: {{ .Values.erc1155.service.port }} targetPort: http protocol: TCP name: http selector: - {{- include "firefly-erc1155.selectorLabels" . | nindent 4 }} + {{- include "firefly.erc1155SelectorLabels" . | nindent 4 }} +{{- end }} diff --git a/deploy/charts/firefly/values.yaml b/deploy/charts/firefly/values.yaml index f04a2a8520..e971a55677 100644 --- a/deploy/charts/firefly/values.yaml +++ b/deploy/charts/firefly/values.yaml @@ -237,8 +237,6 @@ dataexchange: tag: v0.9.3 imagePullSecrets: [] - nameOverride: "" - fullnameOverride: "" podAnnotations: {} @@ -306,4 +304,47 @@ dataexchange: storageClass: "" erc1155: - # TODO ... + enabled: false + + image: + repository: ghcr.io/hyperledger/firefly-tokens-erc1155 + pullPolicy: Always + tag: v0.10.2 + + imagePullSecrets: [] + + podAnnotations: {} + + podSecurityContext: {} + # fsGroup: 2000 + + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + service: + type: ClusterIP + port: 8080 + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + nodeSelector: {} + + tolerations: [] + + affinity: {} + From 45b616542deb81f385189c822c72da1e8b68627e Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 3 Jan 2022 00:07:42 -0500 Subject: [PATCH 3/8] templating erc1155 env vars and ff config Signed-off-by: hfuss --- deploy/charts/firefly/templates/_helpers.tpl | 9 +++++++ .../firefly/templates/erc1155/deployment.yaml | 27 ++++++++++++++++--- deploy/charts/firefly/values.yaml | 23 +++++++++------- 3 files changed, 46 insertions(+), 13 deletions(-) diff --git a/deploy/charts/firefly/templates/_helpers.tpl b/deploy/charts/firefly/templates/_helpers.tpl index 7b30d44814..51558ea86c 100644 --- a/deploy/charts/firefly/templates/_helpers.tpl +++ b/deploy/charts/firefly/templates/_helpers.tpl @@ -215,4 +215,13 @@ dataexchange: {{- end }} {{- end }} {{- end }} +{{- if and .Values.config.tokensOverride (not .Values.erc1155.enabled) }} +tokens: + {{- toYaml (tpl .Values.config.tokensOverride .) | nindent 2 }} +{{- else if and .Values.erc1155.enabled }} +tokens: + - plugin: fftokens + name: erc1155 + url: http://{{ include "firefly.fullname" . }}-erc1155.{{ .Release.Namespace }}.svc:{{ .Values.erc1155.service.port }} +{{- end }} {{- end }} \ No newline at end of file diff --git a/deploy/charts/firefly/templates/erc1155/deployment.yaml b/deploy/charts/firefly/templates/erc1155/deployment.yaml index ae9c2b0a09..b15aca9cd8 100644 --- a/deploy/charts/firefly/templates/erc1155/deployment.yaml +++ b/deploy/charts/firefly/templates/erc1155/deployment.yaml @@ -26,7 +26,7 @@ spec: securityContext: {{- toYaml .Values.erc1155.podSecurityContext | nindent 8 }} containers: - - name: {{ .Chart.Name }} + - name: {{ .Chart.Name }}-erc1155 securityContext: {{- toYaml .Values.erc1155.securityContext | nindent 12 }} image: "{{ .Values.erc1155.image.repository }}:{{ .Values.erc1155.image.tag }}" @@ -35,15 +35,34 @@ spec: - name: http containerPort: {{ .Values.erc1155.service.port }} protocol: TCP - # TODO + # blocked on 0.10.3+ release livenessProbe: httpGet: - path: / + path: /health/liveness port: http readinessProbe: httpGet: - path: / + path: /health/readiness port: http + env: + - name: PORT + value: {{ .Values.erc1155.service.port | quote }} + - name: ETHCONNECT_URL + value: {{ tpl .Values.config.ethconnectUrl . }} + - name: ETHCONNECT_INSTANCE + value: {{ .Values.config.erc1155ContractAddress }} + - name: ETHCONNECT_TOPIC + value: {{ .Values.config.erc1155EthconnectTopic | quote }} + - name: ETHCONNECT_PREFIX + value: {{ .Values.config.ethconnectPrefixShort | default "fly" }} + {{- if and .Values.config.ethconnectUsername .Values.config.ethconnectPassword }} + - name: ETHCONNECT_USERNAME + value: {{ .Values.config.ethconnectUsername | quote }} + - name: ETHCONNECT_PASSWORD + value: {{ .Values.config.ethconnectPassword | quote }} + {{- end }} + - name: AUTO_INIT + value: "true" resources: {{- toYaml .Values.erc1155.resources | nindent 12 }} {{- with .Values.erc1155.nodeSelector }} diff --git a/deploy/charts/firefly/values.yaml b/deploy/charts/firefly/values.yaml index e971a55677..20ad5bb043 100644 --- a/deploy/charts/firefly/values.yaml +++ b/deploy/charts/firefly/values.yaml @@ -73,7 +73,7 @@ config: # The Ethconnect topic to use for blockchain event subscriptions ethconnectTopic: 0 - # The short prefix FireFly will prepend to certain headers it sends to Ethconnect i.e. ff or kld + # The short prefix FireFly will prepend to certain headers it sends to Ethconnect i.e. fly or kld ethconnectPrefixShort: "" # The long prefix FireFly will prepend to certain headers it sends to Ethconnect i.e. FireFly or Kaleido @@ -100,6 +100,12 @@ config: # The Fabric to use for signing transactions, must be pre-registered and enrolled fabconnectSigner: "" + # The Ethconnet URI representing the ERC1155 tokens contract + erc1155ContractAddress: "/contracts/erc1155Addrress" + + # The Ethconnet topic to use for tokens event subscriptions + erc1155EthconnectTopic: "" + # The following values can be used to override the templating of specific plugin sections, in the case where # the user wants greater control to template the sections using global values, additional helpers, etc. OR if they # want to use other plugin types i.e. `fabric` which currently do not exist at the time of writing. @@ -110,6 +116,8 @@ config: publicstorageOverride: {} + tokensOverride: {} + blockchainOverride: {} # type: ethereum # ethereum: @@ -126,7 +134,7 @@ config: core: image: repository: ghcr.io/hyperledger/firefly - pullPolicy: Always + pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. # tag: latest @@ -135,8 +143,6 @@ core: # value: debug imagePullSecrets: [] - nameOverride: "" - fullnameOverride: "" podAnnotations: {} @@ -233,7 +239,7 @@ dataexchange: image: repository: ghcr.io/hyperledger/firefly-dataexchange-https - pullPolicy: Always + pullPolicy: IfNotPresent tag: v0.9.3 imagePullSecrets: [] @@ -304,11 +310,11 @@ dataexchange: storageClass: "" erc1155: - enabled: false + enabled: true image: repository: ghcr.io/hyperledger/firefly-tokens-erc1155 - pullPolicy: Always + pullPolicy: IfNotPresent tag: v0.10.2 imagePullSecrets: [] @@ -328,7 +334,7 @@ erc1155: service: type: ClusterIP - port: 8080 + port: 3000 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious @@ -347,4 +353,3 @@ erc1155: tolerations: [] affinity: {} - From ff4c76dc825bbbc3d5e57b8eed07413a46894bc9 Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 3 Jan 2022 00:08:43 -0500 Subject: [PATCH 4/8] removing dev values Signed-off-by: hfuss --- .../charts/firefly-dev/values-local-acme.yaml | 41 ------------------- .../firefly-dev/values-local-randalls.yaml | 41 ------------------- 2 files changed, 82 deletions(-) delete mode 100644 deploy/charts/firefly-dev/values-local-acme.yaml delete mode 100644 deploy/charts/firefly-dev/values-local-randalls.yaml diff --git a/deploy/charts/firefly-dev/values-local-acme.yaml b/deploy/charts/firefly-dev/values-local-acme.yaml deleted file mode 100644 index 45a264d364..0000000000 --- a/deploy/charts/firefly-dev/values-local-acme.yaml +++ /dev/null @@ -1,41 +0,0 @@ - -firefly: - config: - debugEnabled: true - preInit: false - adminEnabled: true - organizationName: acme - organizationIdentity: 0x46375df502d7b789f2c39a7be4cc34795230ac06 - fireflyContractAddress: /instances/0xb149aad91748aef8b3c2e4a69f5fcb6428827c8c - # paymentAddress: 0x4b7139c54b9e2d9eb3d52774e5b2cda75500a8f0 - - ethconnectUrl: https://u0w5t5bum3-u0ygwqbxog-connect.us0-aws.kaleido.io/ - ethconnectUsername: u0nh7s3rnf - ethconnectPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - ethconnectPrefixLong: kaleido - ethconnectPrefixShort: kld - - ipfsApiUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io - ipfsApiUsername: u0nh7s3rnf - ipfsApiPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - - ipfsGatewayUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io - ipfsGatewayUsername: u0nh7s3rnf - ipfsGatewayPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - - dataexchange: - apiKey: a-secret - certificate: - enabled: true - issuerRef: - name: selfsigned-ca - kind: ClusterIssuer - - tlsSecret: - enabled: false - -ipfs: - enabled: false - -ethconnect: - enabled: false diff --git a/deploy/charts/firefly-dev/values-local-randalls.yaml b/deploy/charts/firefly-dev/values-local-randalls.yaml deleted file mode 100644 index e382d95944..0000000000 --- a/deploy/charts/firefly-dev/values-local-randalls.yaml +++ /dev/null @@ -1,41 +0,0 @@ - -firefly: - config: - debugEnabled: true - preInit: false - adminEnabled: true - organizationName: randalls - organizationIdentity: 0x59fa082cd543ebfa7869423219e32d92cbcd2658 - fireflyContractAddress: /instances/0xb149aad91748aef8b3c2e4a69f5fcb6428827c8c - # paymentAddress: 0x4b7139c54b9e2d9eb3d52774e5b2cda75500a8f0 - - ethconnectUrl: https://u0w5t5bum3-u0xfyqqhwx-connect.us0-aws.kaleido.io/ - ethconnectUsername: u0nh7s3rnf - ethconnectPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - ethconnectPrefixLong: kaleido - ethconnectPrefixShort: kld - - ipfsApiUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io - ipfsApiUsername: u0nh7s3rnf - ipfsApiPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - - ipfsGatewayUrl: https://u0w5t5bum3-u0k14wzj4e-ipfs.us0-aws.kaleido.io - ipfsGatewayUsername: u0nh7s3rnf - ipfsGatewayPassword: z6gA8C9WHjP6h3PxgVm8mN8tjt-mxNtxZC2A_0oMaEQ - - dataexchange: - apiKey: a-secret - certificate: - enabled: true - issuerRef: - name: selfsigned-ca - kind: ClusterIssuer - - tlsSecret: - enabled: false - -ipfs: - enabled: false - -ethconnect: - enabled: false From aa091db09a60999768d3c54e78228440e9e483e8 Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 3 Jan 2022 09:15:21 -0500 Subject: [PATCH 5/8] tuning probes Signed-off-by: hfuss --- .../firefly/templates/erc1155/deployment.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/deploy/charts/firefly/templates/erc1155/deployment.yaml b/deploy/charts/firefly/templates/erc1155/deployment.yaml index b15aca9cd8..98603711b3 100644 --- a/deploy/charts/firefly/templates/erc1155/deployment.yaml +++ b/deploy/charts/firefly/templates/erc1155/deployment.yaml @@ -35,15 +35,24 @@ spec: - name: http containerPort: {{ .Values.erc1155.service.port }} protocol: TCP - # blocked on 0.10.3+ release livenessProbe: httpGet: - path: /health/liveness + path: /api/v1/health/liveness port: http + successThreshold: 1 + failureThreshold: 2 + periodSeconds: 10 + timeoutSeconds: 1 + initialDelaySeconds: 5 readinessProbe: httpGet: - path: /health/readiness + path: /api/v1/health/readiness port: http + successThreshold: 1 + failureThreshold: 4 + periodSeconds: 15 + timeoutSeconds: 2 + initialDelaySeconds: 15 env: - name: PORT value: {{ .Values.erc1155.service.port | quote }} From 4d8029932fa15071634aa25bcf76530cc0ba0204 Mon Sep 17 00:00:00 2001 From: hfuss Date: Wed, 5 Jan 2022 19:14:14 -0500 Subject: [PATCH 6/8] Disabling ERC1155 in IT tests, but testing ERC1155 and other defaults via chart templating Signed-off-by: hfuss --- .github/workflows/helm.yml | 3 +++ deploy/charts/firefly/ci/eth-values.yaml | 3 +++ deploy/charts/firefly/ci/fab-values.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 0db8e68e11..6915d015d6 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -34,6 +34,9 @@ jobs: - name: lint chart run: ct lint --charts deploy/charts/firefly + - name: test chart templating + run: helm template deploy/charts/firefly + - name: setup kind uses: engineerd/setup-kind@v0.5.0 with: diff --git a/deploy/charts/firefly/ci/eth-values.yaml b/deploy/charts/firefly/ci/eth-values.yaml index 5fbf113bd7..c7654d2d1e 100644 --- a/deploy/charts/firefly/ci/eth-values.yaml +++ b/deploy/charts/firefly/ci/eth-values.yaml @@ -30,3 +30,6 @@ dataexchange: tlsSecret: enabled: false + +erc1155: + enabled: false diff --git a/deploy/charts/firefly/ci/fab-values.yaml b/deploy/charts/firefly/ci/fab-values.yaml index 7f48973c57..f6b45106a5 100644 --- a/deploy/charts/firefly/ci/fab-values.yaml +++ b/deploy/charts/firefly/ci/fab-values.yaml @@ -23,3 +23,6 @@ dataexchange: tlsSecret: enabled: false + +erc1155: + enabled: false From 6adeaca7a7be48c11290f64fbd5ca434ed2af69a Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 10 Jan 2022 21:04:29 -0500 Subject: [PATCH 7/8] version bump while testing Signed-off-by: hfuss --- deploy/charts/firefly/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/charts/firefly/Chart.yaml b/deploy/charts/firefly/Chart.yaml index e77c2ec974..c7714961ff 100644 --- a/deploy/charts/firefly/Chart.yaml +++ b/deploy/charts/firefly/Chart.yaml @@ -3,7 +3,7 @@ name: firefly description: A Helm chart for deploying FireFly and FireFly HTTPS Dataexchange onto Kubernetes. type: application appVersion: "0.11.4" -version: "0.0.1" +version: "0.0.2" maintainers: - name: hfuss From 64eaaca7d96c21ebde9ddf1bf984dab31f4bd53c Mon Sep 17 00:00:00 2001 From: hfuss Date: Mon, 10 Jan 2022 21:52:35 -0500 Subject: [PATCH 8/8] chart bump Signed-off-by: hfuss --- deploy/charts/firefly/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/charts/firefly/Chart.yaml b/deploy/charts/firefly/Chart.yaml index c7714961ff..20873013b8 100644 --- a/deploy/charts/firefly/Chart.yaml +++ b/deploy/charts/firefly/Chart.yaml @@ -3,7 +3,7 @@ name: firefly description: A Helm chart for deploying FireFly and FireFly HTTPS Dataexchange onto Kubernetes. type: application appVersion: "0.11.4" -version: "0.0.2" +version: "0.0.3" maintainers: - name: hfuss