diff --git a/.gitignore b/.gitignore index 9c82107..9ff929e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ Dockerfile.cross # Test binary, built with `go test -c` *.test +#Helm packages +*.tgz + # Output of the go coverage tool, specifically when used with LiteIDE *.out @@ -29,3 +32,6 @@ go.work # Temporary directories for 'air' tmp/** !tmp/.gitkeep + +# Junk +.DS_Store \ No newline at end of file diff --git a/charts/runtime-operator/.helmignore b/charts/runtime-operator/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/runtime-operator/.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/charts/runtime-operator/Chart.lock b/charts/runtime-operator/Chart.lock new file mode 100644 index 0000000..0f9b29e --- /dev/null +++ b/charts/runtime-operator/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: nats + repository: https://nats-io.github.io/k8s/helm/charts/ + version: 1.3.16 +digest: sha256:b7e676e22d8ce111a0658aca9746f314c9e5d897562a97227a274eb83caab451 +generated: "2025-10-27T10:51:10.260264-04:00" diff --git a/charts/runtime-operator/Chart.yaml b/charts/runtime-operator/Chart.yaml new file mode 100644 index 0000000..780a2ad --- /dev/null +++ b/charts/runtime-operator/Chart.yaml @@ -0,0 +1,30 @@ +apiVersion: v2 +name: runtime-operator +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: "0.1.0" + +dependencies: +- condition: nats.enabled + name: nats + repository: https://nats-io.github.io/k8s/helm/charts/ + version: "1.3.16" \ No newline at end of file diff --git a/charts/runtime-operator/templates/NOTES.txt b/charts/runtime-operator/templates/NOTES.txt new file mode 100644 index 0000000..888df55 --- /dev/null +++ b/charts/runtime-operator/templates/NOTES.txt @@ -0,0 +1,4 @@ +The wasmCloud runtime-operator is installed. + +To verify your deployment: + kubectl get pods -l app.kubernetes.io/instance={{ .Release.Name }} -n {{ .Release.Namespace }} \ No newline at end of file diff --git a/charts/runtime-operator/templates/_helpers.tpl b/charts/runtime-operator/templates/_helpers.tpl new file mode 100644 index 0000000..06f010e --- /dev/null +++ b/charts/runtime-operator/templates/_helpers.tpl @@ -0,0 +1,74 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "runtime-operator.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 "runtime-operator.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 "runtime-operator.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "runtime-operator.labels" -}} +helm.sh/chart: {{ include "runtime-operator.chart" . }} +{{ include "runtime-operator.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "runtime-operator.selectorLabels" -}} +app.kubernetes.io/name: {{ include "runtime-operator.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "runtime-operator.serviceAccountName" -}} +{{- if .Values.operator.serviceAccount.create }} +{{- default (include "runtime-operator.fullname" .) .Values.operator.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.operator.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Create the imagePullSecrets section for the chart. +*/}} +{{- define "runtime-operator.imagePullSecrets" -}} +{{- if .Values.global.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.global.image.pullSecrets }} + - name: {{ .name }} +{{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_artifacts.yaml b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_artifacts.yaml new file mode 100644 index 0000000..2e78164 --- /dev/null +++ b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_artifacts.yaml @@ -0,0 +1,119 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.4 + name: artifacts.runtime.wasmcloud.dev +spec: + group: runtime.wasmcloud.dev + names: + kind: Artifact + listKind: ArtifactList + plural: artifacts + singular: artifact + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Artifact is the Schema for the artifacts API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ArtifactSpec defines the desired state of Artifact. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + required: + - image + type: object + status: + description: ArtifactStatus defines the observed state of Artifact. + properties: + artifactUrl: + type: string + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation + that the object condition was set based upon. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown. + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_hosts.yaml b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_hosts.yaml new file mode 100644 index 0000000..5ee65fb --- /dev/null +++ b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_hosts.yaml @@ -0,0 +1,137 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.4 + name: hosts.runtime.wasmcloud.dev +spec: + group: runtime.wasmcloud.dev + names: + kind: Host + listKind: HostList + plural: hosts + singular: host + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .hostId + name: HOSTID + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: READY + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Host is the Schema for the Hosts API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + hostId: + type: string + hostname: + type: string + httpPort: + format: int32 + type: integer + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + status: + description: HostStatus defines the observed state of Host. + properties: + componentCount: + type: integer + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation + that the object condition was set based upon. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown. + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - status + - type + type: object + type: array + lastSeen: + format: date-time + type: string + osArch: + type: string + osKernel: + type: string + osName: + type: string + systemCPUUsage: + type: string + systemMemoryFree: + format: int64 + type: integer + systemMemoryTotal: + format: int64 + type: integer + version: + type: string + workloadCount: + type: integer + required: + - osArch + - osKernel + - osName + - systemCPUUsage + - systemMemoryFree + - systemMemoryTotal + - version + type: object + required: + - hostId + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloaddeployments.yaml b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloaddeployments.yaml new file mode 100644 index 0000000..918bd41 --- /dev/null +++ b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloaddeployments.yaml @@ -0,0 +1,547 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.4 + name: workloaddeployments.runtime.wasmcloud.dev +spec: + group: runtime.wasmcloud.dev + names: + kind: WorkloadDeployment + listKind: WorkloadDeploymentList + plural: workloaddeployments + singular: workloaddeployment + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.replicas + name: REPLICAS + type: integer + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: READY + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: WorkloadDeployment is the Schema for the artifacts API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: WorkloadDeploymentSpec defines the desired state of WorkloadDeployment. + properties: + artifacts: + items: + properties: + artifactFrom: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + name: + type: string + required: + - artifactFrom + - name + type: object + type: array + deployPolicy: + default: RollingUpdate + type: string + replicas: + format: int32 + type: integer + template: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + spec: + description: WorkloadSpec defines the desired state of Workload. + properties: + components: + items: + description: |- + WorkloadComponent represents a component of a workload. + Components are stateless, invocation-driven units of computation. + Components are isolated from each other and can be scaled independently. + Each Component has a Root WIT World, representing the Components imports/exports. The combined + list of all Components' Root WIT Worlds within a workload must be compatible with the Host's WIT World. + All components within a workload are guaranteed to be placed on the same Wasm Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that + will be made available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting + of a Volume within a component. + properties: + mountPath: + description: MountPath is the path within + the component where the volume should be + mounted. + type: string + name: + description: Name must match the Name of a + Volume defined in the WorkloadSpec.Volumes + field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxInvocations: + format: int32 + type: integer + name: + type: string + poolSize: + format: int32 + type: integer + required: + - image + - name + type: object + type: array + hostId: + type: string + hostInterfaces: + items: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + interfaces: + items: + type: string + minItems: 1 + type: array + namespace: + type: string + package: + type: string + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + version: + type: string + required: + - interfaces + - namespace + - package + type: object + type: array + hostSelector: + additionalProperties: + type: string + type: object + service: + description: |- + WorkloadService represents a long-running service that is part of the workload. + It is also sometimes referred to as a "sidecar" and is optional. + A Service differs from a Component in that it is long-running and represents the Workload's "localhost". + Services can bind to TCP & UDP ports, which are accessible by Components within the same workload via "localhost" or "127.0.0.1". + Services export a single WIT interface, shaped as wasi:cli/run. + Services can import interfaces from any Component within the same workload, or from the Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that will + be made available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting of + a Volume within a component. + properties: + mountPath: + description: MountPath is the path within the + component where the volume should be mounted. + type: string + name: + description: Name must match the Name of a Volume + defined in the WorkloadSpec.Volumes field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxRestarts: + format: int32 + type: integer + required: + - image + type: object + volumes: + items: + description: Volume represents a named volume that can be + mounted by components. + properties: + ephemeral: + description: EphemeralVolume represents a temporary + directory that shares a workload's lifetime. + type: object + hostPath: + description: HostPathVolume represents a pre-existing + file or directory on the host machine. + properties: + path: + description: Path of the file or directory on the + host. + type: string + required: + - path + type: object + name: + description: Name of the volume. Must be a DNS_LABEL + and unique within the Workload. + type: string + required: + - name + type: object + type: array + type: object + required: + - spec + type: object + required: + - template + type: object + status: + description: WorkloadDeploymentStatus defines the observed state of WorkloadDeployment. + properties: + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation + that the object condition was set based upon. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown. + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - status + - type + type: object + type: array + currentReplicaSet: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + previousReplicaSet: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + replicas: + properties: + current: + format: int32 + type: integer + expected: + format: int32 + type: integer + ready: + format: int32 + type: integer + unavailable: + format: int32 + type: integer + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloadreplicasets.yaml b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloadreplicasets.yaml new file mode 100644 index 0000000..a2d05ab --- /dev/null +++ b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloadreplicasets.yaml @@ -0,0 +1,486 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.4 + name: workloadreplicasets.runtime.wasmcloud.dev +spec: + group: runtime.wasmcloud.dev + names: + kind: WorkloadReplicaSet + listKind: WorkloadReplicaSetList + plural: workloadreplicasets + singular: workloadreplicaset + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.replicas + name: REPLICAS + type: integer + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: READY + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: WorkloadReplicaSet is the Schema for the artifacts API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: WorkloadReplicaSetSpec defines the desired state of WorkloadReplicaSet. + properties: + replicas: + format: int32 + type: integer + template: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + spec: + description: WorkloadSpec defines the desired state of Workload. + properties: + components: + items: + description: |- + WorkloadComponent represents a component of a workload. + Components are stateless, invocation-driven units of computation. + Components are isolated from each other and can be scaled independently. + Each Component has a Root WIT World, representing the Components imports/exports. The combined + list of all Components' Root WIT Worlds within a workload must be compatible with the Host's WIT World. + All components within a workload are guaranteed to be placed on the same Wasm Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that + will be made available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting + of a Volume within a component. + properties: + mountPath: + description: MountPath is the path within + the component where the volume should be + mounted. + type: string + name: + description: Name must match the Name of a + Volume defined in the WorkloadSpec.Volumes + field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxInvocations: + format: int32 + type: integer + name: + type: string + poolSize: + format: int32 + type: integer + required: + - image + - name + type: object + type: array + hostId: + type: string + hostInterfaces: + items: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + interfaces: + items: + type: string + minItems: 1 + type: array + namespace: + type: string + package: + type: string + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + version: + type: string + required: + - interfaces + - namespace + - package + type: object + type: array + hostSelector: + additionalProperties: + type: string + type: object + service: + description: |- + WorkloadService represents a long-running service that is part of the workload. + It is also sometimes referred to as a "sidecar" and is optional. + A Service differs from a Component in that it is long-running and represents the Workload's "localhost". + Services can bind to TCP & UDP ports, which are accessible by Components within the same workload via "localhost" or "127.0.0.1". + Services export a single WIT interface, shaped as wasi:cli/run. + Services can import interfaces from any Component within the same workload, or from the Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that will + be made available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting of + a Volume within a component. + properties: + mountPath: + description: MountPath is the path within the + component where the volume should be mounted. + type: string + name: + description: Name must match the Name of a Volume + defined in the WorkloadSpec.Volumes field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxRestarts: + format: int32 + type: integer + required: + - image + type: object + volumes: + items: + description: Volume represents a named volume that can be + mounted by components. + properties: + ephemeral: + description: EphemeralVolume represents a temporary + directory that shares a workload's lifetime. + type: object + hostPath: + description: HostPathVolume represents a pre-existing + file or directory on the host machine. + properties: + path: + description: Path of the file or directory on the + host. + type: string + required: + - path + type: object + name: + description: Name of the volume. Must be a DNS_LABEL + and unique within the Workload. + type: string + required: + - name + type: object + type: array + type: object + required: + - spec + type: object + required: + - template + type: object + status: + description: WorkloadReplicaSetStatus defines the observed state of WorkloadReplicaSet. + properties: + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation + that the object condition was set based upon. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown. + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - status + - type + type: object + type: array + replicas: + properties: + current: + format: int32 + type: integer + expected: + format: int32 + type: integer + ready: + format: int32 + type: integer + unavailable: + format: int32 + type: integer + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloads.yaml b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloads.yaml new file mode 100644 index 0000000..83f9074 --- /dev/null +++ b/charts/runtime-operator/templates/crds/runtime.wasmcloud.dev_workloads.yaml @@ -0,0 +1,452 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.16.4 + name: workloads.runtime.wasmcloud.dev +spec: + group: runtime.wasmcloud.dev + names: + kind: Workload + listKind: WorkloadList + plural: workloads + shortNames: + - ww + singular: workload + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.hostId + name: HOSTID + type: string + - jsonPath: .status.conditions[?(@.type=="Ready")].status + name: READY + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Workload is the Schema for the artifacts API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: WorkloadSpec defines the desired state of Workload. + properties: + components: + items: + description: |- + WorkloadComponent represents a component of a workload. + Components are stateless, invocation-driven units of computation. + Components are isolated from each other and can be scaled independently. + Each Component has a Root WIT World, representing the Components imports/exports. The combined + list of all Components' Root WIT Worlds within a workload must be compatible with the Host's WIT World. + All components within a workload are guaranteed to be placed on the same Wasm Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that will be + made available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting of a Volume + within a component. + properties: + mountPath: + description: MountPath is the path within the component + where the volume should be mounted. + type: string + name: + description: Name must match the Name of a Volume + defined in the WorkloadSpec.Volumes field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxInvocations: + format: int32 + type: integer + name: + type: string + poolSize: + format: int32 + type: integer + required: + - image + - name + type: object + type: array + hostId: + type: string + hostInterfaces: + items: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + interfaces: + items: + type: string + minItems: 1 + type: array + namespace: + type: string + package: + type: string + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + version: + type: string + required: + - interfaces + - namespace + - package + type: object + type: array + hostSelector: + additionalProperties: + type: string + type: object + service: + description: |- + WorkloadService represents a long-running service that is part of the workload. + It is also sometimes referred to as a "sidecar" and is optional. + A Service differs from a Component in that it is long-running and represents the Workload's "localhost". + Services can bind to TCP & UDP ports, which are accessible by Components within the same workload via "localhost" or "127.0.0.1". + Services export a single WIT interface, shaped as wasi:cli/run. + Services can import interfaces from any Component within the same workload, or from the Host. + properties: + image: + type: string + imagePullSecret: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + localResources: + description: LocalResources describes resources that will be made + available to a workload component. + properties: + allowedHosts: + items: + type: string + type: array + config: + additionalProperties: + type: string + type: object + environment: + properties: + config: + additionalProperties: + type: string + type: object + configFrom: + description: |- + ConfigFrom is a list of references to ConfigMaps that will be provided to the workload. + The keys and values of all referenced ConfigMaps will be merged. In case of key conflicts, + the last ConfigMap in the list wins. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + secretFrom: + description: |- + The keys and values of all referenced Secrets will be merged. In case of key conflicts, + the last Secret in the list wins. + The values of the Secrets will be base64-decoded, utf-8 decoded before being provided to the workload. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + type: array + type: object + volumeMounts: + description: |- + VolumeMounts is a list of volume mounts that will be mounted into the workload component. + The volumes must be defined in the WorkloadSpec.Volumes field. + items: + description: VolumeMount describes a mounting of a Volume + within a component. + properties: + mountPath: + description: MountPath is the path within the component + where the volume should be mounted. + type: string + name: + description: Name must match the Name of a Volume defined + in the WorkloadSpec.Volumes field. + type: string + required: + - mountPath + - name + type: object + type: array + type: object + maxRestarts: + format: int32 + type: integer + required: + - image + type: object + volumes: + items: + description: Volume represents a named volume that can be mounted + by components. + properties: + ephemeral: + description: EphemeralVolume represents a temporary directory + that shares a workload's lifetime. + type: object + hostPath: + description: HostPathVolume represents a pre-existing file or + directory on the host machine. + properties: + path: + description: Path of the file or directory on the host. + type: string + required: + - path + type: object + name: + description: Name of the volume. Must be a DNS_LABEL and unique + within the Workload. + type: string + required: + - name + type: object + type: array + type: object + status: + description: WorkloadStatus defines the observed state of Workload. + properties: + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastProbeTime: + description: Last time we probed the condition. + format: date-time + type: string + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: If set, this represents the .metadata.generation + that the object condition was set based upon. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown. + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - status + - type + type: object + type: array + hostId: + type: string + workloadId: + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/runtime-operator/templates/operator/deployment.yaml b/charts/runtime-operator/templates/operator/deployment.yaml new file mode 100644 index 0000000..5447190 --- /dev/null +++ b/charts/runtime-operator/templates/operator/deployment.yaml @@ -0,0 +1,35 @@ +{{- $registry := .Values.operator.image.registry | default .Values.global.image.registry | default "docker.io" -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: runtime-operator + namespace: {{ .Release.Namespace }} + labels: + wasmcloud.com/name: runtime-operator + {{- include "runtime-operator.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + wasmcloud.com/name: runtime-operator + template: + metadata: + labels: + wasmcloud.com/name: runtime-operator + {{- include "runtime-operator.labels" . | nindent 8 }} + spec: + serviceAccountName: {{ include "runtime-operator.serviceAccountName" . }} + {{- include "runtime-operator.imagePullSecrets" . | nindent 6 }} + containers: + - name: runtime-operator + image: {{ printf "%s/%s" $registry .Values.operator.image.repository }}:{{ .Values.operator.image.tag | default .Chart.AppVersion }} + args: + - "-nats-url=nats://nats.default.svc.cluster.local:4222" + imagePullPolicy: {{ .Values.operator.image.pull_policy }} + securityContext: + capabilities: + drop: + - NET_RAW + dnsPolicy: ClusterFirst + restartPolicy: Always + terminationGracePeriodSeconds: 0 \ No newline at end of file diff --git a/charts/runtime-operator/templates/operator/service.yaml b/charts/runtime-operator/templates/operator/service.yaml new file mode 100644 index 0000000..06c0297 --- /dev/null +++ b/charts/runtime-operator/templates/operator/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: runtime-operator + namespace: {{ .Release.Namespace }} + labels: + wasmcloud.com/name: runtime-operator + {{- include "runtime-operator.labels" . | nindent 4 }} +spec: + selector: + wasmcloud.com/name: runtime-operator + type: {{ .Values.operator.service.type }} + ports: + - port: {{ .Values.operator.service.port }} + targetPort: https + protocol: TCP + name: https \ No newline at end of file diff --git a/charts/runtime-operator/templates/operator/serviceaccount.yaml b/charts/runtime-operator/templates/operator/serviceaccount.yaml new file mode 100644 index 0000000..a4ace1a --- /dev/null +++ b/charts/runtime-operator/templates/operator/serviceaccount.yaml @@ -0,0 +1,14 @@ +{{- if .Values.operator.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "runtime-operator.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "runtime-operator.labels" . | nindent 4 }} + {{- with .Values.operator.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.operator.serviceAccount.automount }} +{{- end }} diff --git a/charts/runtime-operator/values.yaml b/charts/runtime-operator/values.yaml new file mode 100644 index 0000000..ce55cb2 --- /dev/null +++ b/charts/runtime-operator/values.yaml @@ -0,0 +1,58 @@ +global: + image: + # -- Globally override container image registry, e.g. "ghcr.io" + registry: "" + # -- Globally override container imagePullSecrets + pullSecrets: [] + nameOverride: "" + fullnameOverride: "" + +# -- Values for installing NATS as a subchart. If you prefer to install NATS separately, set `enabled` to `false`. +nats: + enabled: true + name: nats + service: + name: "nats" + ports: + monitor: + enabled: true + headlessService: + name: "nats-headless" + natsBox: + enabled: false + config: + cluster: + enabled: true + replicas: 3 + leafnodes: + enabled: true + monitor: + enabled: true + port: 8222 + websocket: + enabled: true + port: 4223 + jetstream: + enabled: true + merge: + domain: default + +operator: + image: + registry: ghcr.io + repository: wasmcloud/runtime-operator + pull_policy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + service: + type: ClusterIP + port: 8443 + # -- This section builds out the service account. + # See the [Kubernetes documentation](https://kubernetes.io/docs/concepts/security/service-accounts/). + serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Automatically mount a ServiceAccount's API credentials? + automountServiceAccountToken: true + # -- Annotations to add to the service account + annotations: {} \ No newline at end of file