From ff43d0dd500c9075697a2c535d5144aa714e7a21 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 25 Sep 2024 12:11:27 +0530 Subject: [PATCH 01/64] Add Everest Helm chart Signed-off-by: Mayank Shah --- charts/everest/.helmignore | 23 + charts/everest/Chart.yaml | 8 + charts/everest/Makefile | 15 + charts/everest/README.md | 43 + charts/everest/crds/olm.yaml | 8504 +++++++++++++++++ charts/everest/everest-admin.yaml | 5 + charts/everest/templates/NOTES.txt | 0 charts/everest/templates/_helpers.tpl | 70 + .../everest-operator/operatorgroup.yaml | 12 + .../everest-operator/subscription.yaml | 27 + .../templates/everest-server/clusterrole.yaml | 23 + .../everest-server/clusterrolebinding.yaml | 12 + .../templates/everest-server/configmaps.yaml | 8 + .../templates/everest-server/deployment.yaml | 52 + .../templates/everest-server/role.yaml | 12 + .../templates/everest-server/rolebinding.yaml | 12 + .../templates/everest-server/secrets.yaml | 17 + .../templates/everest-server/service.yaml | 16 + .../everest-server/serviceaccount.yaml | 5 + .../hooks/installplan-approver/job.yaml | 43 + .../hooks/installplan-approver/rbac.yaml | 29 + .../installplan-approver/serviceaccount.yaml | 5 + .../templates/hooks/uninstall/job.yaml | 39 + .../templates/hooks/uninstall/rbac.yaml | 34 + .../hooks/uninstall/serviceaccount.yaml | 5 + .../olm/catalog-operator.deployment.yaml | 61 + charts/everest/templates/olm/clusterrole.yaml | 41 + .../templates/olm/clusterrolebinding.yaml | 12 + .../templates/olm/everest-catalogsource.yaml | 15 + charts/everest/templates/olm/namespace.yaml | 11 + .../olm/olm-operator.deployment.yaml | 66 + charts/everest/templates/olm/olmconfig.yaml | 4 + .../everest/templates/olm/operatorgroup.yaml | 8 + .../templates/olm/packageserver.csv.yaml | 140 + .../everest/templates/olm/serviceaccount.yaml | 6 + .../templates/operators/namespaces.yaml | 8 + .../templates/operators/operatorgroup.yaml | 11 + .../templates/operators/subscriptions.yaml | 68 + .../templates/vm-operator/namespace.yaml | 6 + .../templates/vm-operator/operatorgroup.yaml | 11 + .../templates/vm-operator/subscription.yaml | 13 + charts/everest/values.yaml | 21 + 42 files changed, 9521 insertions(+) create mode 100644 charts/everest/.helmignore create mode 100644 charts/everest/Chart.yaml create mode 100644 charts/everest/Makefile create mode 100644 charts/everest/README.md create mode 100644 charts/everest/crds/olm.yaml create mode 100644 charts/everest/everest-admin.yaml create mode 100644 charts/everest/templates/NOTES.txt create mode 100644 charts/everest/templates/_helpers.tpl create mode 100644 charts/everest/templates/everest-operator/operatorgroup.yaml create mode 100644 charts/everest/templates/everest-operator/subscription.yaml create mode 100644 charts/everest/templates/everest-server/clusterrole.yaml create mode 100644 charts/everest/templates/everest-server/clusterrolebinding.yaml create mode 100644 charts/everest/templates/everest-server/configmaps.yaml create mode 100644 charts/everest/templates/everest-server/deployment.yaml create mode 100644 charts/everest/templates/everest-server/role.yaml create mode 100644 charts/everest/templates/everest-server/rolebinding.yaml create mode 100644 charts/everest/templates/everest-server/secrets.yaml create mode 100644 charts/everest/templates/everest-server/service.yaml create mode 100644 charts/everest/templates/everest-server/serviceaccount.yaml create mode 100644 charts/everest/templates/hooks/installplan-approver/job.yaml create mode 100644 charts/everest/templates/hooks/installplan-approver/rbac.yaml create mode 100644 charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml create mode 100644 charts/everest/templates/hooks/uninstall/job.yaml create mode 100644 charts/everest/templates/hooks/uninstall/rbac.yaml create mode 100644 charts/everest/templates/hooks/uninstall/serviceaccount.yaml create mode 100644 charts/everest/templates/olm/catalog-operator.deployment.yaml create mode 100644 charts/everest/templates/olm/clusterrole.yaml create mode 100644 charts/everest/templates/olm/clusterrolebinding.yaml create mode 100644 charts/everest/templates/olm/everest-catalogsource.yaml create mode 100644 charts/everest/templates/olm/namespace.yaml create mode 100644 charts/everest/templates/olm/olm-operator.deployment.yaml create mode 100644 charts/everest/templates/olm/olmconfig.yaml create mode 100644 charts/everest/templates/olm/operatorgroup.yaml create mode 100644 charts/everest/templates/olm/packageserver.csv.yaml create mode 100644 charts/everest/templates/olm/serviceaccount.yaml create mode 100644 charts/everest/templates/operators/namespaces.yaml create mode 100644 charts/everest/templates/operators/operatorgroup.yaml create mode 100644 charts/everest/templates/operators/subscriptions.yaml create mode 100644 charts/everest/templates/vm-operator/namespace.yaml create mode 100644 charts/everest/templates/vm-operator/operatorgroup.yaml create mode 100644 charts/everest/templates/vm-operator/subscription.yaml create mode 100644 charts/everest/values.yaml diff --git a/charts/everest/.helmignore b/charts/everest/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/everest/.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/everest/Chart.yaml b/charts/everest/Chart.yaml new file mode 100644 index 00000000..02208c0d --- /dev/null +++ b/charts/everest/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: everest +displayName: Percona Everest +description: A cloud-native database platform +version: 0.0.0 +appVersion: 0.0.0 +type: application +kubeVersion: ">=1.27.0-0" diff --git a/charts/everest/Makefile b/charts/everest/Makefile new file mode 100644 index 00000000..4ed8140f --- /dev/null +++ b/charts/everest/Makefile @@ -0,0 +1,15 @@ +prepare-chart: + yq eval -i '.version = "${VERSION}"' Chart.yaml + yq eval -i '.appVersion = "${VERSION}"' Chart.yaml + + +release: prepare-chart + yq eval -i '.image = "percona/everest"' values.yaml + yq eval -i '.olm.catalogSourceImage = "percona/everest-catalog"' values.yaml + yq eval -i '.everestOperator.channel = "stable-v0"' values.yaml + +release-dev: prepare-chart + yq eval -i '.image = "perconalab/everest"' values.yaml + yq eval -i '.olm.catalogSourceImage = "perconalab/everest-catalog"' values.yaml + yq eval -i '.everestOperator.channel = "fast-v0"' values.yaml + diff --git a/charts/everest/README.md b/charts/everest/README.md new file mode 100644 index 00000000..e4170e32 --- /dev/null +++ b/charts/everest/README.md @@ -0,0 +1,43 @@ +# Percona Everest +This helm chart deploys the components needed for Percona Everest. + +Useful links: +- [Everest Github repository](https://github.com/percona/everest) +- [Everest Documentation](https://docs.percona.com/everest/index.html) + +> NOTE: This Helm chart is currently in technical preview. + +## Pre-requisites +* Kubernetes 1.27+ +* At least `v3.2.3` version of helm + +# Usage + +## Installation + +Install Percona Everest to the `everest-system` namespace: +```bash +helm repo add percona https://percona.github.io/percona-helm-charts/ +helm install everest percona/everest --version 1.1.1 --namespace everest-system --create-namespace +``` + +This command may take a couple of minutes to complete. Upon completion, you should see the following output: +```bash +NAME: everest +LAST DEPLOYED: Wed Sep 11 13:54:08 2024 +NAMESPACE: everest-system +STATUS: deployed +REVISION: 1 +TEST SUITE: None +``` + +## Retrieving admin credentials +Upon installation, an `admin` user is created for you. To retrieve the password for the `admin` user, run the following command: +```bash +kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' +``` + +## Uninstallation +```bash +helm uninstall everest -n everest-system +``` diff --git a/charts/everest/crds/olm.yaml b/charts/everest/crds/olm.yaml new file mode 100644 index 00000000..f33e8b12 --- /dev/null +++ b/charts/everest/crds/olm.yaml @@ -0,0 +1,8504 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: catalogsources.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: CatalogSource + listKind: CatalogSourceList + plural: catalogsources + shortNames: + - catsrc + singular: catalogsource + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The pretty name of the catalog + jsonPath: .spec.displayName + name: Display + type: string + - description: The type of the catalog + jsonPath: .spec.sourceType + name: Type + type: string + - description: The publisher of the catalog + jsonPath: .spec.publisher + name: Publisher + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: CatalogSource is a repository of CSVs, CRDs, and operator packages. + type: object + required: + - metadata + - spec + 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: + type: object + required: + - sourceType + properties: + address: + description: 'Address is a host that OLM can use to connect to a pre-existing registry. Format: : Only used when SourceType = SourceTypeGrpc. Ignored when the Image field is set.' + type: string + configMap: + description: ConfigMap is the name of the ConfigMap to be used to back a configmap-server registry. Only used when SourceType = SourceTypeConfigmap or SourceTypeInternal. + type: string + description: + type: string + displayName: + description: Metadata + type: string + grpcPodConfig: + description: GrpcPodConfig exposes different overrides for the pod spec of the CatalogSource Pod. Only used when SourceType = SourceTypeGrpc and Image is set. + type: object + properties: + nodeSelector: + description: NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. + type: object + additionalProperties: + type: string + priorityClassName: + description: If specified, indicates the pod's priority. If not specified, the pod priority will be default or zero if there is no default. + type: string + securityContextConfig: + description: "SecurityContextConfig can be one of `legacy` or `restricted`. The CatalogSource's pod is either injected with the right pod.spec.securityContext and pod.spec.container[*].securityContext values to allow the pod to run in Pod Security Admission (PSA) `restricted` mode, or doesn't set these values at all, in which case the pod can only be run in PSA `baseline` or `privileged` namespaces. Currently if the SecurityContextConfig is unspecified, the default value of `legacy` is used. Specifying a value other than `legacy` or `restricted` result in a validation error. When using older catalog images, which could not be run in `restricted` mode, the SecurityContextConfig should be set to `legacy`. \n In a future version will the default will be set to `restricted`, catalog maintainers should rebuild their catalogs with a version of opm that supports running catalogSource pods in `restricted` mode to prepare for these changes. \n More information about PSA can be found here: https://kubernetes.io/docs/concepts/security/pod-security-admission/'" + type: string + default: legacy + enum: + - legacy + - restricted + tolerations: + description: Tolerations are the catalog source's pod's tolerations. + type: array + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + type: object + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + type: integer + format: int64 + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + icon: + type: object + required: + - base64data + - mediatype + properties: + base64data: + type: string + mediatype: + type: string + image: + description: Image is an operator-registry container image to instantiate a registry-server with. Only used when SourceType = SourceTypeGrpc. If present, the address field is ignored. + type: string + priority: + description: 'Priority field assigns a weight to the catalog source to prioritize them so that it can be consumed by the dependency resolver. Usage: Higher weight indicates that this catalog source is preferred over lower weighted catalog sources during dependency resolution. The range of the priority value can go from positive to negative in the range of int32. The default value to a catalog source with unassigned priority would be 0. The catalog source with the same priority values will be ranked lexicographically based on its name.' + type: integer + publisher: + type: string + secrets: + description: Secrets represent set of secrets that can be used to access the contents of the catalog. It is best to keep this list small, since each will need to be tried for every catalog entry. + type: array + items: + type: string + sourceType: + description: SourceType is the type of source + type: string + updateStrategy: + description: UpdateStrategy defines how updated catalog source images can be discovered Consists of an interval that defines polling duration and an embedded strategy type + type: object + properties: + registryPoll: + type: object + properties: + interval: + description: Interval is used to determine the time interval between checks of the latest catalog source version. The catalog operator polls to see if a new version of the catalog source is available. If available, the latest image is pulled and gRPC traffic is directed to the latest catalog source. + type: string + status: + type: object + properties: + conditions: + description: Represents the state of a CatalogSource. Note that Message and Reason represent the original status information, which may be migrated to be conditions based in the future. Any new features introduced will use conditions. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + configMapReference: + type: object + required: + - name + - namespace + properties: + lastUpdateTime: + type: string + format: date-time + name: + type: string + namespace: + type: string + resourceVersion: + type: string + uid: + description: UID is a type that holds unique ID values, including UUIDs. Because we don't ONLY use UUIDs, this is an alias to string. Being a type captures intent and helps make sure that UIDs and names do not get conflated. + type: string + connectionState: + type: object + required: + - lastObservedState + properties: + address: + type: string + lastConnect: + type: string + format: date-time + lastObservedState: + type: string + latestImageRegistryPoll: + description: The last time the CatalogSource image registry has been polled to ensure the image is up-to-date + type: string + format: date-time + message: + description: A human readable message indicating details about why the CatalogSource is in this condition. + type: string + reason: + description: Reason is the reason the CatalogSource was transitioned to its current state. + type: string + registryService: + type: object + properties: + createdAt: + type: string + format: date-time + port: + type: string + protocol: + type: string + serviceName: + type: string + serviceNamespace: + type: string + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: clusterserviceversions.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: ClusterServiceVersion + listKind: ClusterServiceVersionList + plural: clusterserviceversions + shortNames: + - csv + - csvs + singular: clusterserviceversion + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The name of the CSV + jsonPath: .spec.displayName + name: Display + type: string + - description: The version of the CSV + jsonPath: .spec.version + name: Version + type: string + - description: The name of a CSV that this one replaces + jsonPath: .spec.replaces + name: Replaces + type: string + - jsonPath: .status.phase + name: Phase + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: ClusterServiceVersion is a Custom Resource of type `ClusterServiceVersionSpec`. + type: object + required: + - metadata + - spec + 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: ClusterServiceVersionSpec declarations tell OLM how to install an operator that can manage apps for a given version. + type: object + required: + - displayName + - install + properties: + annotations: + description: Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. + type: object + additionalProperties: + type: string + apiservicedefinitions: + description: APIServiceDefinitions declares all of the extension apis managed or required by an operator being ran by ClusterServiceVersion. + type: object + properties: + owned: + type: array + items: + description: APIServiceDescription provides details to OLM about apis provided via aggregation + type: object + required: + - group + - kind + - name + - version + properties: + actionDescriptors: + type: array + items: + description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + containerPort: + type: integer + format: int32 + deploymentName: + type: string + description: + type: string + displayName: + type: string + group: + type: string + kind: + type: string + name: + type: string + resources: + type: array + items: + description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes. + type: object + required: + - kind + - name + - version + properties: + kind: + description: Kind of the referenced resource type. + type: string + name: + description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource. + type: string + version: + description: API Version of the referenced resource type. + type: string + specDescriptors: + type: array + items: + description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + statusDescriptors: + type: array + items: + description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + version: + type: string + required: + type: array + items: + description: APIServiceDescription provides details to OLM about apis provided via aggregation + type: object + required: + - group + - kind + - name + - version + properties: + actionDescriptors: + type: array + items: + description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + containerPort: + type: integer + format: int32 + deploymentName: + type: string + description: + type: string + displayName: + type: string + group: + type: string + kind: + type: string + name: + type: string + resources: + type: array + items: + description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes. + type: object + required: + - kind + - name + - version + properties: + kind: + description: Kind of the referenced resource type. + type: string + name: + description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource. + type: string + version: + description: API Version of the referenced resource type. + type: string + specDescriptors: + type: array + items: + description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + statusDescriptors: + type: array + items: + description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + version: + type: string + cleanup: + description: Cleanup specifies the cleanup behaviour when the CSV gets deleted + type: object + required: + - enabled + properties: + enabled: + type: boolean + customresourcedefinitions: + description: "CustomResourceDefinitions declares all of the CRDs managed or required by an operator being ran by ClusterServiceVersion. \n If the CRD is present in the Owned list, it is implicitly required." + type: object + properties: + owned: + type: array + items: + description: CRDDescription provides details to OLM about the CRDs + type: object + required: + - kind + - name + - version + properties: + actionDescriptors: + type: array + items: + description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + description: + type: string + displayName: + type: string + kind: + type: string + name: + type: string + resources: + type: array + items: + description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes. + type: object + required: + - kind + - name + - version + properties: + kind: + description: Kind of the referenced resource type. + type: string + name: + description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource. + type: string + version: + description: API Version of the referenced resource type. + type: string + specDescriptors: + type: array + items: + description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + statusDescriptors: + type: array + items: + description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + version: + type: string + required: + type: array + items: + description: CRDDescription provides details to OLM about the CRDs + type: object + required: + - kind + - name + - version + properties: + actionDescriptors: + type: array + items: + description: ActionDescriptor describes a declarative action that can be performed on a custom resource instance + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + description: + type: string + displayName: + type: string + kind: + type: string + name: + type: string + resources: + type: array + items: + description: APIResourceReference is a reference to a Kubernetes resource type that the referrer utilizes. + type: object + required: + - kind + - name + - version + properties: + kind: + description: Kind of the referenced resource type. + type: string + name: + description: Plural name of the referenced resource type (CustomResourceDefinition.Spec.Names[].Plural). Empty string if the referenced resource type is not a custom resource. + type: string + version: + description: API Version of the referenced resource type. + type: string + specDescriptors: + type: array + items: + description: SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + statusDescriptors: + type: array + items: + description: StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it + type: object + required: + - path + properties: + description: + type: string + displayName: + type: string + path: + type: string + value: + description: RawMessage is a raw encoded JSON value. It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding. + type: string + format: byte + x-descriptors: + type: array + items: + type: string + version: + type: string + description: + description: Description of the operator. Can include the features, limitations or use-cases of the operator. + type: string + displayName: + description: The name of the operator in display format. + type: string + icon: + description: The icon for this operator. + type: array + items: + type: object + required: + - base64data + - mediatype + properties: + base64data: + type: string + mediatype: + type: string + install: + description: NamedInstallStrategy represents the block of an ClusterServiceVersion resource where the install strategy is specified. + type: object + required: + - strategy + properties: + spec: + description: StrategyDetailsDeployment represents the parsed details of a Deployment InstallStrategy. + type: object + required: + - deployments + properties: + clusterPermissions: + type: array + items: + description: StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy + type: object + required: + - rules + - serviceAccountName + properties: + rules: + type: array + items: + description: PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. + type: object + required: + - verbs + properties: + apiGroups: + description: APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. + type: array + items: + type: string + nonResourceURLs: + description: NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. + type: array + items: + type: string + resourceNames: + description: ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + type: array + items: + type: string + resources: + description: Resources is a list of resources this rule applies to. '*' represents all resources. + type: array + items: + type: string + verbs: + description: Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + type: array + items: + type: string + serviceAccountName: + type: string + deployments: + type: array + items: + description: StrategyDeploymentSpec contains the name, spec and labels for the deployment ALM should create + type: object + required: + - name + - spec + properties: + label: + description: Set is a map of label:value. It implements Labels. + type: object + additionalProperties: + type: string + name: + type: string + spec: + description: DeploymentSpec is the specification of the desired behavior of the Deployment. + type: object + required: + - selector + - template + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready) + type: integer + format: int32 + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s. + type: integer + format: int32 + replicas: + description: Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1. + type: integer + format: int32 + revisionHistoryLimit: + description: The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10. + type: integer + format: int32 + selector: + description: Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + strategy: + description: The deployment strategy to use to replace existing pods with new ones. + type: object + properties: + rollingUpdate: + description: 'Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate. --- TODO: Update this to follow our convention for oneOf, whatever we decide it to be.' + type: object + properties: + maxSurge: + description: 'The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new ReplicaSet can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new ReplicaSet can be scaled up further, ensuring that total number of pods running at any time during the update is at most 130% of desired pods.' + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + maxUnavailable: + description: 'The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old ReplicaSet can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old ReplicaSet can be scaled down further, followed by scaling up the new ReplicaSet, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.' + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + type: + description: Type of deployment. Can be "Recreate" or "RollingUpdate". Default is RollingUpdate. + type: string + template: + description: Template describes the pods that will be created. + type: object + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: 'Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + type: object + required: + - containers + properties: + activeDeadlineSeconds: + description: Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer. + type: integer + format: int64 + affinity: + description: If specified, the pod's scheduling constraints + type: object + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the pod. + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. + type: array + items: + description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). + type: object + required: + - preference + - weight + properties: + preference: + description: A node selector term, associated with the corresponding weight. + type: object + properties: + matchExpressions: + description: A list of node selector requirements by node's labels. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchFields: + description: A list of node selector requirements by node's fields. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + weight: + description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. + type: object + required: + - nodeSelectorTerms + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. The terms are ORed. + type: array + items: + description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. + type: object + properties: + matchExpressions: + description: A list of node selector requirements by node's labels. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchFields: + description: A list of node selector requirements by node's fields. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + type: array + items: + description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + type: object + required: + - podAffinityTerm + - weight + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated with the corresponding weight. + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + weight: + description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + type: array + items: + description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + type: array + items: + description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + type: object + required: + - podAffinityTerm + - weight + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated with the corresponding weight. + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + weight: + description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + type: array + items: + description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + automountServiceAccountToken: + description: AutomountServiceAccountToken indicates whether a service account token should be automatically mounted. + type: boolean + containers: + description: List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated. + type: array + items: + description: A single application container that you want to run within a pod. + type: object + required: + - name + properties: + args: + description: 'Arguments to the entrypoint. The container image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + command: + description: 'Entrypoint array. Not executed within a shell. The container image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + env: + description: List of environment variables to set in the container. Cannot be updated. + type: array + items: + description: EnvVar represents an environment variable present in a Container. + type: object + required: + - name + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot be used if value is not empty. + type: object + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + type: object + required: + - key + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key must be defined + type: boolean + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + type: object + required: + - key + properties: + key: + description: The key of the secret to select from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + envFrom: + description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. + type: array + items: + description: EnvFromSource represents the source of a set of ConfigMaps + type: object + properties: + configMapRef: + description: The ConfigMap to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap must be defined + type: boolean + prefix: + description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + image: + description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. + type: object + properties: + postStart: + description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + preStop: + description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + livenessProbe: + description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + name: + description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. + type: array + items: + description: ContainerPort represents a network port in a single container. + type: object + required: + - containerPort + properties: + containerPort: + description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + type: integer + format: int32 + hostIP: + description: What host IP to bind the external port to. + type: string + hostPort: + description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. + type: integer + format: int32 + name: + description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. + type: string + protocol: + description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". + type: string + default: TCP + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + resources: + description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + securityContext: + description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + type: object + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + add: + description: Added capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + drop: + description: Removed capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + privileged: + description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + runAsNonRoot: + description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + seLinuxOptions: + description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + level: + description: Level is SELinux level label that applies to the container. + type: string + role: + description: Role is a SELinux role label that applies to the container. + type: string + type: + description: Type is a SELinux type label that applies to the container. + type: string + user: + description: User is a SELinux user label that applies to the container. + type: string + seccompProfile: + description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. + type: object + required: + - type + properties: + localhostProfile: + description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." + type: string + windowsOptions: + description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. + type: object + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: string + startupProbe: + description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + stdin: + description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block devices to be used by the container. + type: array + items: + description: volumeDevice describes a mapping of a raw block device within a container. + type: object + required: + - devicePath + - name + properties: + devicePath: + description: devicePath is the path inside of the container that the device will be mapped to. + type: string + name: + description: name must match the name of a persistentVolumeClaim in the pod + type: string + volumeMounts: + description: Pod volumes to mount into the container's filesystem. Cannot be updated. + type: array + items: + description: VolumeMount describes a mounting of a Volume within a container. + type: object + required: + - mountPath + - name + properties: + mountPath: + description: Path within the container at which the volume should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. + type: string + workingDir: + description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. + type: string + dnsConfig: + description: Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy. + type: object + properties: + nameservers: + description: A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed. + type: array + items: + type: string + options: + description: A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy. + type: array + items: + description: PodDNSConfigOption defines DNS resolver options of a pod. + type: object + properties: + name: + description: Required. + type: string + value: + type: string + searches: + description: A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed. + type: array + items: + type: string + dnsPolicy: + description: Set DNS policy for the pod. Defaults to "ClusterFirst". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'. + type: string + enableServiceLinks: + description: 'EnableServiceLinks indicates whether information about services should be injected into pod''s environment variables, matching the syntax of Docker links. Optional: Defaults to true.' + type: boolean + ephemeralContainers: + description: List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. + type: array + items: + description: "An EphemeralContainer is a temporary container that you may add to an existing Pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a Pod is removed or restarted. The kubelet may evict a Pod if an ephemeral container causes the Pod to exceed its resource allocation. \n To add an ephemeral container, use the ephemeralcontainers subresource of an existing Pod. Ephemeral containers may not be removed or restarted." + type: object + required: + - name + properties: + args: + description: 'Arguments to the entrypoint. The image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + command: + description: 'Entrypoint array. Not executed within a shell. The image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + env: + description: List of environment variables to set in the container. Cannot be updated. + type: array + items: + description: EnvVar represents an environment variable present in a Container. + type: object + required: + - name + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot be used if value is not empty. + type: object + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + type: object + required: + - key + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key must be defined + type: boolean + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + type: object + required: + - key + properties: + key: + description: The key of the secret to select from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + envFrom: + description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. + type: array + items: + description: EnvFromSource represents the source of a set of ConfigMaps + type: object + properties: + configMapRef: + description: The ConfigMap to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap must be defined + type: boolean + prefix: + description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + image: + description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Lifecycle is not allowed for ephemeral containers. + type: object + properties: + postStart: + description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + preStop: + description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + livenessProbe: + description: Probes are not allowed for ephemeral containers. + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + name: + description: Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers. + type: string + ports: + description: Ports are not allowed for ephemeral containers. + type: array + items: + description: ContainerPort represents a network port in a single container. + type: object + required: + - containerPort + properties: + containerPort: + description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + type: integer + format: int32 + hostIP: + description: What host IP to bind the external port to. + type: string + hostPort: + description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. + type: integer + format: int32 + name: + description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. + type: string + protocol: + description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". + type: string + default: TCP + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: Probes are not allowed for ephemeral containers. + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + resources: + description: Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod. + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + securityContext: + description: 'Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.' + type: object + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + add: + description: Added capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + drop: + description: Removed capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + privileged: + description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + runAsNonRoot: + description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + seLinuxOptions: + description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + level: + description: Level is SELinux level label that applies to the container. + type: string + role: + description: Role is a SELinux role label that applies to the container. + type: string + type: + description: Type is a SELinux type label that applies to the container. + type: string + user: + description: User is a SELinux user label that applies to the container. + type: string + seccompProfile: + description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. + type: object + required: + - type + properties: + localhostProfile: + description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." + type: string + windowsOptions: + description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. + type: object + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: string + startupProbe: + description: Probes are not allowed for ephemeral containers. + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + stdin: + description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false + type: boolean + targetContainerName: + description: "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container uses the namespaces configured in the Pod spec. \n The container runtime must implement support for this feature. If the runtime does not support namespace targeting then the result of setting this field is undefined." + type: string + terminationMessagePath: + description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block devices to be used by the container. + type: array + items: + description: volumeDevice describes a mapping of a raw block device within a container. + type: object + required: + - devicePath + - name + properties: + devicePath: + description: devicePath is the path inside of the container that the device will be mapped to. + type: string + name: + description: name must match the name of a persistentVolumeClaim in the pod + type: string + volumeMounts: + description: Pod volumes to mount into the container's filesystem. Subpath mounts are not allowed for ephemeral containers. Cannot be updated. + type: array + items: + description: VolumeMount describes a mounting of a Volume within a container. + type: object + required: + - mountPath + - name + properties: + mountPath: + description: Path within the container at which the volume should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. + type: string + workingDir: + description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. + type: string + hostAliases: + description: HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods. + type: array + items: + description: HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file. + type: object + properties: + hostnames: + description: Hostnames for the above IP address. + type: array + items: + type: string + ip: + description: IP address of the host file entry. + type: string + hostIPC: + description: 'Use the host''s ipc namespace. Optional: Default to false.' + type: boolean + hostNetwork: + description: Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false. + type: boolean + hostPID: + description: 'Use the host''s pid namespace. Optional: Default to false.' + type: boolean + hostUsers: + description: 'Use the host''s user namespace. Optional: Default to true. If set to true or not present, the pod will be run in the host user namespace, useful for when the pod needs a feature only available to the host user namespace, such as loading a kernel module with CAP_SYS_MODULE. When set to false, a new userns is created for the pod. Setting false is useful for mitigating container breakout vulnerabilities even allowing users to run their containers as root without actually having root privileges on the host. This field is alpha-level and is only honored by servers that enable the UserNamespacesSupport feature.' + type: boolean + hostname: + description: Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value. + type: string + imagePullSecrets: + description: 'ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod' + type: array + items: + description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + initContainers: + description: 'List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/' + type: array + items: + description: A single application container that you want to run within a pod. + type: object + required: + - name + properties: + args: + description: 'Arguments to the entrypoint. The container image''s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + command: + description: 'Entrypoint array. Not executed within a shell. The container image''s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container''s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + type: array + items: + type: string + env: + description: List of environment variables to set in the container. Cannot be updated. + type: array + items: + description: EnvVar represents an environment variable present in a Container. + type: object + required: + - name + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot be used if value is not empty. + type: object + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + type: object + required: + - key + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key must be defined + type: boolean + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + type: object + required: + - key + properties: + key: + description: The key of the secret to select from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + envFrom: + description: List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated. + type: array + items: + description: EnvFromSource represents the source of a set of ConfigMaps + type: object + properties: + configMapRef: + description: The ConfigMap to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap must be defined + type: boolean + prefix: + description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + image: + description: 'Container image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system should take in response to container lifecycle events. Cannot be updated. + type: object + properties: + postStart: + description: 'PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + preStop: + description: 'PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The Pod''s termination grace period countdown begins before the PreStop hook is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod''s termination grace period (unless delayed by finalizers). Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + tcpSocket: + description: Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept for the backward compatibility. There are no validation of this field and lifecycle hooks will fail in runtime when tcp handler is specified. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + livenessProbe: + description: 'Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + name: + description: Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default "0.0.0.0" address inside a container will be accessible from the network. Modifying this array with strategic merge patch may corrupt the data. For more information See https://github.com/kubernetes/kubernetes/issues/108255. Cannot be updated. + type: array + items: + description: ContainerPort represents a network port in a single container. + type: object + required: + - containerPort + properties: + containerPort: + description: Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536. + type: integer + format: int32 + hostIP: + description: What host IP to bind the external port to. + type: string + hostPort: + description: Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this. + type: integer + format: int32 + name: + description: If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services. + type: string + protocol: + description: Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP". + type: string + default: TCP + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + resources: + description: 'Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + securityContext: + description: 'SecurityContext defines the security options the container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + type: object + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.os.name is windows.' + type: boolean + capabilities: + description: The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + add: + description: Added capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + drop: + description: Removed capabilities + type: array + items: + description: Capability represent POSIX capabilities type + type: string + privileged: + description: Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + procMount: + description: procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only root filesystem. Default is false. Note that this field cannot be set when spec.os.name is windows. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + runAsNonRoot: + description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + seLinuxOptions: + description: The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + level: + description: Level is SELinux level label that applies to the container. + type: string + role: + description: Role is a SELinux role label that applies to the container. + type: string + type: + description: Type is a SELinux type label that applies to the container. + type: string + user: + description: User is a SELinux user label that applies to the container. + type: string + seccompProfile: + description: The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options. Note that this field cannot be set when spec.os.name is windows. + type: object + required: + - type + properties: + localhostProfile: + description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." + type: string + windowsOptions: + description: The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. + type: object + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: string + startupProbe: + description: 'StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: object + properties: + exec: + description: Exec specifies the action to take. + type: object + properties: + command: + description: Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + type: array + items: + type: string + failureThreshold: + description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. + type: integer + format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string + httpGet: + description: HTTPGet specifies the http request to perform. + type: object + required: + - port + properties: + host: + description: Host name to connect to, defaults to the pod IP. You probably want to set "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the request. HTTP allows repeated headers. + type: array + items: + description: HTTPHeader describes a custom header to be used in HTTP probes + type: object + required: + - name + - value + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + path: + description: Path to access on the HTTP server. + type: string + port: + description: Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting to the host. Defaults to HTTP. + type: string + initialDelaySeconds: + description: 'Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + periodSeconds: + description: How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1. + type: integer + format: int32 + successThreshold: + description: Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + type: integer + format: int32 + tcpSocket: + description: TCPSocket specifies an action involving a TCP port. + type: object + required: + - port + properties: + host: + description: 'Optional: Host name to connect to, defaults to the pod IP.' + type: string + port: + description: Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully upon probe failure. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this value overrides the value provided by the pod spec. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + type: integer + format: int64 + timeoutSeconds: + description: 'Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + type: integer + format: int32 + stdin: + description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to which the container''s termination message will be written is mounted into the container''s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block devices to be used by the container. + type: array + items: + description: volumeDevice describes a mapping of a raw block device within a container. + type: object + required: + - devicePath + - name + properties: + devicePath: + description: devicePath is the path inside of the container that the device will be mapped to. + type: string + name: + description: name must match the name of a persistentVolumeClaim in the pod + type: string + volumeMounts: + description: Pod volumes to mount into the container's filesystem. Cannot be updated. + type: array + items: + description: VolumeMount describes a mounting of a Volume within a container. + type: object + required: + - mountPath + - name + properties: + mountPath: + description: Path within the container at which the volume should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. + type: string + workingDir: + description: Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated. + type: string + nodeName: + description: NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements. + type: string + nodeSelector: + description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + type: object + additionalProperties: + type: string + x-kubernetes-map-type: atomic + os: + description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set. \n If the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions \n If the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup" + type: object + required: + - name + properties: + name: + description: 'Name is the name of the operating system. The currently supported values are linux and windows. Additional value may be defined in future and can be one of: https://github.com/opencontainers/runtime-spec/blob/master/config.md#platform-specific-configuration Clients should expect to handle additional values and treat unrecognized values in this field as os: null' + type: string + overhead: + description: 'Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/688-pod-overhead/README.md' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + preemptionPolicy: + description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. + type: string + priority: + description: The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority. + type: integer + format: int32 + priorityClassName: + description: If specified, indicates the pod's priority. "system-node-critical" and "system-cluster-critical" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default. + type: string + readinessGates: + description: 'If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to "True" More info: https://git.k8s.io/enhancements/keps/sig-network/580-pod-readiness-gates' + type: array + items: + description: PodReadinessGate contains the reference to a pod condition + type: object + required: + - conditionType + properties: + conditionType: + description: ConditionType refers to a condition in the pod's condition list with matching type. + type: string + resourceClaims: + description: "ResourceClaims defines which ResourceClaims must be allocated and reserved before the Pod is allowed to start. The resources will be made available to those containers which consume them by name. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name. + type: object + required: + - name + properties: + name: + description: Name uniquely identifies this resource claim inside the pod. This must be a DNS_LABEL. + type: string + source: + description: Source describes where to find the ResourceClaim. + type: object + properties: + resourceClaimName: + description: ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod. + type: string + resourceClaimTemplateName: + description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod. \n The template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The name of the ResourceClaim will be -, where is the PodResourceClaim.Name. Pod validation will reject the pod if the concatenated name is not valid for a ResourceClaim (e.g. too long). \n An existing ResourceClaim with that name that is not owned by the pod will not be used for the pod to avoid using an unrelated resource by mistake. Scheduling and pod startup are then blocked until the unrelated ResourceClaim is removed. \n This field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim." + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + restartPolicy: + description: 'Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy' + type: string + runtimeClassName: + description: 'RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class' + type: string + schedulerName: + description: If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler. + type: string + schedulingGates: + description: "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. More info: https://git.k8s.io/enhancements/keps/sig-scheduling/3521-pod-scheduling-readiness. \n This is an alpha-level feature enabled by PodSchedulingReadiness feature gate." + type: array + items: + description: PodSchedulingGate is associated to a Pod to guard its scheduling. + type: object + required: + - name + properties: + name: + description: Name of the scheduling gate. Each scheduling gate must have a unique name field. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + securityContext: + description: 'SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.' + type: object + properties: + fsGroup: + description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: \n 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw---- \n If unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows." + type: integer + format: int64 + fsGroupChangePolicy: + description: 'fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. Note that this field cannot be set when spec.os.name is windows.' + type: string + runAsGroup: + description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + runAsNonRoot: + description: Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + type: integer + format: int64 + seLinuxOptions: + description: The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. Note that this field cannot be set when spec.os.name is windows. + type: object + properties: + level: + description: Level is SELinux level label that applies to the container. + type: string + role: + description: Role is a SELinux role label that applies to the container. + type: string + type: + description: Type is a SELinux type label that applies to the container. + type: string + user: + description: User is a SELinux user label that applies to the container. + type: string + seccompProfile: + description: The seccomp options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows. + type: object + required: + - type + properties: + localhostProfile: + description: localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is "Localhost". + type: string + type: + description: "type indicates which kind of seccomp profile will be applied. Valid options are: \n Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied." + type: string + supplementalGroups: + description: A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows. + type: array + items: + type: integer + format: int64 + sysctls: + description: Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch. Note that this field cannot be set when spec.os.name is windows. + type: array + items: + description: Sysctl defines a kernel parameter to be set + type: object + required: + - name + - value + properties: + name: + description: Name of a property to set + type: string + value: + description: Value of a property to set + type: string + windowsOptions: + description: The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. Note that this field cannot be set when spec.os.name is linux. + type: object + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the name of the GMSA credential spec to use. + type: string + hostProcess: + description: HostProcess determines if a container should be run as a 'Host Process' container. This field is alpha-level and will only be honored by components that enable the WindowsHostProcessContainers feature flag. Setting this field without the feature flag will result in errors when validating the Pod. All of a Pod's containers must have the same effective HostProcess value (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). In addition, if HostProcess is true then HostNetwork must also be set to true. + type: boolean + runAsUserName: + description: The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + type: string + serviceAccount: + description: 'DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.' + type: string + serviceAccountName: + description: 'ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' + type: string + setHostnameAsFQDN: + description: If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false. + type: boolean + shareProcessNamespace: + description: 'Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.' + type: boolean + subdomain: + description: If specified, the fully qualified Pod hostname will be "...svc.". If not specified, the pod will not have a domainname at all. + type: string + terminationGracePeriodSeconds: + description: Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates stop immediately via the kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds. + type: integer + format: int64 + tolerations: + description: If specified, the pod's tolerations. + type: array + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + type: object + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + type: integer + format: int64 + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + topologySpreadConstraints: + description: TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. + type: array + items: + description: TopologySpreadConstraint specifies how to spread matching pods among the given topology. + type: object + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + properties: + labelSelector: + description: LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + matchLabelKeys: + description: MatchLabelKeys is a set of pod label keys to select the pods over which spreading will be calculated. The keys are used to lookup values from the incoming pod labels, those key-value labels are ANDed with labelSelector to select the group of existing pods over which spreading will be calculated for the incoming pod. Keys that don't exist in the incoming pod labels will be ignored. A null or empty list means only match against labelSelector. + type: array + items: + type: string + x-kubernetes-list-type: atomic + maxSkew: + description: 'MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. The global minimum is the minimum number of matching pods in an eligible domain or zero if the number of eligible domains is less than MinDomains. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 2/2/1: In this case, the global minimum is 1. | zone1 | zone2 | zone3 | | P P | P P | P | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 2/2/2; scheduling it onto zone1(zone2) would make the ActualSkew(3-1) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It''s a required field. Default value is 1 and 0 is not allowed.' + type: integer + format: int32 + minDomains: + description: "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule. \n For example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew. \n This is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default)." + type: integer + format: int32 + nodeAffinityPolicy: + description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations. \n If this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag." + type: string + nodeTaintsPolicy: + description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included. \n If this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag." + type: string + topologyKey: + description: TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a "bucket", and try to put balanced number of pods into each bucket. We define a domain as a particular instance of a topology. Also, we define an eligible domain as a domain whose nodes meet the requirements of nodeAffinityPolicy and nodeTaintsPolicy. e.g. If TopologyKey is "kubernetes.io/hostname", each Node is a domain of that topology. And, if TopologyKey is "topology.kubernetes.io/zone", each zone is a domain of that topology. It's a required field. + type: string + whenUnsatisfiable: + description: 'WhenUnsatisfiable indicates how to deal with a pod if it doesn''t satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location, but giving higher precedence to topologies that would help reduce the skew. A constraint is considered "Unsatisfiable" for an incoming pod if and only if every possible node assignment for that pod would violate "MaxSkew" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won''t make it *more* imbalanced. It''s a required field.' + type: string + x-kubernetes-list-map-keys: + - topologyKey + - whenUnsatisfiable + x-kubernetes-list-type: map + volumes: + description: 'List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes' + type: array + items: + description: Volume represents a named volume in a pod that may be accessed by any container in the pod. + type: object + required: + - name + properties: + awsElasticBlockStore: + description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: object + required: + - volumeID + properties: + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' + type: integer + format: int32 + readOnly: + description: 'readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: boolean + volumeID: + description: 'volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: string + azureDisk: + description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + type: object + required: + - diskName + - diskURI + properties: + cachingMode: + description: 'cachingMode is the Host Caching mode: None, Read Only, Read Write.' + type: string + diskName: + description: diskName is the Name of the data disk in the blob storage + type: string + diskURI: + description: diskURI is the URI of data disk in the blob storage + type: string + fsType: + description: fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + kind: + description: 'kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' + type: string + readOnly: + description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + azureFile: + description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. + type: object + required: + - secretName + - shareName + properties: + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretName: + description: secretName is the name of secret that contains Azure Storage Account Name and Key + type: string + shareName: + description: shareName is the azure share Name + type: string + cephfs: + description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime + type: object + required: + - monitors + properties: + monitors: + description: 'monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: array + items: + type: string + path: + description: 'path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /' + type: string + readOnly: + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: boolean + secretFile: + description: 'secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + secretRef: + description: 'secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + user: + description: 'user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + cinder: + description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: object + required: + - volumeID + properties: + fsType: + description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + readOnly: + description: 'readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: boolean + secretRef: + description: 'secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + volumeID: + description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + configMap: + description: configMap represents a configMap that should populate this volume + type: object + properties: + defaultMode: + description: 'defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional specify whether the ConfigMap or its keys must be defined + type: boolean + csi: + description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). + type: object + required: + - driver + properties: + driver: + description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. + type: string + fsType: + description: fsType to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. + type: string + nodePublishSecretRef: + description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + readOnly: + description: readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). + type: boolean + volumeAttributes: + description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. + type: object + additionalProperties: + type: string + downwardAPI: + description: downwardAPI represents downward API about the pod that should populate this volume + type: object + properties: + defaultMode: + description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: Items is a list of downward API volume file + type: array + items: + description: DownwardAPIVolumeFile represents information to create the file containing the pod field + type: object + required: + - path + properties: + fieldRef: + description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + mode: + description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + emptyDir: + description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: object + properties: + medium: + description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: string + sizeLimit: + description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + ephemeral: + description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time." + type: object + properties: + volumeClaimTemplate: + description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." + type: object + required: + - spec + properties: + metadata: + description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. + type: object + spec: + description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. + type: object + properties: + accessModes: + description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + type: array + items: + type: string + dataSource: + description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.' + type: object + required: + - kind + - name + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + dataSourceRef: + description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn''t specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn''t set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.' + type: object + required: + - kind + - name + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + namespace: + description: Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + resources: + description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + selector: + description: selector is a label query over volumes to consider for binding. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + storageClassName: + description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference to the PersistentVolume backing this claim. + type: string + fc: + description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. + type: object + properties: + fsType: + description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + lun: + description: 'lun is Optional: FC target lun number' + type: integer + format: int32 + readOnly: + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + type: boolean + targetWWNs: + description: 'targetWWNs is Optional: FC target worldwide names (WWNs)' + type: array + items: + type: string + wwids: + description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' + type: array + items: + type: string + flexVolume: + description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. + type: object + required: + - driver + properties: + driver: + description: driver is the name of the driver to use for this volume. + type: string + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + type: string + options: + description: 'options is Optional: this field holds extra command options if any.' + type: object + additionalProperties: + type: string + readOnly: + description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + type: boolean + secretRef: + description: 'secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + flocker: + description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running + type: object + properties: + datasetName: + description: datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated + type: string + datasetUUID: + description: datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset + type: string + gcePersistentDisk: + description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: object + required: + - pdName + properties: + fsType: + description: 'fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: integer + format: int32 + pdName: + description: 'pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: string + readOnly: + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: boolean + gitRepo: + description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' + type: object + required: + - repository + properties: + directory: + description: directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + type: string + repository: + description: repository is the URL + type: string + revision: + description: revision is the commit hash for the specified revision. + type: string + glusterfs: + description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + type: object + required: + - endpoints + - path + properties: + endpoints: + description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + path: + description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + readOnly: + description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: boolean + hostPath: + description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' + type: object + required: + - path + properties: + path: + description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + type: + description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + iscsi: + description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + type: object + required: + - iqn + - lun + - targetPortal + properties: + chapAuthDiscovery: + description: chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication + type: boolean + chapAuthSession: + description: chapAuthSession defines whether support iSCSI Session CHAP authentication + type: boolean + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + initiatorName: + description: initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. + type: string + iqn: + description: iqn is the target iSCSI Qualified Name. + type: string + iscsiInterface: + description: iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). + type: string + lun: + description: lun represents iSCSI Target Lun number. + type: integer + format: int32 + portals: + description: portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + type: array + items: + type: string + readOnly: + description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + type: boolean + secretRef: + description: secretRef is the CHAP Secret for iSCSI target and initiator authentication + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + targetPortal: + description: targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + type: string + name: + description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + nfs: + description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: object + required: + - path + - server + properties: + path: + description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + readOnly: + description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: boolean + server: + description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + persistentVolumeClaim: + description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: object + required: + - claimName + properties: + claimName: + description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: string + readOnly: + description: readOnly Will force the ReadOnly setting in VolumeMounts. Default false. + type: boolean + photonPersistentDisk: + description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine + type: object + required: + - pdID + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + pdID: + description: pdID is the ID that identifies Photon Controller persistent disk + type: string + portworxVolume: + description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine + type: object + required: + - volumeID + properties: + fsType: + description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + volumeID: + description: volumeID uniquely identifies a Portworx volume + type: string + projected: + description: projected items for all in one resources secrets, configmaps, and downward API + type: object + properties: + defaultMode: + description: defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. + type: integer + format: int32 + sources: + description: sources is the list of volume projections + type: array + items: + description: Projection that may be projected along with other supported volume types + type: object + properties: + configMap: + description: configMap information about the configMap data to project + type: object + properties: + items: + description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional specify whether the ConfigMap or its keys must be defined + type: boolean + downwardAPI: + description: downwardAPI information about the downwardAPI data to project + type: object + properties: + items: + description: Items is a list of DownwardAPIVolume file + type: array + items: + description: DownwardAPIVolumeFile represents information to create the file containing the pod field + type: object + required: + - path + properties: + fieldRef: + description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + mode: + description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secret: + description: secret information about the secret data to project + type: object + properties: + items: + description: items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional field specify whether the Secret or its key must be defined + type: boolean + serviceAccountToken: + description: serviceAccountToken is information about the serviceAccountToken data to project + type: object + required: + - path + properties: + audience: + description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. + type: string + expirationSeconds: + description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. + type: integer + format: int64 + path: + description: path is the path relative to the mount point of the file to project the token into. + type: string + quobyte: + description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime + type: object + required: + - registry + - volume + properties: + group: + description: group to map volume access to Default is no group + type: string + readOnly: + description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. + type: boolean + registry: + description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes + type: string + tenant: + description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin + type: string + user: + description: user to map volume access to Defaults to serivceaccount user + type: string + volume: + description: volume is a string that references an already created Quobyte volume by name. + type: string + rbd: + description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + type: object + required: + - image + - monitors + properties: + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + image: + description: 'image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + keyring: + description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + monitors: + description: 'monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: array + items: + type: string + pool: + description: 'pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + readOnly: + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: boolean + secretRef: + description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + user: + description: 'user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + scaleIO: + description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + type: object + required: + - gateway + - secretRef + - system + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". + type: string + gateway: + description: gateway is the host address of the ScaleIO API Gateway. + type: string + protectionDomain: + description: protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. + type: string + readOnly: + description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + sslEnabled: + description: sslEnabled Flag enable/disable SSL communication with Gateway, default false + type: boolean + storageMode: + description: storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. + type: string + storagePool: + description: storagePool is the ScaleIO Storage Pool associated with the protection domain. + type: string + system: + description: system is the name of the storage system as configured in ScaleIO. + type: string + volumeName: + description: volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. + type: string + secret: + description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: object + properties: + defaultMode: + description: 'defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + optional: + description: optional field specify whether the Secret or its keys must be defined + type: boolean + secretName: + description: 'secretName is the name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: string + storageos: + description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + type: object + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + volumeName: + description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. + type: string + volumeNamespace: + description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. + type: string + vsphereVolume: + description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine + type: object + required: + - volumePath + properties: + fsType: + description: fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: storagePolicyName is the storage Policy Based Management (SPBM) profile name. + type: string + volumePath: + description: volumePath is the path that identifies vSphere volume vmdk + type: string + permissions: + type: array + items: + description: StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy + type: object + required: + - rules + - serviceAccountName + properties: + rules: + type: array + items: + description: PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to. + type: object + required: + - verbs + properties: + apiGroups: + description: APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups. + type: array + items: + type: string + nonResourceURLs: + description: NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both. + type: array + items: + type: string + resourceNames: + description: ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed. + type: array + items: + type: string + resources: + description: Resources is a list of resources this rule applies to. '*' represents all resources. + type: array + items: + type: string + verbs: + description: Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs. + type: array + items: + type: string + serviceAccountName: + type: string + strategy: + type: string + installModes: + description: InstallModes specify supported installation types + type: array + items: + description: InstallMode associates an InstallModeType with a flag representing if the CSV supports it + type: object + required: + - supported + - type + properties: + supported: + type: boolean + type: + description: InstallModeType is a supported type of install mode for CSV installation + type: string + keywords: + description: A list of keywords describing the operator. + type: array + items: + type: string + labels: + description: Map of string keys and values that can be used to organize and categorize (scope and select) objects. + type: object + additionalProperties: + type: string + links: + description: A list of links related to the operator. + type: array + items: + type: object + properties: + name: + type: string + url: + type: string + maintainers: + description: A list of organizational entities maintaining the operator. + type: array + items: + type: object + properties: + email: + type: string + name: + type: string + maturity: + type: string + minKubeVersion: + type: string + nativeAPIs: + type: array + items: + description: GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling + type: object + required: + - group + - kind + - version + properties: + group: + type: string + kind: + type: string + version: + type: string + provider: + description: The publishing entity behind the operator. + type: object + properties: + name: + type: string + url: + type: string + relatedImages: + description: List any related images, or other container images that your Operator might require to perform their functions. This list should also include operand images as well. All image references should be specified by digest (SHA) and not by tag. This field is only used during catalog creation and plays no part in cluster runtime. + type: array + items: + type: object + required: + - image + - name + properties: + image: + type: string + name: + type: string + replaces: + description: The name of a CSV this one replaces. Should match the `metadata.Name` field of the old CSV. + type: string + selector: + description: Label selector for related resources. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + skips: + description: The name(s) of one or more CSV(s) that should be skipped in the upgrade graph. Should match the `metadata.Name` field of the CSV that should be skipped. This field is only used during catalog creation and plays no part in cluster runtime. + type: array + items: + type: string + version: + type: string + webhookdefinitions: + type: array + items: + description: WebhookDescription provides details to OLM about required webhooks + type: object + required: + - admissionReviewVersions + - generateName + - sideEffects + - type + properties: + admissionReviewVersions: + type: array + items: + type: string + containerPort: + type: integer + format: int32 + default: 443 + maximum: 65535 + minimum: 1 + conversionCRDs: + type: array + items: + type: string + deploymentName: + type: string + failurePolicy: + description: FailurePolicyType specifies a failure policy that defines how unrecognized errors from the admission endpoint are handled. + type: string + generateName: + type: string + matchPolicy: + description: MatchPolicyType specifies the type of match policy. + type: string + objectSelector: + description: A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + reinvocationPolicy: + description: ReinvocationPolicyType specifies what type of policy the admission hook uses. + type: string + rules: + type: array + items: + description: RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid. + type: object + properties: + apiGroups: + description: APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required. + type: array + items: + type: string + x-kubernetes-list-type: atomic + apiVersions: + description: APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required. + type: array + items: + type: string + x-kubernetes-list-type: atomic + operations: + description: Operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or * for all of those operations and any future admission operations that are added. If '*' is present, the length of the slice must be one. Required. + type: array + items: + description: OperationType specifies an operation for a request. + type: string + x-kubernetes-list-type: atomic + resources: + description: "Resources is a list of resources this rule applies to. \n For example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources. \n If wildcard is present, the validation rule will ensure resources do not overlap with each other. \n Depending on the enclosing object, subresources might not be allowed. Required." + type: array + items: + type: string + x-kubernetes-list-type: atomic + scope: + description: scope specifies the scope of this rule. Valid values are "Cluster", "Namespaced", and "*" "Cluster" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. "Namespaced" means that only namespaced resources will match this rule. "*" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is "*". + type: string + sideEffects: + description: SideEffectClass specifies the types of side effects a webhook may have. + type: string + targetPort: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + timeoutSeconds: + type: integer + format: int32 + type: + description: WebhookAdmissionType is the type of admission webhooks supported by OLM + type: string + enum: + - ValidatingAdmissionWebhook + - MutatingAdmissionWebhook + - ConversionWebhook + webhookPath: + type: string + status: + description: ClusterServiceVersionStatus represents information about the status of a CSV. Status may trail the actual state of a system. + type: object + properties: + certsLastUpdated: + description: Last time the owned APIService certs were updated + type: string + format: date-time + certsRotateAt: + description: Time the owned APIService certs will rotate next + type: string + format: date-time + cleanup: + description: CleanupStatus represents information about the status of cleanup while a CSV is pending deletion + type: object + properties: + pendingDeletion: + description: PendingDeletion is the list of custom resource objects that are pending deletion and blocked on finalizers. This indicates the progress of cleanup that is blocking CSV deletion or operator uninstall. + type: array + items: + description: ResourceList represents a list of resources which are of the same Group/Kind + type: object + required: + - group + - instances + - kind + properties: + group: + type: string + instances: + type: array + items: + type: object + required: + - name + properties: + name: + type: string + namespace: + description: Namespace can be empty for cluster-scoped resources + type: string + kind: + type: string + conditions: + description: List of conditions, a history of state transitions + type: array + items: + description: Conditions appear in the status as a record of state transitions on the ClusterServiceVersion + type: object + properties: + lastTransitionTime: + description: Last time the status transitioned from one status to another. + type: string + format: date-time + lastUpdateTime: + description: Last time we updated the status + type: string + format: date-time + message: + description: A human readable message indicating details about why the ClusterServiceVersion is in this condition. + type: string + phase: + description: Condition of the ClusterServiceVersion + type: string + reason: + description: A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. e.g. 'RequirementsNotMet' + type: string + lastTransitionTime: + description: Last time the status transitioned from one status to another. + type: string + format: date-time + lastUpdateTime: + description: Last time we updated the status + type: string + format: date-time + message: + description: A human readable message indicating details about why the ClusterServiceVersion is in this condition. + type: string + phase: + description: Current condition of the ClusterServiceVersion + type: string + reason: + description: A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. e.g. 'RequirementsNotMet' + type: string + requirementStatus: + description: The status of each requirement for this CSV + type: array + items: + type: object + required: + - group + - kind + - message + - name + - status + - version + properties: + dependents: + type: array + items: + description: DependentStatus is the status for a dependent requirement (to prevent infinite nesting) + type: object + required: + - group + - kind + - status + - version + properties: + group: + type: string + kind: + type: string + message: + type: string + status: + description: StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus + type: string + uuid: + type: string + version: + type: string + group: + type: string + kind: + type: string + message: + type: string + name: + type: string + status: + description: StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus + type: string + uuid: + type: string + version: + type: string + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: installplans.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: InstallPlan + listKind: InstallPlanList + plural: installplans + shortNames: + - ip + singular: installplan + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The first CSV in the list of clusterServiceVersionNames + jsonPath: .spec.clusterServiceVersionNames[0] + name: CSV + type: string + - description: The approval mode + jsonPath: .spec.approval + name: Approval + type: string + - jsonPath: .spec.approved + name: Approved + type: boolean + name: v1alpha1 + schema: + openAPIV3Schema: + description: InstallPlan defines the installation of a set of operators. + type: object + required: + - metadata + - spec + 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: InstallPlanSpec defines a set of Application resources to be installed + type: object + required: + - approval + - approved + - clusterServiceVersionNames + properties: + approval: + description: Approval is the user approval policy for an InstallPlan. It must be one of "Automatic" or "Manual". + type: string + approved: + type: boolean + clusterServiceVersionNames: + type: array + items: + type: string + generation: + type: integer + source: + type: string + sourceNamespace: + type: string + status: + description: "InstallPlanStatus represents the information about the status of steps required to complete installation. \n Status may trail the actual state of a system." + type: object + required: + - catalogSources + - phase + properties: + attenuatedServiceAccountRef: + description: AttenuatedServiceAccountRef references the service account that is used to do scoped operator install. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + bundleLookups: + description: BundleLookups is the set of in-progress requests to pull and unpackage bundle content to the cluster. + type: array + items: + description: BundleLookup is a request to pull and unpackage the content of a bundle to the cluster. + type: object + required: + - catalogSourceRef + - identifier + - path + - replaces + properties: + catalogSourceRef: + description: CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + conditions: + description: Conditions represents the overall state of a BundleLookup. + type: array + items: + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status to another. + type: string + format: date-time + lastUpdateTime: + description: Last time the condition was probed. + type: string + format: date-time + message: + description: A human readable message indicating details about the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition. + type: string + identifier: + description: Identifier is the catalog-unique name of the operator (the name of the CSV for bundles that contain CSVs) + type: string + path: + description: Path refers to the location of a bundle to pull. It's typically an image reference. + type: string + properties: + description: The effective properties of the unpacked bundle. + type: string + replaces: + description: Replaces is the name of the bundle to replace with the one found at Path. + type: string + catalogSources: + type: array + items: + type: string + conditions: + type: array + items: + description: InstallPlanCondition represents the overall status of the execution of an InstallPlan. + type: object + properties: + lastTransitionTime: + type: string + format: date-time + lastUpdateTime: + type: string + format: date-time + message: + type: string + reason: + description: ConditionReason is a camelcased reason for the state transition. + type: string + status: + type: string + type: + description: InstallPlanConditionType describes the state of an InstallPlan at a certain point as a whole. + type: string + message: + description: Message is a human-readable message containing detailed information that may be important to understanding why the plan has its current status. + type: string + phase: + description: InstallPlanPhase is the current status of a InstallPlan as a whole. + type: string + plan: + type: array + items: + description: Step represents the status of an individual step in an InstallPlan. + type: object + required: + - resolving + - resource + - status + properties: + optional: + type: boolean + resolving: + type: string + resource: + description: StepResource represents the status of a resource to be tracked by an InstallPlan. + type: object + required: + - group + - kind + - name + - sourceName + - sourceNamespace + - version + properties: + group: + type: string + kind: + type: string + manifest: + type: string + name: + type: string + sourceName: + type: string + sourceNamespace: + type: string + version: + type: string + status: + description: StepStatus is the current status of a particular resource an in InstallPlan + type: string + startTime: + description: StartTime is the time when the controller began applying the resources listed in the plan to the cluster. + type: string + format: date-time + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: olmconfigs.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: OLMConfig + listKind: OLMConfigList + plural: olmconfigs + singular: olmconfig + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: OLMConfig is a resource responsible for configuring OLM. + type: object + required: + - metadata + 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: OLMConfigSpec is the spec for an OLMConfig resource. + type: object + properties: + features: + description: Features contains the list of configurable OLM features. + type: object + properties: + disableCopiedCSVs: + description: DisableCopiedCSVs is used to disable OLM's "Copied CSV" feature for operators installed at the cluster scope, where a cluster scoped operator is one that has been installed in an OperatorGroup that targets all namespaces. When reenabled, OLM will recreate the "Copied CSVs" for each cluster scoped operator. + type: boolean + status: + description: OLMConfigStatus is the status for an OLMConfig resource. + type: object + properties: + conditions: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: operatorconditions.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: OperatorCondition + listKind: OperatorConditionList + plural: operatorconditions + shortNames: + - condition + singular: operatorcondition + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. + type: object + required: + - metadata + 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: OperatorConditionSpec allows a cluster admin to convey information about the state of an operator to OLM, potentially overriding state reported by the operator. + type: object + properties: + deployments: + type: array + items: + type: string + overrides: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + serviceAccounts: + type: array + items: + type: string + status: + description: OperatorConditionStatus allows an operator to convey information its state to OLM. The status may trail the actual state of a system. + type: object + properties: + conditions: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + served: true + storage: false + subresources: + status: {} + - name: v2 + schema: + openAPIV3Schema: + description: OperatorCondition is a Custom Resource of type `OperatorCondition` which is used to convey information to OLM about the state of an operator. + type: object + required: + - metadata + 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: OperatorConditionSpec allows an operator to report state to OLM and provides cluster admin with the ability to manually override state reported by the operator. + type: object + properties: + conditions: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + deployments: + type: array + items: + type: string + overrides: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + serviceAccounts: + type: array + items: + type: string + status: + description: OperatorConditionStatus allows OLM to convey which conditions have been observed. + type: object + properties: + conditions: + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: operatorgroups.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: OperatorGroup + listKind: OperatorGroupList + plural: operatorgroups + shortNames: + - og + singular: operatorgroup + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: OperatorGroup is the unit of multitenancy for OLM managed operators. It constrains the installation of operators in its namespace to a specified set of target namespaces. + type: object + required: + - metadata + 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: OperatorGroupSpec is the spec for an OperatorGroup resource. + type: object + default: + upgradeStrategy: Default + properties: + selector: + description: Selector selects the OperatorGroup's target namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + serviceAccountName: + description: ServiceAccountName is the admin specified service account which will be used to deploy operator(s) in this operator group. + type: string + staticProvidedAPIs: + description: Static tells OLM not to update the OperatorGroup's providedAPIs annotation + type: boolean + targetNamespaces: + description: TargetNamespaces is an explicit set of namespaces to target. If it is set, Selector is ignored. + type: array + items: + type: string + x-kubernetes-list-type: set + upgradeStrategy: + description: "UpgradeStrategy defines the upgrade strategy for operators in the namespace. There are currently two supported upgrade strategies: \n Default: OLM will only allow clusterServiceVersions to move to the replacing phase from the succeeded phase. This effectively means that OLM will not allow operators to move to the next version if an installation or upgrade has failed. \n TechPreviewUnsafeFailForward: OLM will allow clusterServiceVersions to move to the replacing phase from the succeeded phase or from the failed phase. Additionally, OLM will generate new installPlans when a subscription references a failed installPlan and the catalog has been updated with a new upgrade for the existing set of operators. \n WARNING: The TechPreviewUnsafeFailForward upgrade strategy is unsafe and may result in unexpected behavior or unrecoverable data loss unless you have deep understanding of the set of operators being managed in the namespace." + type: string + default: Default + enum: + - Default + - TechPreviewUnsafeFailForward + status: + description: OperatorGroupStatus is the status for an OperatorGroupResource. + type: object + required: + - lastUpdated + properties: + conditions: + description: Conditions is an array of the OperatorGroup's conditions. + type: array + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + type: object + required: + - lastTransitionTime + - message + - reason + - status + - type + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + type: string + format: date-time + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + type: string + maxLength: 32768 + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + type: integer + format: int64 + minimum: 0 + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + type: string + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + status: + description: status of the condition, one of True, False, Unknown. + type: string + enum: + - "True" + - "False" + - Unknown + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + type: string + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + lastUpdated: + description: LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. + type: string + format: date-time + namespaces: + description: Namespaces is the set of target namespaces for the OperatorGroup. + type: array + items: + type: string + x-kubernetes-list-type: set + serviceAccountRef: + description: ServiceAccountRef references the service account object specified. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + served: true + storage: true + subresources: + status: {} + - name: v1alpha2 + schema: + openAPIV3Schema: + description: OperatorGroup is the unit of multitenancy for OLM managed operators. It constrains the installation of operators in its namespace to a specified set of target namespaces. + type: object + required: + - metadata + 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: OperatorGroupSpec is the spec for an OperatorGroup resource. + type: object + properties: + selector: + description: Selector selects the OperatorGroup's target namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + serviceAccountName: + description: ServiceAccountName is the admin specified service account which will be used to deploy operator(s) in this operator group. + type: string + staticProvidedAPIs: + description: Static tells OLM not to update the OperatorGroup's providedAPIs annotation + type: boolean + targetNamespaces: + description: TargetNamespaces is an explicit set of namespaces to target. If it is set, Selector is ignored. + type: array + items: + type: string + status: + description: OperatorGroupStatus is the status for an OperatorGroupResource. + type: object + required: + - lastUpdated + properties: + lastUpdated: + description: LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. + type: string + format: date-time + namespaces: + description: Namespaces is the set of target namespaces for the OperatorGroup. + type: array + items: + type: string + serviceAccountRef: + description: ServiceAccountRef references the service account object specified. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + served: true + storage: false + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: operators.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: Operator + listKind: OperatorList + plural: operators + singular: operator + scope: Cluster + versions: + - name: v1 + schema: + openAPIV3Schema: + description: Operator represents a cluster operator. + type: object + 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: OperatorSpec defines the desired state of Operator + type: object + status: + description: OperatorStatus defines the observed state of an Operator and its components + type: object + properties: + components: + description: Components describes resources that compose the operator. + type: object + required: + - labelSelector + properties: + labelSelector: + description: LabelSelector is a label query over a set of resources used to select the operator's components + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + refs: + description: Refs are a set of references to the operator's component resources, selected with LabelSelector. + type: array + items: + description: RichReference is a reference to a resource, enriched with its status conditions. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + conditions: + description: Conditions represents the latest state of the component. + type: array + items: + description: Condition represent the latest available observations of an component's state. + type: object + required: + - status + - type + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status to another. + type: string + format: date-time + lastUpdateTime: + description: Last time the condition was probed + type: string + format: date-time + message: + description: A human readable message indicating details about the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + served: true + storage: true + subresources: + status: {} + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.9.0 + creationTimestamp: null + name: subscriptions.operators.coreos.com +spec: + group: operators.coreos.com + names: + categories: + - olm + kind: Subscription + listKind: SubscriptionList + plural: subscriptions + shortNames: + - sub + - subs + singular: subscription + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The package subscribed to + jsonPath: .spec.name + name: Package + type: string + - description: The catalog source for the specified package + jsonPath: .spec.source + name: Source + type: string + - description: The channel of updates to subscribe to + jsonPath: .spec.channel + name: Channel + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Subscription keeps operators up to date by tracking changes to Catalogs. + type: object + required: + - metadata + - spec + 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: SubscriptionSpec defines an Application that can be installed + type: object + required: + - name + - source + - sourceNamespace + properties: + channel: + type: string + config: + description: SubscriptionConfig contains configuration specified for a subscription. + type: object + properties: + affinity: + description: If specified, overrides the pod's scheduling constraints. nil sub-attributes will *not* override the original values in the pod.spec for those sub-attributes. Use empty object ({}) to erase original sub-attribute values. + type: object + properties: + nodeAffinity: + description: Describes node affinity scheduling rules for the pod. + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred. + type: array + items: + description: An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). + type: object + required: + - preference + - weight + properties: + preference: + description: A node selector term, associated with the corresponding weight. + type: object + properties: + matchExpressions: + description: A list of node selector requirements by node's labels. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchFields: + description: A list of node selector requirements by node's fields. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + weight: + description: Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node. + type: object + required: + - nodeSelectorTerms + properties: + nodeSelectorTerms: + description: Required. A list of node selector terms. The terms are ORed. + type: array + items: + description: A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. + type: object + properties: + matchExpressions: + description: A list of node selector requirements by node's labels. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchFields: + description: A list of node selector requirements by node's fields. + type: array + items: + description: A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: The label key that the selector applies to. + type: string + operator: + description: Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. + type: string + values: + description: An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch. + type: array + items: + type: string + podAffinity: + description: Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)). + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + type: array + items: + description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + type: object + required: + - podAffinityTerm + - weight + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated with the corresponding weight. + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + weight: + description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + type: array + items: + description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + podAntiAffinity: + description: Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)). + type: object + properties: + preferredDuringSchedulingIgnoredDuringExecution: + description: The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred. + type: array + items: + description: The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s) + type: object + required: + - podAffinityTerm + - weight + properties: + podAffinityTerm: + description: Required. A pod affinity term, associated with the corresponding weight. + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + weight: + description: weight associated with matching the corresponding podAffinityTerm, in the range 1-100. + type: integer + format: int32 + requiredDuringSchedulingIgnoredDuringExecution: + description: If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied. + type: array + items: + description: Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running + type: object + required: + - topologyKey + properties: + labelSelector: + description: A label query over a set of resources, in this case pods. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaceSelector: + description: A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + namespaces: + description: namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace". + type: array + items: + type: string + topologyKey: + description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed. + type: string + env: + description: Env is a list of environment variables to set in the container. Cannot be updated. + type: array + items: + description: EnvVar represents an environment variable present in a Container. + type: object + required: + - name + properties: + name: + description: Name of the environment variable. Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to "".' + type: string + valueFrom: + description: Source for the environment variable's value. Cannot be used if value is not empty. + type: object + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + type: object + required: + - key + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or its key must be defined + type: boolean + fieldRef: + description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secretKeyRef: + description: Selects a key of a secret in the pod's namespace + type: object + required: + - key + properties: + key: + description: The key of the secret to select from. Must be a valid secret key. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret or its key must be defined + type: boolean + envFrom: + description: EnvFrom is a list of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Immutable. + type: array + items: + description: EnvFromSource represents the source of a set of ConfigMaps + type: object + properties: + configMapRef: + description: The ConfigMap to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap must be defined + type: boolean + prefix: + description: An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: Specify whether the Secret must be defined + type: boolean + nodeSelector: + description: 'NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node''s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/' + type: object + additionalProperties: + type: string + resources: + description: 'Resources represents compute resources required by this container. Immutable. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + selector: + description: Selector is the label selector for pods to be configured. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + tolerations: + description: Tolerations are the pod's tolerations. + type: array + items: + description: The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator . + type: object + properties: + effect: + description: Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys. + type: string + operator: + description: Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category. + type: string + tolerationSeconds: + description: TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system. + type: integer + format: int64 + value: + description: Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string. + type: string + volumeMounts: + description: List of VolumeMounts to set in the container. + type: array + items: + description: VolumeMount describes a mounting of a Volume within a container. + type: object + required: + - mountPath + - name + properties: + mountPath: + description: Path within the container at which the volume should be mounted. Must not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false. + type: boolean + subPath: + description: Path within the volume from which the container's volume should be mounted. Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to "" (volume's root). SubPathExpr and SubPath are mutually exclusive. + type: string + volumes: + description: List of Volumes to set in the podSpec. + type: array + items: + description: Volume represents a named volume in a pod that may be accessed by any container in the pod. + type: object + required: + - name + properties: + awsElasticBlockStore: + description: 'awsElasticBlockStore represents an AWS Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: object + required: + - volumeID + properties: + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).' + type: integer + format: int32 + readOnly: + description: 'readOnly value true will force the readOnly setting in VolumeMounts. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: boolean + volumeID: + description: 'volumeID is unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: string + azureDisk: + description: azureDisk represents an Azure Data Disk mount on the host and bind mount to the pod. + type: object + required: + - diskName + - diskURI + properties: + cachingMode: + description: 'cachingMode is the Host Caching mode: None, Read Only, Read Write.' + type: string + diskName: + description: diskName is the Name of the data disk in the blob storage + type: string + diskURI: + description: diskURI is the URI of data disk in the blob storage + type: string + fsType: + description: fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + kind: + description: 'kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared' + type: string + readOnly: + description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + azureFile: + description: azureFile represents an Azure File Service mount on the host and bind mount to the pod. + type: object + required: + - secretName + - shareName + properties: + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretName: + description: secretName is the name of secret that contains Azure Storage Account Name and Key + type: string + shareName: + description: shareName is the azure share Name + type: string + cephfs: + description: cephFS represents a Ceph FS mount on the host that shares a pod's lifetime + type: object + required: + - monitors + properties: + monitors: + description: 'monitors is Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: array + items: + type: string + path: + description: 'path is Optional: Used as the mounted root, rather than the full Ceph tree, default is /' + type: string + readOnly: + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: boolean + secretFile: + description: 'secretFile is Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + secretRef: + description: 'secretRef is Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + user: + description: 'user is optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + cinder: + description: 'cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: object + required: + - volumeID + properties: + fsType: + description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + readOnly: + description: 'readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: boolean + secretRef: + description: 'secretRef is optional: points to a secret object containing parameters used to connect to OpenStack.' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + volumeID: + description: 'volumeID used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + configMap: + description: configMap represents a configMap that should populate this volume + type: object + properties: + defaultMode: + description: 'defaultMode is optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional specify whether the ConfigMap or its keys must be defined + type: boolean + csi: + description: csi (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature). + type: object + required: + - driver + properties: + driver: + description: driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster. + type: string + fsType: + description: fsType to mount. Ex. "ext4", "xfs", "ntfs". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply. + type: string + nodePublishSecretRef: + description: nodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + readOnly: + description: readOnly specifies a read-only configuration for the volume. Defaults to false (read/write). + type: boolean + volumeAttributes: + description: volumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values. + type: object + additionalProperties: + type: string + downwardAPI: + description: downwardAPI represents downward API about the pod that should populate this volume + type: object + properties: + defaultMode: + description: 'Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: Items is a list of downward API volume file + type: array + items: + description: DownwardAPIVolumeFile represents information to create the file containing the pod field + type: object + required: + - path + properties: + fieldRef: + description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + mode: + description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + emptyDir: + description: 'emptyDir represents a temporary directory that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: object + properties: + medium: + description: 'medium represents what type of storage medium should back this directory. The default is "" which means to use the node''s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: string + sizeLimit: + description: 'sizeLimit is the total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + ephemeral: + description: "ephemeral represents a volume that is handled by a cluster storage driver. The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed. \n Use this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity tracking are needed, c) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through a PersistentVolumeClaim (see EphemeralVolumeSource for more information on the connection between this volume type and PersistentVolumeClaim). \n Use PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod. \n Use CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information. \n A pod can use both types of ephemeral volumes and persistent volumes at the same time." + type: object + properties: + volumeClaimTemplate: + description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). \n An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. \n This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. \n Required, must not be nil." + type: object + required: + - spec + properties: + metadata: + description: May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation. + type: object + spec: + description: The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here. + type: object + properties: + accessModes: + description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + type: array + items: + type: string + dataSource: + description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.' + type: object + required: + - kind + - name + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + dataSourceRef: + description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn''t specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn''t set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.' + type: object + required: + - kind + - name + properties: + apiGroup: + description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + namespace: + description: Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. + type: string + resources: + description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + type: object + properties: + claims: + description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable." + type: array + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + type: object + required: + - name + properties: + name: + description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. + type: string + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + requests: + description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' + type: object + additionalProperties: + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + selector: + description: selector is a label query over volumes to consider for binding. + type: object + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + type: array + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + type: object + required: + - key + - operator + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + type: array + items: + type: string + matchLabels: + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + additionalProperties: + type: string + storageClassName: + description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: volumeName is the binding reference to the PersistentVolume backing this claim. + type: string + fc: + description: fc represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod. + type: object + properties: + fsType: + description: 'fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + lun: + description: 'lun is Optional: FC target lun number' + type: integer + format: int32 + readOnly: + description: 'readOnly is Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + type: boolean + targetWWNs: + description: 'targetWWNs is Optional: FC target worldwide names (WWNs)' + type: array + items: + type: string + wwids: + description: 'wwids Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.' + type: array + items: + type: string + flexVolume: + description: flexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin. + type: object + required: + - driver + properties: + driver: + description: driver is the name of the driver to use for this volume. + type: string + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". The default filesystem depends on FlexVolume script. + type: string + options: + description: 'options is Optional: this field holds extra command options if any.' + type: object + additionalProperties: + type: string + readOnly: + description: 'readOnly is Optional: defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.' + type: boolean + secretRef: + description: 'secretRef is Optional: secretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + flocker: + description: flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running + type: object + properties: + datasetName: + description: datasetName is Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated + type: string + datasetUUID: + description: datasetUUID is the UUID of the dataset. This is unique identifier of a Flocker dataset + type: string + gcePersistentDisk: + description: 'gcePersistentDisk represents a GCE Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: object + required: + - pdName + properties: + fsType: + description: 'fsType is filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + partition: + description: 'partition is the partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as "1". Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: integer + format: int32 + pdName: + description: 'pdName is unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: string + readOnly: + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: boolean + gitRepo: + description: 'gitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod''s container.' + type: object + required: + - repository + properties: + directory: + description: directory is the target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + type: string + repository: + description: repository is the URL + type: string + revision: + description: revision is the commit hash for the specified revision. + type: string + glusterfs: + description: 'glusterfs represents a Glusterfs mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md' + type: object + required: + - endpoints + - path + properties: + endpoints: + description: 'endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + path: + description: 'path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + readOnly: + description: 'readOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: boolean + hostPath: + description: 'hostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath --- TODO(jonesdl) We need to restrict who can use host directory mounts and who can/can not mount host directories as read/write.' + type: object + required: + - path + properties: + path: + description: 'path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + type: + description: 'type for HostPath Volume Defaults to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + iscsi: + description: 'iscsi represents an ISCSI Disk resource that is attached to a kubelet''s host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + type: object + required: + - iqn + - lun + - targetPortal + properties: + chapAuthDiscovery: + description: chapAuthDiscovery defines whether support iSCSI Discovery CHAP authentication + type: boolean + chapAuthSession: + description: chapAuthSession defines whether support iSCSI Session CHAP authentication + type: boolean + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + initiatorName: + description: initiatorName is the custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection. + type: string + iqn: + description: iqn is the target iSCSI Qualified Name. + type: string + iscsiInterface: + description: iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp). + type: string + lun: + description: lun represents iSCSI Target Lun number. + type: integer + format: int32 + portals: + description: portals is the iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + type: array + items: + type: string + readOnly: + description: readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. + type: boolean + secretRef: + description: secretRef is the CHAP Secret for iSCSI target and initiator authentication + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + targetPortal: + description: targetPortal is iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260). + type: string + name: + description: 'name of the volume. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + nfs: + description: 'nfs represents an NFS mount on the host that shares a pod''s lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: object + required: + - path + - server + properties: + path: + description: 'path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + readOnly: + description: 'readOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: boolean + server: + description: 'server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + persistentVolumeClaim: + description: 'persistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: object + required: + - claimName + properties: + claimName: + description: 'claimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: string + readOnly: + description: readOnly Will force the ReadOnly setting in VolumeMounts. Default false. + type: boolean + photonPersistentDisk: + description: photonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine + type: object + required: + - pdID + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + pdID: + description: pdID is the ID that identifies Photon Controller persistent disk + type: string + portworxVolume: + description: portworxVolume represents a portworx volume attached and mounted on kubelets host machine + type: object + required: + - volumeID + properties: + fsType: + description: fSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + volumeID: + description: volumeID uniquely identifies a Portworx volume + type: string + projected: + description: projected items for all in one resources secrets, configmaps, and downward API + type: object + properties: + defaultMode: + description: defaultMode are the mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set. + type: integer + format: int32 + sources: + description: sources is the list of volume projections + type: array + items: + description: Projection that may be projected along with other supported volume types + type: object + properties: + configMap: + description: configMap information about the configMap data to project + type: object + properties: + items: + description: items if unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional specify whether the ConfigMap or its keys must be defined + type: boolean + downwardAPI: + description: downwardAPI information about the downwardAPI data to project + type: object + properties: + items: + description: Items is a list of DownwardAPIVolume file + type: array + items: + description: DownwardAPIVolumeFile represents information to create the file containing the pod field + type: object + required: + - path + properties: + fieldRef: + description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' + type: object + required: + - fieldPath + properties: + apiVersion: + description: Version of the schema the FieldPath is written in terms of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to select in the specified API version. + type: string + mode: + description: 'Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: 'Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ''..'' path. Must be utf-8 encoded. The first item of the relative path must not start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.' + type: object + required: + - resource + properties: + containerName: + description: 'Container name: required for volumes, optional for env vars' + type: string + divisor: + description: Specifies the output format of the exposed resources, defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to select' + type: string + secret: + description: secret information about the secret data to project + type: object + properties: + items: + description: items if unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + optional: + description: optional field specify whether the Secret or its key must be defined + type: boolean + serviceAccountToken: + description: serviceAccountToken is information about the serviceAccountToken data to project + type: object + required: + - path + properties: + audience: + description: audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver. + type: string + expirationSeconds: + description: expirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes. + type: integer + format: int64 + path: + description: path is the path relative to the mount point of the file to project the token into. + type: string + quobyte: + description: quobyte represents a Quobyte mount on the host that shares a pod's lifetime + type: object + required: + - registry + - volume + properties: + group: + description: group to map volume access to Default is no group + type: string + readOnly: + description: readOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false. + type: boolean + registry: + description: registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes + type: string + tenant: + description: tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin + type: string + user: + description: user to map volume access to Defaults to serivceaccount user + type: string + volume: + description: volume is a string that references an already created Quobyte volume by name. + type: string + rbd: + description: 'rbd represents a Rados Block Device mount on the host that shares a pod''s lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md' + type: object + required: + - image + - monitors + properties: + fsType: + description: 'fsType is the filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd TODO: how do we prevent errors in the filesystem from compromising the machine' + type: string + image: + description: 'image is the rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + keyring: + description: 'keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + monitors: + description: 'monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: array + items: + type: string + pool: + description: 'pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + readOnly: + description: 'readOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: boolean + secretRef: + description: 'secretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + user: + description: 'user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + scaleIO: + description: scaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes. + type: object + required: + - gateway + - secretRef + - system + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Default is "xfs". + type: string + gateway: + description: gateway is the host address of the ScaleIO API Gateway. + type: string + protectionDomain: + description: protectionDomain is the name of the ScaleIO Protection Domain for the configured storage. + type: string + readOnly: + description: readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + sslEnabled: + description: sslEnabled Flag enable/disable SSL communication with Gateway, default false + type: boolean + storageMode: + description: storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned. + type: string + storagePool: + description: storagePool is the ScaleIO Storage Pool associated with the protection domain. + type: string + system: + description: system is the name of the storage system as configured in ScaleIO. + type: string + volumeName: + description: volumeName is the name of a volume already created in the ScaleIO system that is associated with this volume source. + type: string + secret: + description: 'secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: object + properties: + defaultMode: + description: 'defaultMode is Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + items: + description: items If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'. + type: array + items: + description: Maps a string key to a path within a volume. + type: object + required: + - key + - path + properties: + key: + description: key is the key to project. + type: string + mode: + description: 'mode is Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' + type: integer + format: int32 + path: + description: path is the relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'. + type: string + optional: + description: optional field specify whether the Secret or its keys must be defined + type: boolean + secretName: + description: 'secretName is the name of the secret in the pod''s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: string + storageos: + description: storageOS represents a StorageOS volume attached and mounted on Kubernetes nodes. + type: object + properties: + fsType: + description: fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: readOnly defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. + type: boolean + secretRef: + description: secretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted. + type: object + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?' + type: string + volumeName: + description: volumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace. + type: string + volumeNamespace: + description: volumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to "default" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created. + type: string + vsphereVolume: + description: vsphereVolume represents a vSphere volume attached and mounted on kubelets host machine + type: object + required: + - volumePath + properties: + fsType: + description: fsType is filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: storagePolicyID is the storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: storagePolicyName is the storage Policy Based Management (SPBM) profile name. + type: string + volumePath: + description: volumePath is the path that identifies vSphere volume vmdk + type: string + installPlanApproval: + description: Approval is the user approval policy for an InstallPlan. It must be one of "Automatic" or "Manual". + type: string + name: + type: string + source: + type: string + sourceNamespace: + type: string + startingCSV: + type: string + status: + type: object + required: + - lastUpdated + properties: + catalogHealth: + description: CatalogHealth contains the Subscription's view of its relevant CatalogSources' status. It is used to determine SubscriptionStatusConditions related to CatalogSources. + type: array + items: + description: SubscriptionCatalogHealth describes the health of a CatalogSource the Subscription knows about. + type: object + required: + - catalogSourceRef + - healthy + - lastUpdated + properties: + catalogSourceRef: + description: CatalogSourceRef is a reference to a CatalogSource. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + healthy: + description: Healthy is true if the CatalogSource is healthy; false otherwise. + type: boolean + lastUpdated: + description: LastUpdated represents the last time that the CatalogSourceHealth changed + type: string + format: date-time + conditions: + description: Conditions is a list of the latest available observations about a Subscription's current state. + type: array + items: + description: SubscriptionCondition represents the latest available observations of a Subscription's state. + type: object + required: + - status + - type + properties: + lastHeartbeatTime: + description: LastHeartbeatTime is the last time we got an update on a given condition + type: string + format: date-time + lastTransitionTime: + description: LastTransitionTime is the last time the condition transit from one status to another + type: string + format: date-time + message: + description: Message is a human-readable message indicating details about last transition. + type: string + reason: + description: Reason is a one-word CamelCase reason for the condition's last transition. + type: string + status: + description: Status is the status of the condition, one of True, False, Unknown. + type: string + type: + description: Type is the type of Subscription condition. + type: string + currentCSV: + description: CurrentCSV is the CSV the Subscription is progressing to. + type: string + installPlanGeneration: + description: InstallPlanGeneration is the current generation of the installplan + type: integer + installPlanRef: + description: InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV. + type: object + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + installedCSV: + description: InstalledCSV is the CSV currently installed by the Subscription. + type: string + installplan: + description: 'Install is a reference to the latest InstallPlan generated for the Subscription. DEPRECATED: InstallPlanRef' + type: object + required: + - apiVersion + - kind + - name + - uuid + properties: + apiVersion: + type: string + kind: + type: string + name: + type: string + uuid: + description: UID is a type that holds unique ID values, including UUIDs. Because we don't ONLY use UUIDs, this is an alias to string. Being a type captures intent and helps make sure that UIDs and names do not get conflated. + type: string + lastUpdated: + description: LastUpdated represents the last time that the Subscription status was updated. + type: string + format: date-time + reason: + description: Reason is the reason the Subscription was transitioned to its current state. + type: string + state: + description: State represents the current state of the Subscription + type: string + served: true + storage: true + subresources: + status: {} + + diff --git a/charts/everest/everest-admin.yaml b/charts/everest/everest-admin.yaml new file mode 100644 index 00000000..65fa471a --- /dev/null +++ b/charts/everest/everest-admin.yaml @@ -0,0 +1,5 @@ +admin: + passwordHash: {{ randAlphaNum 64 }} + enabled: true + capabilities: + - login diff --git a/charts/everest/templates/NOTES.txt b/charts/everest/templates/NOTES.txt new file mode 100644 index 00000000..e69de29b diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl new file mode 100644 index 00000000..5b80367f --- /dev/null +++ b/charts/everest/templates/_helpers.tpl @@ -0,0 +1,70 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "chart.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 "chart.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 "chart.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "chart.labels" -}} +helm.sh/chart: {{ include "chart.chart" . }} +{{ include "chart.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "chart.selectorLabels" -}} +app.kubernetes.io/name: {{ include "chart.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "chart.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "chart.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "chart.everestAdminAccount" }} +admin: + passwordHash: {{ randAlphaNum 64 }} + enabled: true + capabilities: + - login +{{- end}} diff --git a/charts/everest/templates/everest-operator/operatorgroup.yaml b/charts/everest/templates/everest-operator/operatorgroup.yaml new file mode 100644 index 00000000..daec0355 --- /dev/null +++ b/charts/everest/templates/everest-operator/operatorgroup.yaml @@ -0,0 +1,12 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: {{ .Release.Namespace }} + namespace: {{ .Release.Namespace }} +spec: + targetNamespaces: + - {{ .Release.Namespace }} + {{- range $i, $ns := .Values.namespaces }} + - {{ $ns.name }} + {{- end }} + upgradeStrategy: Default diff --git a/charts/everest/templates/everest-operator/subscription.yaml b/charts/everest/templates/everest-operator/subscription.yaml new file mode 100644 index 00000000..d8f111e9 --- /dev/null +++ b/charts/everest/templates/everest-operator/subscription.yaml @@ -0,0 +1,27 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: everest-operator + namespace: {{ .Release.Namespace }} +spec: + channel: {{ .Values.everestOperator.channel }} + installPlanApproval: Manual + name: everest-operator + source: everest-catalog + sourceNamespace: {{ .Values.olm.namespace }} + {{- if ne .Values.everestOperator.version "" }} + startingCSV: everest-operator.v{{ .Chart.Version }} + {{- end }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if .Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} + - name: MONITORING_NAMESPACE + value: {{ .Values.vmOperator.namespace }} + - name: DB_NAMESPACES + value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }} + diff --git a/charts/everest/templates/everest-server/clusterrole.yaml b/charts/everest/templates/everest-server/clusterrole.yaml new file mode 100644 index 00000000..dfc30c70 --- /dev/null +++ b/charts/everest/templates/everest-server/clusterrole.yaml @@ -0,0 +1,23 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: everest-admin-cluster-role +rules: + - apiGroups: ["everest.percona.com"] + resources: ["databaseengines"] + verbs: ["get", "list", "update"] + - apiGroups: ["everest.percona.com"] + resources: ["databaseclusters", "databaseclusterbackups", "databaseclusterrestores", "backupstorages", "monitoringconfigs"] + verbs: ["*"] + - apiGroups: [""] + resources: ["secrets", "configmaps", "namespaces"] + verbs: ["*"] + - apiGroups: [""] + resources: ["nodes", "pods", "persistentvolumes"] + verbs: ["get", "list"] + - apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["list"] + - apiGroups: ["everest.percona.com"] + resources: ["*"] + verbs: ["*"] diff --git a/charts/everest/templates/everest-server/clusterrolebinding.yaml b/charts/everest/templates/everest-server/clusterrolebinding.yaml new file mode 100644 index 00000000..9f985e47 --- /dev/null +++ b/charts/everest/templates/everest-server/clusterrolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: everest-admin-cluster-role-binding +roleRef: + kind: "ClusterRole" + apiGroup: "rbac.authorization.k8s.io" + name: everest-admin-cluster-role +subjects: + - kind: "ServiceAccount" + name: everest-admin + namespace: everest-system diff --git a/charts/everest/templates/everest-server/configmaps.yaml b/charts/everest/templates/everest-server/configmaps.yaml new file mode 100644 index 00000000..474c65c6 --- /dev/null +++ b/charts/everest/templates/everest-server/configmaps.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: everest-rbac + namespace: {{ .Release.Namespace }} +data: + policy.csv: | + g, admin, role:admin diff --git a/charts/everest/templates/everest-server/deployment.yaml b/charts/everest/templates/everest-server/deployment.yaml new file mode 100644 index 00000000..4af179a7 --- /dev/null +++ b/charts/everest/templates/everest-server/deployment.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: percona-everest + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + strategy: + type: RollingUpdate + selector: + matchLabels: + app.kubernetes.io/name: everest + app.kubernetes.io/component: everest + template: + metadata: + labels: + app.kubernetes.io/name: everest + app.kubernetes.io/component: everest + spec: + serviceAccountName: everest-admin + automountServiceAccountToken: true + volumes: + - name: jwt-secret + secret: + secretName: everest-jwt + containers: + - name: everest + image: {{ .Values.image }}:{{ .Chart.Version }} + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 5 + livenessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 300 + periodSeconds: 15 + resources: + limits: + cpu: 200m + memory: 500Mi + requests: + cpu: 100m + memory: 20Mi + volumeMounts: + - name: jwt-secret + mountPath: /etc/jwt diff --git a/charts/everest/templates/everest-server/role.yaml b/charts/everest/templates/everest-server/role.yaml new file mode 100644 index 00000000..65df6195 --- /dev/null +++ b/charts/everest/templates/everest-server/role.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: everest-admin-role + namespace: {{ .Release.Namespace }} +rules: + - apiGroups: [""] + resources: ["namespaces"] + verbs: ["get", "list"] + - apiGroups: ["apps"] + resources: ["deployments"] + verbs: ["get"] diff --git a/charts/everest/templates/everest-server/rolebinding.yaml b/charts/everest/templates/everest-server/rolebinding.yaml new file mode 100644 index 00000000..5e203a7f --- /dev/null +++ b/charts/everest/templates/everest-server/rolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: everest-admin-role-binding + namespace: {{ .Release.Namespace }} +roleRef: + kind: "Role" + apiGroup: "rbac.authorization.k8s.io" + name: everest-admin-role +subjects: + - kind: "ServiceAccount" + name: everest-admin diff --git a/charts/everest/templates/everest-server/secrets.yaml b/charts/everest/templates/everest-server/secrets.yaml new file mode 100644 index 00000000..509bb597 --- /dev/null +++ b/charts/everest/templates/everest-server/secrets.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Secret +metadata: + name: everest-jwt + namespace: {{ .Release.Namespace }} +data: + id_rsa: {{ genPrivateKey "rsa" | b64enc }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: everest-accounts + namespace: {{ .Release.Namespace }} + annotations: + insecure-password/admin: "true" +data: + users.yaml: {{ tpl (.Files.Get "everest-admin.yaml") . | b64enc }} diff --git a/charts/everest/templates/everest-server/service.yaml b/charts/everest/templates/everest-server/service.yaml new file mode 100644 index 00000000..b3ac3a7d --- /dev/null +++ b/charts/everest/templates/everest-server/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: everest + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: everest + app.kubernetes.io/component: everest +spec: + selector: + app.kubernetes.io/component: everest + app.kubernetes.io/name: everest + type: ClusterIP + ports: + - protocol: TCP + port: 8080 diff --git a/charts/everest/templates/everest-server/serviceaccount.yaml b/charts/everest/templates/everest-server/serviceaccount.yaml new file mode 100644 index 00000000..c0947cd3 --- /dev/null +++ b/charts/everest/templates/everest-server/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: everest-admin + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/installplan-approver/job.yaml b/charts/everest/templates/hooks/installplan-approver/job.yaml new file mode 100644 index 00000000..aa7d1a95 --- /dev/null +++ b/charts/everest/templates/hooks/installplan-approver/job.yaml @@ -0,0 +1,43 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: installplan-approver + namespace: {{ .Release.Namespace }} + annotations: + "helm.sh/hook": post-install,post-upgrade +spec: + template: + spec: + containers: + - image: bitnami/kubectl:latest + command: + - /bin/bash + - -c + - | + echo "Sleep for sometime to wait for all the resources to be created..." + sleep 120 + for ns in $(echo $NAMESPACES | sed "s/,/ /g") + do + echo "Approving InstallPlans in namespace $ns" + for subscription in `kubectl -n $ns get subscriptions -o jsonpath='{.items[*].metadata.name}'` + do + echo "Processing subscription $subscription" + installplan=$(kubectl -n $ns get subscriptions $subscription -o jsonpath='{.status.installPlanRef.name}') + if [ "`kubectl -n $ns get installplan $installplan -o jsonpath="{.spec.approved}"`" == "false" ]; then + echo "Approving Subscription $subscription with install plan $installplan" + kubectl -n $ns patch installplan $installplan --type=json -p='[{"op":"replace","path": "/spec/approved", "value": true}]' + else + echo "Install Plan '$installplan' already approved" + fi + done + done + imagePullPolicy: Always + name: installplan-approver + env: + - name: NAMESPACES + value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }},{{ .Release.Namespace }},{{ .Values.vmOperator.namespace }} + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: everest-installer + serviceAccountName: everest-installer + terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/installplan-approver/rbac.yaml b/charts/everest/templates/hooks/installplan-approver/rbac.yaml new file mode 100644 index 00000000..e5f21e49 --- /dev/null +++ b/charts/everest/templates/hooks/installplan-approver/rbac.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: everest-installer + namespace: {{ .Release.Namespace }} +rules: + - apiGroups: + - operators.coreos.com + resources: + - installplans + - subscriptions + verbs: + - get + - list + - patch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: everest-installer +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: everest-installer +subjects: + - kind: ServiceAccount + name: everest-installer + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml b/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml new file mode 100644 index 00000000..f894cf8f --- /dev/null +++ b/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: everest-installer + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/uninstall/job.yaml b/charts/everest/templates/hooks/uninstall/job.yaml new file mode 100644 index 00000000..ef9ab95a --- /dev/null +++ b/charts/everest/templates/hooks/uninstall/job.yaml @@ -0,0 +1,39 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: uninstall + namespace: {{ .Release.Namespace }} + annotations: + "helm.sh/hook": pre-delete +spec: + template: + spec: + containers: + - image: bitnami/kubectl:latest + command: + - /bin/bash + - -c + - | + # For each DB namespace + for ns in $(echo $NAMESPACES | sed "s/,/ /g") + do + # List DBs in this namespace + dbs=$(kubectl get db -n ${ns} -o=jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}') + for db in $dbs; do + kubectl delete db $db -n $ns --wait + done + kubectl delete -n ${ns} csv --all --wait + done + echo "Deleted databases" + + kubectl delete csv packageserver -n {{ .Values.olm.namespace }} --wait + imagePullPolicy: Always + name: uninstaller + env: + - name: NAMESPACES + value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }},{{ .Release.Namespace }},{{ .Values.vmOperator.namespace }} + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: everest-uninstaller + serviceAccountName: everest-uninstaller + terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/uninstall/rbac.yaml b/charts/everest/templates/hooks/uninstall/rbac.yaml new file mode 100644 index 00000000..2d05f9ce --- /dev/null +++ b/charts/everest/templates/hooks/uninstall/rbac.yaml @@ -0,0 +1,34 @@ +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: everest-uninstaller +rules: + - apiGroups: + - operators.coreos.com + resources: + - clusterserviceversions + verbs: + - delete + - list + - apiGroups: + - everest.percona.com + resources: + - databaseclusters + verbs: + - get + - list + - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: everest-uninstaller +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: everest-uninstaller +subjects: + - kind: ServiceAccount + name: everest-uninstaller + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/uninstall/serviceaccount.yaml b/charts/everest/templates/hooks/uninstall/serviceaccount.yaml new file mode 100644 index 00000000..b8fa9eb1 --- /dev/null +++ b/charts/everest/templates/hooks/uninstall/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: everest-uninstaller + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/olm/catalog-operator.deployment.yaml b/charts/everest/templates/olm/catalog-operator.deployment.yaml new file mode 100644 index 00000000..712ed4b1 --- /dev/null +++ b/charts/everest/templates/olm/catalog-operator.deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: catalog-operator + namespace: everest-olm + labels: + app: catalog-operator +spec: + strategy: + type: RollingUpdate + replicas: 1 + selector: + matchLabels: + app: catalog-operator + template: + metadata: + labels: + app: catalog-operator + spec: + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + serviceAccountName: olm-operator-serviceaccount + containers: + - name: catalog-operator + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: [ "ALL" ] + command: + - /bin/catalog + args: + - '--namespace' + - everest-olm + - --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest + - --util-image + - quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + - --set-workload-user-id=true + image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + name: metrics + livenessProbe: + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + readinessProbe: + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + terminationMessagePolicy: FallbackToLogsOnError + resources: + requests: + cpu: 10m + memory: 80Mi + nodeSelector: + kubernetes.io/os: linux diff --git a/charts/everest/templates/olm/clusterrole.yaml b/charts/everest/templates/olm/clusterrole.yaml new file mode 100644 index 00000000..13c7abdb --- /dev/null +++ b/charts/everest/templates/olm/clusterrole.yaml @@ -0,0 +1,41 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: system:controller:operator-lifecycle-manager +rules: +- apiGroups: ["*"] + resources: ["*"] + verbs: ["*"] +- nonResourceURLs: ["*"] + verbs: ["*"] +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: aggregate-olm-edit + labels: + rbac.authorization.k8s.io/aggregate-to-admin: "true" + rbac.authorization.k8s.io/aggregate-to-edit: "true" +rules: +- apiGroups: ["operators.coreos.com"] + resources: ["subscriptions"] + verbs: ["create", "update", "patch", "delete"] +- apiGroups: ["operators.coreos.com"] + resources: ["clusterserviceversions", "catalogsources", "installplans", "subscriptions"] + verbs: ["delete"] +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: aggregate-olm-view + labels: + rbac.authorization.k8s.io/aggregate-to-admin: "true" + rbac.authorization.k8s.io/aggregate-to-edit: "true" + rbac.authorization.k8s.io/aggregate-to-view: "true" +rules: +- apiGroups: ["operators.coreos.com"] + resources: ["clusterserviceversions", "catalogsources", "installplans", "subscriptions", "operatorgroups"] + verbs: ["get", "list", "watch"] +- apiGroups: ["packages.operators.coreos.com"] + resources: ["packagemanifests", "packagemanifests/icon"] + verbs: ["get", "list", "watch"] diff --git a/charts/everest/templates/olm/clusterrolebinding.yaml b/charts/everest/templates/olm/clusterrolebinding.yaml new file mode 100644 index 00000000..1563c7b0 --- /dev/null +++ b/charts/everest/templates/olm/clusterrolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: olm-operator-binding-olm +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:controller:operator-lifecycle-manager +subjects: +- kind: ServiceAccount + name: olm-operator-serviceaccount + namespace: everest-olm diff --git a/charts/everest/templates/olm/everest-catalogsource.yaml b/charts/everest/templates/olm/everest-catalogsource.yaml new file mode 100644 index 00000000..eae195e8 --- /dev/null +++ b/charts/everest/templates/olm/everest-catalogsource.yaml @@ -0,0 +1,15 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: everest-catalog + namespace: everest-olm +spec: + displayName: Everest Catalog + grpcPodConfig: + securityContextConfig: restricted + image: {{ .Values.olm.catalogSourceImage }}:{{ .Chart.Version }} + publisher: Percona + sourceType: grpc + updateStrategy: + registryPoll: + interval: 45m diff --git a/charts/everest/templates/olm/namespace.yaml b/charts/everest/templates/olm/namespace.yaml new file mode 100644 index 00000000..2bb07571 --- /dev/null +++ b/charts/everest/templates/olm/namespace.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: everest-olm + labels: + pod-security.kubernetes.io/enforce: restricted + pod-security.kubernetes.io/enforce-version: latest + pod-security.kubernetes.io/audit: restricted + pod-security.kubernetes.io/audit-version: latest + pod-security.kubernetes.io/warn: restricted + pod-security.kubernetes.io/warn-version: latest diff --git a/charts/everest/templates/olm/olm-operator.deployment.yaml b/charts/everest/templates/olm/olm-operator.deployment.yaml new file mode 100644 index 00000000..8703f3ee --- /dev/null +++ b/charts/everest/templates/olm/olm-operator.deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: olm-operator + namespace: everest-olm + labels: + app: olm-operator +spec: + strategy: + type: RollingUpdate + replicas: 1 + selector: + matchLabels: + app: olm-operator + template: + metadata: + labels: + app: olm-operator + spec: + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + serviceAccountName: olm-operator-serviceaccount + containers: + - name: olm-operator + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: [ "ALL" ] + command: + - /bin/olm + args: + - --namespace + - $(OPERATOR_NAMESPACE) + - --writeStatusName + - "" + image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + name: metrics + livenessProbe: + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + readinessProbe: + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + terminationMessagePolicy: FallbackToLogsOnError + env: + - name: OPERATOR_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: OPERATOR_NAME + value: olm-operator + resources: + requests: + cpu: 10m + memory: 160Mi + nodeSelector: + kubernetes.io/os: linux diff --git a/charts/everest/templates/olm/olmconfig.yaml b/charts/everest/templates/olm/olmconfig.yaml new file mode 100644 index 00000000..ad881b7b --- /dev/null +++ b/charts/everest/templates/olm/olmconfig.yaml @@ -0,0 +1,4 @@ +apiVersion: operators.coreos.com/v1 +kind: OLMConfig +metadata: + name: cluster diff --git a/charts/everest/templates/olm/operatorgroup.yaml b/charts/everest/templates/olm/operatorgroup.yaml new file mode 100644 index 00000000..d4340f2a --- /dev/null +++ b/charts/everest/templates/olm/operatorgroup.yaml @@ -0,0 +1,8 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: olm-operators + namespace: everest-olm +spec: + targetNamespaces: + - everest-olm diff --git a/charts/everest/templates/olm/packageserver.csv.yaml b/charts/everest/templates/olm/packageserver.csv.yaml new file mode 100644 index 00000000..208460b2 --- /dev/null +++ b/charts/everest/templates/olm/packageserver.csv.yaml @@ -0,0 +1,140 @@ +apiVersion: operators.coreos.com/v1alpha1 +kind: ClusterServiceVersion +metadata: + name: packageserver + namespace: everest-olm + labels: + olm.version: v0.27.0 +spec: + displayName: Package Server + description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. + minKubeVersion: 1.11.0 + keywords: ['packagemanifests', 'olm', 'packages'] + maintainers: + - name: Red Hat + email: openshift-operators@redhat.com + provider: + name: Red Hat + links: + - name: Package Server + url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/package-server + installModes: + - type: OwnNamespace + supported: true + - type: SingleNamespace + supported: true + - type: MultiNamespace + supported: true + - type: AllNamespaces + supported: true + install: + strategy: deployment + spec: + clusterPermissions: + - serviceAccountName: olm-operator-serviceaccount + rules: + - apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + - get + - apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - apiGroups: + - "operators.coreos.com" + resources: + - catalogsources + verbs: + - get + - list + - watch + - apiGroups: + - "packages.operators.coreos.com" + resources: + - packagemanifests + verbs: + - get + - list + deployments: + - name: packageserver + spec: + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 1 + maxSurge: 1 + replicas: 2 + selector: + matchLabels: + app: packageserver + template: + metadata: + labels: + app: packageserver + spec: + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + serviceAccountName: olm-operator-serviceaccount + nodeSelector: + kubernetes.io/os: linux + containers: + - name: packageserver + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: [ "ALL" ] + command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - everest-olm + image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + imagePullPolicy: Always + ports: + - containerPort: 5443 + protocol: TCP + livenessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + readinessProbe: + httpGet: + scheme: HTTPS + path: /healthz + port: 5443 + terminationMessagePolicy: FallbackToLogsOnError + resources: + requests: + cpu: 10m + memory: 50Mi + volumeMounts: + - name: tmpfs + mountPath: /tmp + volumes: + - name: tmpfs + emptyDir: {} + maturity: alpha + version: v0.27.0 + apiservicedefinitions: + owned: + - group: packages.operators.coreos.com + version: v1 + kind: PackageManifest + name: packagemanifests + displayName: PackageManifest + description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps + deploymentName: packageserver + containerPort: 5443 diff --git a/charts/everest/templates/olm/serviceaccount.yaml b/charts/everest/templates/olm/serviceaccount.yaml new file mode 100644 index 00000000..db6240c3 --- /dev/null +++ b/charts/everest/templates/olm/serviceaccount.yaml @@ -0,0 +1,6 @@ +kind: ServiceAccount +apiVersion: v1 +metadata: + name: olm-operator-serviceaccount + namespace: everest-olm + diff --git a/charts/everest/templates/operators/namespaces.yaml b/charts/everest/templates/operators/namespaces.yaml new file mode 100644 index 00000000..019f339a --- /dev/null +++ b/charts/everest/templates/operators/namespaces.yaml @@ -0,0 +1,8 @@ +{{- range $i, $ns := .Values.namespaces }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ $ns.name }} + labels: + app.kubernetes.io/managed-by: everest +{{- end }} diff --git a/charts/everest/templates/operators/operatorgroup.yaml b/charts/everest/templates/operators/operatorgroup.yaml new file mode 100644 index 00000000..b3875b19 --- /dev/null +++ b/charts/everest/templates/operators/operatorgroup.yaml @@ -0,0 +1,11 @@ +{{- range $i, $ns := .Values.namespaces }} +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: everest-monitoring + namespace: {{ $ns.name }} +spec: + targetNamespaces: + - {{ $ns.name }} + upgradeStrategy: Default +{{- end }} diff --git a/charts/everest/templates/operators/subscriptions.yaml b/charts/everest/templates/operators/subscriptions.yaml new file mode 100644 index 00000000..a2af2088 --- /dev/null +++ b/charts/everest/templates/operators/subscriptions.yaml @@ -0,0 +1,68 @@ +{{- range $i, $ns := .Values.namespaces }} +{{- if $ns.mongodb.enabled }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-server-mongodb-operator + namespace: {{ $ns.name }} +spec: + channel: {{ $ns.mongodb.channel }} + installPlanApproval: Manual + name: percona-server-mongodb-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} +--- +{{- if $ns.pxc.enabled }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-xtradb-cluster-operator + namespace: {{ $ns.name }} +spec: + channel: {{ $ns.pxc.channel }} + installPlanApproval: Manual + name: percona-xtradb-cluster-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} +--- +{{- if $ns.pg.enabled }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-postgresql-operator + namespace: {{ $ns.name }} +spec: + channel: {{ $ns.pg.channel }} + installPlanApproval: Manual + name: percona-postgresql-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} +--- +{{- end }} diff --git a/charts/everest/templates/vm-operator/namespace.yaml b/charts/everest/templates/vm-operator/namespace.yaml new file mode 100644 index 00000000..ccadbcba --- /dev/null +++ b/charts/everest/templates/vm-operator/namespace.yaml @@ -0,0 +1,6 @@ +{{- if .Values.vmOperator.enabled }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.vmOperator.namespace }} +{{- end }} diff --git a/charts/everest/templates/vm-operator/operatorgroup.yaml b/charts/everest/templates/vm-operator/operatorgroup.yaml new file mode 100644 index 00000000..a2820980 --- /dev/null +++ b/charts/everest/templates/vm-operator/operatorgroup.yaml @@ -0,0 +1,11 @@ +{{- if .Values.vmOperator.enabled }} +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: everest-monitoring + namespace: {{ .Values.vmOperator.namespace }} +spec: + targetNamespaces: + - {{ .Values.vmOperator.namespace }} + upgradeStrategy: Default +{{- end }} diff --git a/charts/everest/templates/vm-operator/subscription.yaml b/charts/everest/templates/vm-operator/subscription.yaml new file mode 100644 index 00000000..00f1adea --- /dev/null +++ b/charts/everest/templates/vm-operator/subscription.yaml @@ -0,0 +1,13 @@ +{{- if .Values.vmOperator.enabled }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: victoriametrics-operator + namespace: everest-monitoring +spec: + channel: {{ .Values.vmOperator.channel }} + installPlanApproval: Manual + name: victoriametrics-operator + source: everest-catalog + sourceNamespace: {{ .Values.olm.namespace }} +{{- end }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml new file mode 100644 index 00000000..fc708d8c --- /dev/null +++ b/charts/everest/values.yaml @@ -0,0 +1,21 @@ +image: perconalab/everest +telemetry: true +olm: + catalogSourceImage: perconalab/everest-catalog +vmOperator: + enabled: true + namespace: everest-monitoring + channel: stable-v0 +everestOperator: + channel: fast-v0 +namespaces: + - name: everest + mongodb: + enabled: true + channel: stable-v1 + pxc: + enabled: true + channel: stable-v1 + pg: + enabled: true + channel: stable-v2 From 5feedfb55a16dc6b360f1c05aa45c5fc799083a9 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 25 Sep 2024 13:41:04 +0530 Subject: [PATCH 02/64] Update README Signed-off-by: Mayank Shah --- charts/everest/README.md | 19 +++++++++++++++++++ .../templates/vm-operator/namespace.yaml | 4 +--- .../templates/vm-operator/operatorgroup.yaml | 6 ++---- .../templates/vm-operator/subscription.yaml | 4 +--- charts/everest/values.yaml | 2 -- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index e4170e32..dca38f5f 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -41,3 +41,22 @@ kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\ ```bash helm uninstall everest -n everest-system ``` + +# Configuration + +The table below lists the configurable parameters of the Everest chart and their default values. + +| Parameter | Description | Default | +|--------------------------------|-------------------------------------------------------------------------------|-------------------------| +| image | Image to use for the Everest API server | percona/everest | +| olm.catalogSourceImage | Name of the CatalogSource image that is used for installing all operators | percona/everest-catalog | +| telemetry | If set, reports Telemetry information and usage data back to Percona | true | +| vmOperator.channel | Name of the OLM bundle channel to use for installing VictoriaMetrics operator | stable-v0 | +| everestOperator.channel | Name of the OLM bundle channel to use for installing the Everest Operator | stable-v0 | +| namespaces.[*].name | Namespace where databases and database operators will be installed | | +| namespaces.[*].mongodb.enabled | If set, PSMDB operator is installed in this namespace | | +| namespaces.[*].mongodb.channel | Name of the OLM bundle channel to use for installing PSMDB operator | stable-v1 | +| namespaces.[*].pxc.enabled | If set, PXC operator is installed in this namespace | | +| namespaces.[*].pxc.channel | Name of the OLM bundle channel to use for installing PXC operator | stable-v1 | +| namespaces.[*].pg.enabled | If set, PG operator is installed in this namespace | | +| namespaces.[*].pg.channel | Name of the OLM bundle channel to use for installing PG operator | stable-v2 | diff --git a/charts/everest/templates/vm-operator/namespace.yaml b/charts/everest/templates/vm-operator/namespace.yaml index ccadbcba..fd450d39 100644 --- a/charts/everest/templates/vm-operator/namespace.yaml +++ b/charts/everest/templates/vm-operator/namespace.yaml @@ -1,6 +1,4 @@ -{{- if .Values.vmOperator.enabled }} apiVersion: v1 kind: Namespace metadata: - name: {{ .Values.vmOperator.namespace }} -{{- end }} + name: everest-monitoring diff --git a/charts/everest/templates/vm-operator/operatorgroup.yaml b/charts/everest/templates/vm-operator/operatorgroup.yaml index a2820980..d28da82c 100644 --- a/charts/everest/templates/vm-operator/operatorgroup.yaml +++ b/charts/everest/templates/vm-operator/operatorgroup.yaml @@ -1,11 +1,9 @@ -{{- if .Values.vmOperator.enabled }} apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: everest-monitoring - namespace: {{ .Values.vmOperator.namespace }} + namespace: everest-monitoring spec: targetNamespaces: - - {{ .Values.vmOperator.namespace }} + - everest-monitoring upgradeStrategy: Default -{{- end }} diff --git a/charts/everest/templates/vm-operator/subscription.yaml b/charts/everest/templates/vm-operator/subscription.yaml index 00f1adea..09c0a773 100644 --- a/charts/everest/templates/vm-operator/subscription.yaml +++ b/charts/everest/templates/vm-operator/subscription.yaml @@ -1,4 +1,3 @@ -{{- if .Values.vmOperator.enabled }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: @@ -9,5 +8,4 @@ spec: installPlanApproval: Manual name: victoriametrics-operator source: everest-catalog - sourceNamespace: {{ .Values.olm.namespace }} -{{- end }} + sourceNamespace: everest-olm diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index fc708d8c..18fd55ff 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -3,8 +3,6 @@ telemetry: true olm: catalogSourceImage: perconalab/everest-catalog vmOperator: - enabled: true - namespace: everest-monitoring channel: stable-v0 everestOperator: channel: fast-v0 From 3cc9105181148e4620e34161f5ca0ab3227b0419 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 25 Sep 2024 14:16:25 +0530 Subject: [PATCH 03/64] Skip automated release for everest Signed-off-by: Mayank Shah --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ea41e878..b02d521d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,6 +4,7 @@ on: push: path-ignore: - 'charts/gcp-marketplace/**' + - 'charts/everest/**' branches: - main From d7767793d76bddb96b722b17472f84739449b171 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 25 Sep 2024 17:55:50 +0530 Subject: [PATCH 04/64] Refinements Signed-off-by: Mayank Shah --- .../everest-operator/subscription.yaml | 4 +-- .../hooks/installplan-approver/job.yaml | 26 ++----------------- .../hooks/installplan-approver/rbac.yaml | 20 +++++++++++--- .../installplan-approver/serviceaccount.yaml | 2 +- .../templates/hooks/uninstall/job.yaml | 19 ++------------ .../templates/operators/subscriptions.yaml | 6 ++--- 6 files changed, 27 insertions(+), 50 deletions(-) diff --git a/charts/everest/templates/everest-operator/subscription.yaml b/charts/everest/templates/everest-operator/subscription.yaml index d8f111e9..8fb41b80 100644 --- a/charts/everest/templates/everest-operator/subscription.yaml +++ b/charts/everest/templates/everest-operator/subscription.yaml @@ -8,7 +8,7 @@ spec: installPlanApproval: Manual name: everest-operator source: everest-catalog - sourceNamespace: {{ .Values.olm.namespace }} + sourceNamespace: everest-olm {{- if ne .Values.everestOperator.version "" }} startingCSV: everest-operator.v{{ .Chart.Version }} {{- end }} @@ -21,7 +21,7 @@ spec: value: "false" {{- end }} - name: MONITORING_NAMESPACE - value: {{ .Values.vmOperator.namespace }} + value: everest-monitoring - name: DB_NAMESPACES value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }} diff --git a/charts/everest/templates/hooks/installplan-approver/job.yaml b/charts/everest/templates/hooks/installplan-approver/job.yaml index aa7d1a95..0c5dfe99 100644 --- a/charts/everest/templates/hooks/installplan-approver/job.yaml +++ b/charts/everest/templates/hooks/installplan-approver/job.yaml @@ -9,33 +9,11 @@ spec: template: spec: containers: - - image: bitnami/kubectl:latest + - image: {{ .Values.image }} command: - - /bin/bash - - -c - - | - echo "Sleep for sometime to wait for all the resources to be created..." - sleep 120 - for ns in $(echo $NAMESPACES | sed "s/,/ /g") - do - echo "Approving InstallPlans in namespace $ns" - for subscription in `kubectl -n $ns get subscriptions -o jsonpath='{.items[*].metadata.name}'` - do - echo "Processing subscription $subscription" - installplan=$(kubectl -n $ns get subscriptions $subscription -o jsonpath='{.status.installPlanRef.name}') - if [ "`kubectl -n $ns get installplan $installplan -o jsonpath="{.spec.approved}"`" == "false" ]; then - echo "Approving Subscription $subscription with install plan $installplan" - kubectl -n $ns patch installplan $installplan --type=json -p='[{"op":"replace","path": "/spec/approved", "value": true}]' - else - echo "Install Plan '$installplan' already approved" - fi - done - done + - ./helm-tools/installplan-approver imagePullPolicy: Always name: installplan-approver - env: - - name: NAMESPACES - value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }},{{ .Release.Namespace }},{{ .Values.vmOperator.namespace }} dnsPolicy: ClusterFirst restartPolicy: OnFailure serviceAccount: everest-installer diff --git a/charts/everest/templates/hooks/installplan-approver/rbac.yaml b/charts/everest/templates/hooks/installplan-approver/rbac.yaml index e5f21e49..f26f6f6c 100644 --- a/charts/everest/templates/hooks/installplan-approver/rbac.yaml +++ b/charts/everest/templates/hooks/installplan-approver/rbac.yaml @@ -2,23 +2,37 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: everest-installer + name: everest-installplan-approver-hook namespace: {{ .Release.Namespace }} rules: - apiGroups: - operators.coreos.com resources: - installplans + verbs: + - get + - list + - update + - apiGroups: + - operators.coreos.com + resources: - subscriptions + - clusterserviceversions + verbs: + - get + - list + - apiGroups: + - "" + resources: + - namespaces verbs: - get - list - - patch --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: everest-installer + name: everest-installplan-approver-hook roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml b/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml index f894cf8f..965ce940 100644 --- a/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml +++ b/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: everest-installer + name: everest-installplan-approver-hook namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/uninstall/job.yaml b/charts/everest/templates/hooks/uninstall/job.yaml index ef9ab95a..3076aaf2 100644 --- a/charts/everest/templates/hooks/uninstall/job.yaml +++ b/charts/everest/templates/hooks/uninstall/job.yaml @@ -9,24 +9,9 @@ spec: template: spec: containers: - - image: bitnami/kubectl:latest + - image: {{ .Values.image }} command: - - /bin/bash - - -c - - | - # For each DB namespace - for ns in $(echo $NAMESPACES | sed "s/,/ /g") - do - # List DBs in this namespace - dbs=$(kubectl get db -n ${ns} -o=jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\n"}{end}') - for db in $dbs; do - kubectl delete db $db -n $ns --wait - done - kubectl delete -n ${ns} csv --all --wait - done - echo "Deleted databases" - - kubectl delete csv packageserver -n {{ .Values.olm.namespace }} --wait + - ./helm-tools/uninstall imagePullPolicy: Always name: uninstaller env: diff --git a/charts/everest/templates/operators/subscriptions.yaml b/charts/everest/templates/operators/subscriptions.yaml index a2af2088..3c6db856 100644 --- a/charts/everest/templates/operators/subscriptions.yaml +++ b/charts/everest/templates/operators/subscriptions.yaml @@ -10,7 +10,7 @@ spec: installPlanApproval: Manual name: percona-server-mongodb-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: everest-olm config: env: - name: DISABLE_TELEMETRY @@ -32,7 +32,7 @@ spec: installPlanApproval: Manual name: percona-xtradb-cluster-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: everest-olm config: env: - name: DISABLE_TELEMETRY @@ -54,7 +54,7 @@ spec: installPlanApproval: Manual name: percona-postgresql-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: everest-olm config: env: - name: DISABLE_TELEMETRY From a64b82e5c91f84f8c6dd17fd26b7260c89a68acf Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 26 Sep 2024 13:12:24 +0530 Subject: [PATCH 05/64] More fixes Signed-off-by: Mayank Shah --- charts/everest/NOTES.txt | 11 +++++++++ charts/everest/README.md | 4 +++- .../hooks/installplan-approver/job.yaml | 21 ---------------- .../templates/hooks/post-install/job.yaml | 21 ++++++++++++++++ .../rbac.yaml | 8 +++---- .../serviceaccount.yaml | 2 +- .../templates/hooks/pre-delete/job.yaml | 21 ++++++++++++++++ .../hooks/{uninstall => pre-delete}/rbac.yaml | 15 ++++++++---- .../serviceaccount.yaml | 2 +- .../templates/hooks/uninstall/job.yaml | 24 ------------------- .../templates/operators/namespaces.yaml | 2 +- 11 files changed, 74 insertions(+), 57 deletions(-) create mode 100644 charts/everest/NOTES.txt delete mode 100644 charts/everest/templates/hooks/installplan-approver/job.yaml create mode 100644 charts/everest/templates/hooks/post-install/job.yaml rename charts/everest/templates/hooks/{installplan-approver => post-install}/rbac.yaml (81%) rename charts/everest/templates/hooks/{installplan-approver => post-install}/serviceaccount.yaml (66%) create mode 100644 charts/everest/templates/hooks/pre-delete/job.yaml rename charts/everest/templates/hooks/{uninstall => pre-delete}/rbac.yaml (69%) rename charts/everest/templates/hooks/{uninstall => pre-delete}/serviceaccount.yaml (69%) delete mode 100644 charts/everest/templates/hooks/uninstall/job.yaml diff --git a/charts/everest/NOTES.txt b/charts/everest/NOTES.txt new file mode 100644 index 00000000..5defda6a --- /dev/null +++ b/charts/everest/NOTES.txt @@ -0,0 +1,11 @@ +Thank you for installing Everest! + +To get started, simply port-forward to the Everest API server: + +kubectl port-forward svc/everest 8080:8080 -n everest-system + +Then, open your browser to http://localhost:8080 to access the Everest dashboard. + +To retrieve the initial admin password, run the following command: + +kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' diff --git a/charts/everest/README.md b/charts/everest/README.md index dca38f5f..1b57787d 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -15,12 +15,14 @@ Useful links: ## Installation -Install Percona Everest to the `everest-system` namespace: +Install Percona Everest in the `everest-system` namespace: ```bash helm repo add percona https://percona.github.io/percona-helm-charts/ helm install everest percona/everest --version 1.1.1 --namespace everest-system --create-namespace ``` +> NOTE: Installing in any namespace other than `everest-system` can cause the installation to fail. + This command may take a couple of minutes to complete. Upon completion, you should see the following output: ```bash NAME: everest diff --git a/charts/everest/templates/hooks/installplan-approver/job.yaml b/charts/everest/templates/hooks/installplan-approver/job.yaml deleted file mode 100644 index 0c5dfe99..00000000 --- a/charts/everest/templates/hooks/installplan-approver/job.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: installplan-approver - namespace: {{ .Release.Namespace }} - annotations: - "helm.sh/hook": post-install,post-upgrade -spec: - template: - spec: - containers: - - image: {{ .Values.image }} - command: - - ./helm-tools/installplan-approver - imagePullPolicy: Always - name: installplan-approver - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - serviceAccount: everest-installer - serviceAccountName: everest-installer - terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/post-install/job.yaml b/charts/everest/templates/hooks/post-install/job.yaml new file mode 100644 index 00000000..0753a2b9 --- /dev/null +++ b/charts/everest/templates/hooks/post-install/job.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: everest-helm-post-install-hook + namespace: {{ .Release.Namespace }} + annotations: + "helm.sh/hook": post-install,post-upgrade +spec: + template: + spec: + containers: + - image: docker.io/mayankshah1607/everest-helm-tools:test-4 + command: ["/everest-helm-tools"] + args: ["run-hook", "post-install"] + imagePullPolicy: Always + name: hook-runner + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: everest-helm-post-install-hook + serviceAccountName: everest-helm-post-install-hook + terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/installplan-approver/rbac.yaml b/charts/everest/templates/hooks/post-install/rbac.yaml similarity index 81% rename from charts/everest/templates/hooks/installplan-approver/rbac.yaml rename to charts/everest/templates/hooks/post-install/rbac.yaml index f26f6f6c..584ec98a 100644 --- a/charts/everest/templates/hooks/installplan-approver/rbac.yaml +++ b/charts/everest/templates/hooks/post-install/rbac.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: everest-installplan-approver-hook + name: everest-helm-post-install-hook namespace: {{ .Release.Namespace }} rules: - apiGroups: @@ -32,12 +32,12 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: everest-installplan-approver-hook + name: everest-helm-post-install-hook roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: everest-installer + name: everest-helm-post-install-hook subjects: - kind: ServiceAccount - name: everest-installer + name: everest-helm-post-install-hook namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml b/charts/everest/templates/hooks/post-install/serviceaccount.yaml similarity index 66% rename from charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml rename to charts/everest/templates/hooks/post-install/serviceaccount.yaml index 965ce940..5cd648d1 100644 --- a/charts/everest/templates/hooks/installplan-approver/serviceaccount.yaml +++ b/charts/everest/templates/hooks/post-install/serviceaccount.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: everest-installplan-approver-hook + name: everest-helm-post-install-hook namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/pre-delete/job.yaml b/charts/everest/templates/hooks/pre-delete/job.yaml new file mode 100644 index 00000000..7060a1e2 --- /dev/null +++ b/charts/everest/templates/hooks/pre-delete/job.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: everest-helm-pre-delete-hook + namespace: {{ .Release.Namespace }} + annotations: + "helm.sh/hook": pre-delete +spec: + template: + spec: + containers: + - image: docker.io/mayankshah1607/everest-helm-tools:test-4 + command: ["/everest-helm-tools"] + args: ["run-hook", "pre-delete"] + imagePullPolicy: Always + name: hook-runner + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: everest-helm-pre-delete-hook + serviceAccountName: everest-helm-pre-delete-hook + terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/uninstall/rbac.yaml b/charts/everest/templates/hooks/pre-delete/rbac.yaml similarity index 69% rename from charts/everest/templates/hooks/uninstall/rbac.yaml rename to charts/everest/templates/hooks/pre-delete/rbac.yaml index 2d05f9ce..b905eadc 100644 --- a/charts/everest/templates/hooks/uninstall/rbac.yaml +++ b/charts/everest/templates/hooks/pre-delete/rbac.yaml @@ -2,8 +2,15 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: everest-uninstaller + name: everest-helm-pre-delete-hook rules: + - apiGroups: + - "" + resources: + - namespaces + verbs: + - list + - get - apiGroups: - operators.coreos.com resources: @@ -23,12 +30,12 @@ rules: apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: everest-uninstaller + name: everest-helm-pre-delete-hook roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole - name: everest-uninstaller + name: everest-helm-pre-delete-hook subjects: - kind: ServiceAccount - name: everest-uninstaller + name: everest-helm-pre-delete-hook namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/uninstall/serviceaccount.yaml b/charts/everest/templates/hooks/pre-delete/serviceaccount.yaml similarity index 69% rename from charts/everest/templates/hooks/uninstall/serviceaccount.yaml rename to charts/everest/templates/hooks/pre-delete/serviceaccount.yaml index b8fa9eb1..41e51489 100644 --- a/charts/everest/templates/hooks/uninstall/serviceaccount.yaml +++ b/charts/everest/templates/hooks/pre-delete/serviceaccount.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: everest-uninstaller + name: everest-helm-pre-delete-hook namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/uninstall/job.yaml b/charts/everest/templates/hooks/uninstall/job.yaml deleted file mode 100644 index 3076aaf2..00000000 --- a/charts/everest/templates/hooks/uninstall/job.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: uninstall - namespace: {{ .Release.Namespace }} - annotations: - "helm.sh/hook": pre-delete -spec: - template: - spec: - containers: - - image: {{ .Values.image }} - command: - - ./helm-tools/uninstall - imagePullPolicy: Always - name: uninstaller - env: - - name: NAMESPACES - value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }},{{ .Release.Namespace }},{{ .Values.vmOperator.namespace }} - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - serviceAccount: everest-uninstaller - serviceAccountName: everest-uninstaller - terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/operators/namespaces.yaml b/charts/everest/templates/operators/namespaces.yaml index 019f339a..c658fdcd 100644 --- a/charts/everest/templates/operators/namespaces.yaml +++ b/charts/everest/templates/operators/namespaces.yaml @@ -4,5 +4,5 @@ kind: Namespace metadata: name: {{ $ns.name }} labels: - app.kubernetes.io/managed-by: everest + everest.percona.com/db-namespac: "" {{- end }} From de8e7051d66ea69f223265b375c740a126bfa4aa Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Fri, 27 Sep 2024 17:37:59 +0530 Subject: [PATCH 06/64] More changes Signed-off-by: Mayank Shah --- charts/everest/NOTES.txt | 11 ----------- charts/everest/templates/NOTES.txt | 16 ++++++++++++++++ .../templates/everest-server/secrets.yaml | 2 ++ .../templates/hooks/post-install/job.yaml | 8 ++++++-- .../everest/templates/hooks/pre-delete/job.yaml | 3 ++- .../everest/templates/hooks/pre-delete/rbac.yaml | 2 ++ .../everest/templates/operators/namespaces.yaml | 3 ++- .../templates/operators/operatorgroup.yaml | 1 + .../templates/operators/subscriptions.yaml | 8 ++++---- 9 files changed, 35 insertions(+), 19 deletions(-) delete mode 100644 charts/everest/NOTES.txt diff --git a/charts/everest/NOTES.txt b/charts/everest/NOTES.txt deleted file mode 100644 index 5defda6a..00000000 --- a/charts/everest/NOTES.txt +++ /dev/null @@ -1,11 +0,0 @@ -Thank you for installing Everest! - -To get started, simply port-forward to the Everest API server: - -kubectl port-forward svc/everest 8080:8080 -n everest-system - -Then, open your browser to http://localhost:8080 to access the Everest dashboard. - -To retrieve the initial admin password, run the following command: - -kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' diff --git a/charts/everest/templates/NOTES.txt b/charts/everest/templates/NOTES.txt index e69de29b..fd947dac 100644 --- a/charts/everest/templates/NOTES.txt +++ b/charts/everest/templates/NOTES.txt @@ -0,0 +1,16 @@ +{{ if .Release.IsInstall }} +Thank you for installing Everest! + +To get started, simply port-forward to the Everest API server: + +kubectl port-forward svc/everest 8080:8080 -n everest-system + +Then, open your browser to http://localhost:8080 to access the Everest dashboard. + +To retrieve the initial admin password, run the following command: + +kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' +{{ end }} +{{ if .Release.IsUpgrade }} +Everest has been successfully upgraded to version {{ .Chart.AppVersion }}! +{{ end }} diff --git a/charts/everest/templates/everest-server/secrets.yaml b/charts/everest/templates/everest-server/secrets.yaml index 509bb597..fb9727da 100644 --- a/charts/everest/templates/everest-server/secrets.yaml +++ b/charts/everest/templates/everest-server/secrets.yaml @@ -1,3 +1,4 @@ +{{- if .Release.IsInstall }} apiVersion: v1 kind: Secret metadata: @@ -15,3 +16,4 @@ metadata: insecure-password/admin: "true" data: users.yaml: {{ tpl (.Files.Get "everest-admin.yaml") . | b64enc }} +{{- end }} diff --git a/charts/everest/templates/hooks/post-install/job.yaml b/charts/everest/templates/hooks/post-install/job.yaml index 0753a2b9..0a206781 100644 --- a/charts/everest/templates/hooks/post-install/job.yaml +++ b/charts/everest/templates/hooks/post-install/job.yaml @@ -9,9 +9,12 @@ spec: template: spec: containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-4 + - image: docker.io/mayankshah1607/everest-helm-tools:test-7 command: ["/everest-helm-tools"] - args: ["run-hook", "post-install"] + args: + - run-hook + - post-install + - --version={{ .Chart.AppVersion }} imagePullPolicy: Always name: hook-runner dnsPolicy: ClusterFirst @@ -19,3 +22,4 @@ spec: serviceAccount: everest-helm-post-install-hook serviceAccountName: everest-helm-post-install-hook terminationGracePeriodSeconds: 30 + ttlSecondsAfterFinished: 60 diff --git a/charts/everest/templates/hooks/pre-delete/job.yaml b/charts/everest/templates/hooks/pre-delete/job.yaml index 7060a1e2..5d0d75d4 100644 --- a/charts/everest/templates/hooks/pre-delete/job.yaml +++ b/charts/everest/templates/hooks/pre-delete/job.yaml @@ -9,7 +9,7 @@ spec: template: spec: containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-4 + - image: docker.io/mayankshah1607/everest-helm-tools:test-7 command: ["/everest-helm-tools"] args: ["run-hook", "pre-delete"] imagePullPolicy: Always @@ -19,3 +19,4 @@ spec: serviceAccount: everest-helm-pre-delete-hook serviceAccountName: everest-helm-pre-delete-hook terminationGracePeriodSeconds: 30 + ttlSecondsAfterFinished: 60 diff --git a/charts/everest/templates/hooks/pre-delete/rbac.yaml b/charts/everest/templates/hooks/pre-delete/rbac.yaml index b905eadc..30454c26 100644 --- a/charts/everest/templates/hooks/pre-delete/rbac.yaml +++ b/charts/everest/templates/hooks/pre-delete/rbac.yaml @@ -22,6 +22,8 @@ rules: - everest.percona.com resources: - databaseclusters + - backupstorages + - monitoringinstances verbs: - get - list diff --git a/charts/everest/templates/operators/namespaces.yaml b/charts/everest/templates/operators/namespaces.yaml index c658fdcd..4518554a 100644 --- a/charts/everest/templates/operators/namespaces.yaml +++ b/charts/everest/templates/operators/namespaces.yaml @@ -1,8 +1,9 @@ {{- range $i, $ns := .Values.namespaces }} +--- apiVersion: v1 kind: Namespace metadata: name: {{ $ns.name }} labels: - everest.percona.com/db-namespac: "" + everest.percona.com/db-namespace: "" {{- end }} diff --git a/charts/everest/templates/operators/operatorgroup.yaml b/charts/everest/templates/operators/operatorgroup.yaml index b3875b19..f1faf0c3 100644 --- a/charts/everest/templates/operators/operatorgroup.yaml +++ b/charts/everest/templates/operators/operatorgroup.yaml @@ -1,4 +1,5 @@ {{- range $i, $ns := .Values.namespaces }} +--- apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: diff --git a/charts/everest/templates/operators/subscriptions.yaml b/charts/everest/templates/operators/subscriptions.yaml index 3c6db856..715df8b5 100644 --- a/charts/everest/templates/operators/subscriptions.yaml +++ b/charts/everest/templates/operators/subscriptions.yaml @@ -1,5 +1,6 @@ {{- range $i, $ns := .Values.namespaces }} -{{- if $ns.mongodb.enabled }} +{{- if (and $ns.mongodb $ns.mongodb.enabled) }} +--- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: @@ -20,8 +21,8 @@ spec: value: "false" {{- end }} {{- end }} +{{- if (and $ns.pxc $ns.pxc.enabled) }} --- -{{- if $ns.pxc.enabled }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: @@ -42,8 +43,8 @@ spec: value: "false" {{- end }} {{- end }} +{{- if (and $ns.pg $ns.pg.enabled) }} --- -{{- if $ns.pg.enabled }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: @@ -64,5 +65,4 @@ spec: value: "false" {{- end }} {{- end }} ---- {{- end }} From 2c5d2c228e99fdbbc93013681d0da24558b8ca2a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Sun, 29 Sep 2024 00:27:48 +0530 Subject: [PATCH 07/64] Refactor using subcharts Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 17 +++ charts/everest/charts/db-namespace/Chart.yaml | 6 + .../db-namespace/templates/operatorgroup.yaml | 9 ++ .../templates}/subscriptions.yaml | 20 ++- .../everest/charts/db-namespace/values.yaml | 6 + .../charts/everest-monitoring/Chart.yaml | 8 + .../templates}/namespace.yaml | 2 +- .../templates}/operatorgroup.yaml | 0 .../templates}/subscription.yaml | 2 +- .../charts/everest-monitoring/values.yaml | 1 + charts/everest/charts/olm/Chart.yaml | 7 + charts/everest/{ => charts/olm}/crds/olm.yaml | 0 .../catalog-operator.deployment.yaml | 2 +- .../olm/templates}/clusterrole.yaml | 0 .../olm/templates}/clusterrolebinding.yaml | 0 .../olm/templates}/everest-catalogsource.yaml | 4 +- .../charts/olm/templates/namespace.yaml | 4 + .../templates}/olm-operator.deployment.yaml | 4 +- .../olm/templates}/olmconfig.yaml | 0 .../olm/templates}/operatorgroup.yaml | 2 +- .../templates/packageserver.apiservice.yaml | 31 ++++ .../templates/packageserver.deployment.yaml | 110 ++++++++++++++ .../olm/templates/packageserver.rbac.yaml | 46 ++++++ .../olm/templates/packageserver.service.yaml | 15 ++ .../olm/templates}/serviceaccount.yaml | 2 +- charts/everest/charts/olm/values.yaml | 6 + ...rest-admin.yaml => everest-admin.yaml.tpl} | 0 .../templates/hooks/post-install/job.yaml | 4 +- .../templates/hooks/pre-delete/job.yaml | 4 +- .../templates/hooks/pre-delete/rbac.yaml | 3 +- charts/everest/templates/olm/namespace.yaml | 11 -- .../templates/olm/packageserver.csv.yaml | 140 ------------------ .../operatorgroup.yaml | 0 .../subscription.yaml | 2 +- .../templates/operators/namespaces.yaml | 9 -- .../templates/operators/operatorgroup.yaml | 12 -- .../clusterrole.yaml | 0 .../clusterrolebinding.yaml | 0 .../configmaps.yaml | 0 .../deployment.yaml | 0 .../{everest-server => server}/role.yaml | 0 .../rolebinding.yaml | 0 .../{everest-server => server}/secrets.yaml | 2 +- .../{everest-server => server}/service.yaml | 0 .../serviceaccount.yaml | 0 charts/everest/values.yaml | 25 ++-- 46 files changed, 304 insertions(+), 212 deletions(-) create mode 100644 charts/everest/charts/db-namespace/Chart.yaml create mode 100644 charts/everest/charts/db-namespace/templates/operatorgroup.yaml rename charts/everest/{templates/operators => charts/db-namespace/templates}/subscriptions.yaml (77%) create mode 100644 charts/everest/charts/db-namespace/values.yaml create mode 100644 charts/everest/charts/everest-monitoring/Chart.yaml rename charts/everest/{templates/vm-operator => charts/everest-monitoring/templates}/namespace.yaml (58%) rename charts/everest/{templates/vm-operator => charts/everest-monitoring/templates}/operatorgroup.yaml (100%) rename charts/everest/{templates/vm-operator => charts/everest-monitoring/templates}/subscription.yaml (85%) create mode 100644 charts/everest/charts/everest-monitoring/values.yaml create mode 100644 charts/everest/charts/olm/Chart.yaml rename charts/everest/{ => charts/olm}/crds/olm.yaml (100%) rename charts/everest/{templates/olm => charts/olm/templates}/catalog-operator.deployment.yaml (97%) rename charts/everest/{templates/olm => charts/olm/templates}/clusterrole.yaml (100%) rename charts/everest/{templates/olm => charts/olm/templates}/clusterrolebinding.yaml (100%) rename charts/everest/{templates/olm => charts/olm/templates}/everest-catalogsource.yaml (70%) create mode 100644 charts/everest/charts/olm/templates/namespace.yaml rename charts/everest/{templates/olm => charts/olm/templates}/olm-operator.deployment.yaml (91%) rename charts/everest/{templates/olm => charts/olm/templates}/olmconfig.yaml (100%) rename charts/everest/{templates/olm => charts/olm/templates}/operatorgroup.yaml (78%) create mode 100644 charts/everest/charts/olm/templates/packageserver.apiservice.yaml create mode 100644 charts/everest/charts/olm/templates/packageserver.deployment.yaml create mode 100644 charts/everest/charts/olm/templates/packageserver.rbac.yaml create mode 100644 charts/everest/charts/olm/templates/packageserver.service.yaml rename charts/everest/{templates/olm => charts/olm/templates}/serviceaccount.yaml (69%) create mode 100644 charts/everest/charts/olm/values.yaml rename charts/everest/{everest-admin.yaml => everest-admin.yaml.tpl} (100%) delete mode 100644 charts/everest/templates/olm/namespace.yaml delete mode 100644 charts/everest/templates/olm/packageserver.csv.yaml rename charts/everest/templates/{everest-operator => operator}/operatorgroup.yaml (100%) rename charts/everest/templates/{everest-operator => operator}/subscription.yaml (86%) delete mode 100644 charts/everest/templates/operators/namespaces.yaml delete mode 100644 charts/everest/templates/operators/operatorgroup.yaml rename charts/everest/templates/{everest-server => server}/clusterrole.yaml (100%) rename charts/everest/templates/{everest-server => server}/clusterrolebinding.yaml (100%) rename charts/everest/templates/{everest-server => server}/configmaps.yaml (100%) rename charts/everest/templates/{everest-server => server}/deployment.yaml (100%) rename charts/everest/templates/{everest-server => server}/role.yaml (100%) rename charts/everest/templates/{everest-server => server}/rolebinding.yaml (100%) rename charts/everest/templates/{everest-server => server}/secrets.yaml (82%) rename charts/everest/templates/{everest-server => server}/service.yaml (100%) rename charts/everest/templates/{everest-server => server}/serviceaccount.yaml (100%) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 02208c0d..00af6fb0 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -6,3 +6,20 @@ version: 0.0.0 appVersion: 0.0.0 type: application kubeVersion: ">=1.27.0-0" + +dependencies: + # While this isn't really a dependency for the chart, we still specify it + # here so that we're able to conditionally disable rendering the DB namespace manifests. + - name: db-namespace + version: "0.0.1" + repository: "file://charts/" + condition: db-namespace.enabled + - name: olm + version: "0.0.1" + repository: "file://charts/" + condition: olm.enabled + - name: everest-monitoring + version: "0.0.1" + repository: "file://charts/" + condition: monitoring.enabled + diff --git a/charts/everest/charts/db-namespace/Chart.yaml b/charts/everest/charts/db-namespace/Chart.yaml new file mode 100644 index 00000000..f3512a59 --- /dev/null +++ b/charts/everest/charts/db-namespace/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: db-namespace +description: This subchart is used for deploying the Percona Operators for Everest. +type: application +version: 0.0.1 +appVersion: 0.0.1 diff --git a/charts/everest/charts/db-namespace/templates/operatorgroup.yaml b/charts/everest/charts/db-namespace/templates/operatorgroup.yaml new file mode 100644 index 00000000..2136e7a3 --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/operatorgroup.yaml @@ -0,0 +1,9 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: everest-databases + namespace: {{ .Release.Namespace }} +spec: + targetNamespaces: + - {{ .Release.Namespace }} + upgradeStrategy: Default diff --git a/charts/everest/templates/operators/subscriptions.yaml b/charts/everest/charts/db-namespace/templates/subscriptions.yaml similarity index 77% rename from charts/everest/templates/operators/subscriptions.yaml rename to charts/everest/charts/db-namespace/templates/subscriptions.yaml index 715df8b5..48a822bb 100644 --- a/charts/everest/templates/operators/subscriptions.yaml +++ b/charts/everest/charts/db-namespace/templates/subscriptions.yaml @@ -1,13 +1,12 @@ -{{- range $i, $ns := .Values.namespaces }} -{{- if (and $ns.mongodb $ns.mongodb.enabled) }} +{{- if .Values.mongodb.enabled }} --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-server-mongodb-operator - namespace: {{ $ns.name }} + namespace: {{ .Release.Namespace }} spec: - channel: {{ $ns.mongodb.channel }} + channel: stable-v1 installPlanApproval: Manual name: percona-server-mongodb-operator source: everest-catalog @@ -21,15 +20,15 @@ spec: value: "false" {{- end }} {{- end }} -{{- if (and $ns.pxc $ns.pxc.enabled) }} +{{- if .Values.pxc.enabled }} --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-xtradb-cluster-operator - namespace: {{ $ns.name }} + namespace: {{ .Release.Namespace }} spec: - channel: {{ $ns.pxc.channel }} + channel: stable-v1 installPlanApproval: Manual name: percona-xtradb-cluster-operator source: everest-catalog @@ -43,15 +42,15 @@ spec: value: "false" {{- end }} {{- end }} -{{- if (and $ns.pg $ns.pg.enabled) }} +{{- if .Values.pg.enabled }} --- apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-postgresql-operator - namespace: {{ $ns.name }} + namespace: {{ .Release.Namespace }} spec: - channel: {{ $ns.pg.channel }} + channel: stable-v2 installPlanApproval: Manual name: percona-postgresql-operator source: everest-catalog @@ -65,4 +64,3 @@ spec: value: "false" {{- end }} {{- end }} -{{- end }} diff --git a/charts/everest/charts/db-namespace/values.yaml b/charts/everest/charts/db-namespace/values.yaml new file mode 100644 index 00000000..7d3775b2 --- /dev/null +++ b/charts/everest/charts/db-namespace/values.yaml @@ -0,0 +1,6 @@ +mongodb: + enabled: true +pxc: + enabled: true +pg: + enabled: true diff --git a/charts/everest/charts/everest-monitoring/Chart.yaml b/charts/everest/charts/everest-monitoring/Chart.yaml new file mode 100644 index 00000000..a7f29cf7 --- /dev/null +++ b/charts/everest/charts/everest-monitoring/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: everest-monitoring +description: | + This subchart is used for deploying the monitoring stack for Percona Everest. + Not meant to be used as a standalone chart. +type: application +version: 0.0.1 +appVersion: 0.0.1 diff --git a/charts/everest/templates/vm-operator/namespace.yaml b/charts/everest/charts/everest-monitoring/templates/namespace.yaml similarity index 58% rename from charts/everest/templates/vm-operator/namespace.yaml rename to charts/everest/charts/everest-monitoring/templates/namespace.yaml index fd450d39..1296147c 100644 --- a/charts/everest/templates/vm-operator/namespace.yaml +++ b/charts/everest/charts/everest-monitoring/templates/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: everest-monitoring + name: everest-monitoring diff --git a/charts/everest/templates/vm-operator/operatorgroup.yaml b/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml similarity index 100% rename from charts/everest/templates/vm-operator/operatorgroup.yaml rename to charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml diff --git a/charts/everest/templates/vm-operator/subscription.yaml b/charts/everest/charts/everest-monitoring/templates/subscription.yaml similarity index 85% rename from charts/everest/templates/vm-operator/subscription.yaml rename to charts/everest/charts/everest-monitoring/templates/subscription.yaml index 09c0a773..7c25ca43 100644 --- a/charts/everest/templates/vm-operator/subscription.yaml +++ b/charts/everest/charts/everest-monitoring/templates/subscription.yaml @@ -4,7 +4,7 @@ metadata: name: victoriametrics-operator namespace: everest-monitoring spec: - channel: {{ .Values.vmOperator.channel }} + channel: {{ .Values.channel }} installPlanApproval: Manual name: victoriametrics-operator source: everest-catalog diff --git a/charts/everest/charts/everest-monitoring/values.yaml b/charts/everest/charts/everest-monitoring/values.yaml new file mode 100644 index 00000000..a1bc6dc6 --- /dev/null +++ b/charts/everest/charts/everest-monitoring/values.yaml @@ -0,0 +1 @@ +channel: stable-v0 diff --git a/charts/everest/charts/olm/Chart.yaml b/charts/everest/charts/olm/Chart.yaml new file mode 100644 index 00000000..911c7b49 --- /dev/null +++ b/charts/everest/charts/olm/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: olm +description: This subchart is used for deploying OLM for Percona Everest. +type: application +version: 0.0.1 +appVersion: 0.0.1 + diff --git a/charts/everest/crds/olm.yaml b/charts/everest/charts/olm/crds/olm.yaml similarity index 100% rename from charts/everest/crds/olm.yaml rename to charts/everest/charts/olm/crds/olm.yaml diff --git a/charts/everest/templates/olm/catalog-operator.deployment.yaml b/charts/everest/charts/olm/templates/catalog-operator.deployment.yaml similarity index 97% rename from charts/everest/templates/olm/catalog-operator.deployment.yaml rename to charts/everest/charts/olm/templates/catalog-operator.deployment.yaml index 712ed4b1..e60527de 100644 --- a/charts/everest/templates/olm/catalog-operator.deployment.yaml +++ b/charts/everest/charts/olm/templates/catalog-operator.deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: catalog-operator - namespace: everest-olm + namespace: {{ .Values.namespace }} labels: app: catalog-operator spec: diff --git a/charts/everest/templates/olm/clusterrole.yaml b/charts/everest/charts/olm/templates/clusterrole.yaml similarity index 100% rename from charts/everest/templates/olm/clusterrole.yaml rename to charts/everest/charts/olm/templates/clusterrole.yaml diff --git a/charts/everest/templates/olm/clusterrolebinding.yaml b/charts/everest/charts/olm/templates/clusterrolebinding.yaml similarity index 100% rename from charts/everest/templates/olm/clusterrolebinding.yaml rename to charts/everest/charts/olm/templates/clusterrolebinding.yaml diff --git a/charts/everest/templates/olm/everest-catalogsource.yaml b/charts/everest/charts/olm/templates/everest-catalogsource.yaml similarity index 70% rename from charts/everest/templates/olm/everest-catalogsource.yaml rename to charts/everest/charts/olm/templates/everest-catalogsource.yaml index eae195e8..8289d321 100644 --- a/charts/everest/templates/olm/everest-catalogsource.yaml +++ b/charts/everest/charts/olm/templates/everest-catalogsource.yaml @@ -2,12 +2,12 @@ apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: everest-catalog - namespace: everest-olm + namespace: {{ .Values.namespace }} spec: displayName: Everest Catalog grpcPodConfig: securityContextConfig: restricted - image: {{ .Values.olm.catalogSourceImage }}:{{ .Chart.Version }} + image: {{ .Values.everest.catalogSourceImage }}:{{ .Values.everest.version }} publisher: Percona sourceType: grpc updateStrategy: diff --git a/charts/everest/charts/olm/templates/namespace.yaml b/charts/everest/charts/olm/templates/namespace.yaml new file mode 100644 index 00000000..0072c6d9 --- /dev/null +++ b/charts/everest/charts/olm/templates/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.namespace }} diff --git a/charts/everest/templates/olm/olm-operator.deployment.yaml b/charts/everest/charts/olm/templates/olm-operator.deployment.yaml similarity index 91% rename from charts/everest/templates/olm/olm-operator.deployment.yaml rename to charts/everest/charts/olm/templates/olm-operator.deployment.yaml index 8703f3ee..a679d9df 100644 --- a/charts/everest/templates/olm/olm-operator.deployment.yaml +++ b/charts/everest/charts/olm/templates/olm-operator.deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: olm-operator - namespace: everest-olm + namespace: {{ .Values.namespace }} labels: app: olm-operator spec: @@ -35,7 +35,7 @@ spec: - $(OPERATOR_NAMESPACE) - --writeStatusName - "" - image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + image: {{ .Values.image }} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 diff --git a/charts/everest/templates/olm/olmconfig.yaml b/charts/everest/charts/olm/templates/olmconfig.yaml similarity index 100% rename from charts/everest/templates/olm/olmconfig.yaml rename to charts/everest/charts/olm/templates/olmconfig.yaml diff --git a/charts/everest/templates/olm/operatorgroup.yaml b/charts/everest/charts/olm/templates/operatorgroup.yaml similarity index 78% rename from charts/everest/templates/olm/operatorgroup.yaml rename to charts/everest/charts/olm/templates/operatorgroup.yaml index d4340f2a..d54dfacc 100644 --- a/charts/everest/templates/olm/operatorgroup.yaml +++ b/charts/everest/charts/olm/templates/operatorgroup.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: olm-operators - namespace: everest-olm + namespace: {{ .Values.namespace }} spec: targetNamespaces: - everest-olm diff --git a/charts/everest/charts/olm/templates/packageserver.apiservice.yaml b/charts/everest/charts/olm/templates/packageserver.apiservice.yaml new file mode 100644 index 00000000..b2bfa144 --- /dev/null +++ b/charts/everest/charts/olm/templates/packageserver.apiservice.yaml @@ -0,0 +1,31 @@ +{{- $psSvcName := printf "packageserver-service" }} +{{- $psSvcNameWithNS := ( printf "%s.%s" $psSvcName "everest-olm" ) }} +{{- $psFullName := ( printf "%s.svc" $psSvcNameWithNS ) }} +{{- $psAltNames := list $psSvcName $psSvcNameWithNS $psFullName }} +{{- $psCA := genCA $psSvcName 365 }} +{{- $psCert := genSignedCert $psFullName nil $psAltNames 365 $psCA }} +--- +apiVersion: apiregistration.k8s.io/v1 +kind: APIService +metadata: + name: v1.packages.operators.coreos.com +spec: + caBundle: {{ b64enc $psCA.Cert }} + group: packages.operators.coreos.com + groupPriorityMinimum: 2000 + version: v1 + versionPriority: 800 + service: + name: packageserver-service + namespace: everest-olm + port: 5443 +--- +apiVersion: v1 +data: + tls.crt: {{ b64enc $psCert.Cert }} + tls.key: {{ b64enc $psCert.Key }} +kind: Secret +metadata: + name: packageserver-service-cert + namespace: {{ .Values.namespace }} +type: kubernetes.io/tls diff --git a/charts/everest/charts/olm/templates/packageserver.deployment.yaml b/charts/everest/charts/olm/templates/packageserver.deployment.yaml new file mode 100644 index 00000000..98fb7155 --- /dev/null +++ b/charts/everest/charts/olm/templates/packageserver.deployment.yaml @@ -0,0 +1,110 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 2 + name: packageserver + namespace: {{ .Values.namespace }} +spec: + progressDeadlineSeconds: 600 + replicas: 2 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: packageserver + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: packageserver + spec: + containers: + - command: + - /bin/package-server + - -v=4 + - --secure-port + - "5443" + - --global-namespace + - everest-olm + env: + - name: OPERATOR_CONDITION_NAME + value: packageserver + image: {{ .Values.image }} + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 5443 + scheme: HTTPS + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + name: packageserver + ports: + - containerPort: 5443 + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 5443 + scheme: HTTPS + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + requests: + cpu: 10m + memory: 50Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: FallbackToLogsOnError + volumeMounts: + - mountPath: /tmp + name: tmpfs + - mountPath: /apiserver.local.config/certificates + name: apiservice-cert + - mountPath: /tmp/k8s-webhook-server/serving-certs + name: webhook-cert + dnsPolicy: ClusterFirst + nodeSelector: + kubernetes.io/os: linux + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + runAsNonRoot: true + seccompProfile: + type: RuntimeDefault + serviceAccount: olm-operator-serviceaccount + serviceAccountName: olm-operator-serviceaccount + terminationGracePeriodSeconds: 30 + volumes: + - emptyDir: {} + name: tmpfs + - name: apiservice-cert + secret: + defaultMode: 420 + items: + - key: tls.crt + path: apiserver.crt + - key: tls.key + path: apiserver.key + secretName: packageserver-service-cert + - name: webhook-cert + secret: + defaultMode: 420 + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + secretName: packageserver-service-cert diff --git a/charts/everest/charts/olm/templates/packageserver.rbac.yaml b/charts/everest/charts/olm/templates/packageserver.rbac.yaml new file mode 100644 index 00000000..c21fa1f5 --- /dev/null +++ b/charts/everest/charts/olm/templates/packageserver.rbac.yaml @@ -0,0 +1,46 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: packageserver-clusterrole +rules: +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create + - get +- apiGroups: + - "" + resources: + - configmaps + verbs: + - list + - get + - watch +- apiGroups: + - operators.coreos.com + resources: + - catalogsources + verbs: + - list + - get + - watch +- apiGroups: + - packages.operators.coreos.com + resources: + - packagemanifests + verbs: ["*"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: packageserver-clusterrolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: packageserver-clusterrole +subjects: +- kind: ServiceAccount + name: olm-operator-serviceaccount + namespace: {{ .Values.namespace }} diff --git a/charts/everest/charts/olm/templates/packageserver.service.yaml b/charts/everest/charts/olm/templates/packageserver.service.yaml new file mode 100644 index 00000000..9bb8cc02 --- /dev/null +++ b/charts/everest/charts/olm/templates/packageserver.service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: packageserver-service + namespace: {{ .Values.namespace }} +spec: + internalTrafficPolicy: Cluster + ports: + - name: "5443" + port: 5443 + protocol: TCP + targetPort: 5443 + selector: + app: packageserver + type: ClusterIP diff --git a/charts/everest/templates/olm/serviceaccount.yaml b/charts/everest/charts/olm/templates/serviceaccount.yaml similarity index 69% rename from charts/everest/templates/olm/serviceaccount.yaml rename to charts/everest/charts/olm/templates/serviceaccount.yaml index db6240c3..29e2b866 100644 --- a/charts/everest/templates/olm/serviceaccount.yaml +++ b/charts/everest/charts/olm/templates/serviceaccount.yaml @@ -2,5 +2,5 @@ kind: ServiceAccount apiVersion: v1 metadata: name: olm-operator-serviceaccount - namespace: everest-olm + namespace: {{ .Values.namespace }} diff --git a/charts/everest/charts/olm/values.yaml b/charts/everest/charts/olm/values.yaml new file mode 100644 index 00000000..823323c7 --- /dev/null +++ b/charts/everest/charts/olm/values.yaml @@ -0,0 +1,6 @@ +image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 +namespace: everest-olm +everest: + catalogSourceImage: perconalab/everest-catalog + version: 0.0.0 + diff --git a/charts/everest/everest-admin.yaml b/charts/everest/everest-admin.yaml.tpl similarity index 100% rename from charts/everest/everest-admin.yaml rename to charts/everest/everest-admin.yaml.tpl diff --git a/charts/everest/templates/hooks/post-install/job.yaml b/charts/everest/templates/hooks/post-install/job.yaml index 0a206781..7ca6172d 100644 --- a/charts/everest/templates/hooks/post-install/job.yaml +++ b/charts/everest/templates/hooks/post-install/job.yaml @@ -6,10 +6,11 @@ metadata: annotations: "helm.sh/hook": post-install,post-upgrade spec: + ttlSecondsAfterFinished: 60 template: spec: containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-7 + - image: docker.io/mayankshah1607/everest-helm-tools:test-9 command: ["/everest-helm-tools"] args: - run-hook @@ -22,4 +23,3 @@ spec: serviceAccount: everest-helm-post-install-hook serviceAccountName: everest-helm-post-install-hook terminationGracePeriodSeconds: 30 - ttlSecondsAfterFinished: 60 diff --git a/charts/everest/templates/hooks/pre-delete/job.yaml b/charts/everest/templates/hooks/pre-delete/job.yaml index 5d0d75d4..06e88c25 100644 --- a/charts/everest/templates/hooks/pre-delete/job.yaml +++ b/charts/everest/templates/hooks/pre-delete/job.yaml @@ -6,10 +6,11 @@ metadata: annotations: "helm.sh/hook": pre-delete spec: + ttlSecondsAfterFinished: 60 template: spec: containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-7 + - image: docker.io/mayankshah1607/everest-helm-tools:test-9 command: ["/everest-helm-tools"] args: ["run-hook", "pre-delete"] imagePullPolicy: Always @@ -19,4 +20,3 @@ spec: serviceAccount: everest-helm-pre-delete-hook serviceAccountName: everest-helm-pre-delete-hook terminationGracePeriodSeconds: 30 - ttlSecondsAfterFinished: 60 diff --git a/charts/everest/templates/hooks/pre-delete/rbac.yaml b/charts/everest/templates/hooks/pre-delete/rbac.yaml index 30454c26..05f3d948 100644 --- a/charts/everest/templates/hooks/pre-delete/rbac.yaml +++ b/charts/everest/templates/hooks/pre-delete/rbac.yaml @@ -17,13 +17,14 @@ rules: - clusterserviceversions verbs: - delete + - get - list - apiGroups: - everest.percona.com resources: - databaseclusters - backupstorages - - monitoringinstances + - monitoringconfigs verbs: - get - list diff --git a/charts/everest/templates/olm/namespace.yaml b/charts/everest/templates/olm/namespace.yaml deleted file mode 100644 index 2bb07571..00000000 --- a/charts/everest/templates/olm/namespace.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: everest-olm - labels: - pod-security.kubernetes.io/enforce: restricted - pod-security.kubernetes.io/enforce-version: latest - pod-security.kubernetes.io/audit: restricted - pod-security.kubernetes.io/audit-version: latest - pod-security.kubernetes.io/warn: restricted - pod-security.kubernetes.io/warn-version: latest diff --git a/charts/everest/templates/olm/packageserver.csv.yaml b/charts/everest/templates/olm/packageserver.csv.yaml deleted file mode 100644 index 208460b2..00000000 --- a/charts/everest/templates/olm/packageserver.csv.yaml +++ /dev/null @@ -1,140 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: ClusterServiceVersion -metadata: - name: packageserver - namespace: everest-olm - labels: - olm.version: v0.27.0 -spec: - displayName: Package Server - description: Represents an Operator package that is available from a given CatalogSource which will resolve to a ClusterServiceVersion. - minKubeVersion: 1.11.0 - keywords: ['packagemanifests', 'olm', 'packages'] - maintainers: - - name: Red Hat - email: openshift-operators@redhat.com - provider: - name: Red Hat - links: - - name: Package Server - url: https://github.com/operator-framework/operator-lifecycle-manager/tree/master/pkg/package-server - installModes: - - type: OwnNamespace - supported: true - - type: SingleNamespace - supported: true - - type: MultiNamespace - supported: true - - type: AllNamespaces - supported: true - install: - strategy: deployment - spec: - clusterPermissions: - - serviceAccountName: olm-operator-serviceaccount - rules: - - apiGroups: - - authorization.k8s.io - resources: - - subjectaccessreviews - verbs: - - create - - get - - apiGroups: - - "" - resources: - - configmaps - verbs: - - get - - list - - watch - - apiGroups: - - "operators.coreos.com" - resources: - - catalogsources - verbs: - - get - - list - - watch - - apiGroups: - - "packages.operators.coreos.com" - resources: - - packagemanifests - verbs: - - get - - list - deployments: - - name: packageserver - spec: - strategy: - type: RollingUpdate - rollingUpdate: - maxUnavailable: 1 - maxSurge: 1 - replicas: 2 - selector: - matchLabels: - app: packageserver - template: - metadata: - labels: - app: packageserver - spec: - securityContext: - runAsNonRoot: true - seccompProfile: - type: RuntimeDefault - serviceAccountName: olm-operator-serviceaccount - nodeSelector: - kubernetes.io/os: linux - containers: - - name: packageserver - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: [ "ALL" ] - command: - - /bin/package-server - - -v=4 - - --secure-port - - "5443" - - --global-namespace - - everest-olm - image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 - imagePullPolicy: Always - ports: - - containerPort: 5443 - protocol: TCP - livenessProbe: - httpGet: - scheme: HTTPS - path: /healthz - port: 5443 - readinessProbe: - httpGet: - scheme: HTTPS - path: /healthz - port: 5443 - terminationMessagePolicy: FallbackToLogsOnError - resources: - requests: - cpu: 10m - memory: 50Mi - volumeMounts: - - name: tmpfs - mountPath: /tmp - volumes: - - name: tmpfs - emptyDir: {} - maturity: alpha - version: v0.27.0 - apiservicedefinitions: - owned: - - group: packages.operators.coreos.com - version: v1 - kind: PackageManifest - name: packagemanifests - displayName: PackageManifest - description: A PackageManifest is a resource generated from existing CatalogSources and their ConfigMaps - deploymentName: packageserver - containerPort: 5443 diff --git a/charts/everest/templates/everest-operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml similarity index 100% rename from charts/everest/templates/everest-operator/operatorgroup.yaml rename to charts/everest/templates/operator/operatorgroup.yaml diff --git a/charts/everest/templates/everest-operator/subscription.yaml b/charts/everest/templates/operator/subscription.yaml similarity index 86% rename from charts/everest/templates/everest-operator/subscription.yaml rename to charts/everest/templates/operator/subscription.yaml index 8fb41b80..425b5317 100644 --- a/charts/everest/templates/everest-operator/subscription.yaml +++ b/charts/everest/templates/operator/subscription.yaml @@ -23,5 +23,5 @@ spec: - name: MONITORING_NAMESPACE value: everest-monitoring - name: DB_NAMESPACES - value: {{ range $i, $ns := .Values.namespaces }}{{ if ne $i 0 }},{{ end }}{{ $ns.name }}{{ end }} + value: test diff --git a/charts/everest/templates/operators/namespaces.yaml b/charts/everest/templates/operators/namespaces.yaml deleted file mode 100644 index 4518554a..00000000 --- a/charts/everest/templates/operators/namespaces.yaml +++ /dev/null @@ -1,9 +0,0 @@ -{{- range $i, $ns := .Values.namespaces }} ---- -apiVersion: v1 -kind: Namespace -metadata: - name: {{ $ns.name }} - labels: - everest.percona.com/db-namespace: "" -{{- end }} diff --git a/charts/everest/templates/operators/operatorgroup.yaml b/charts/everest/templates/operators/operatorgroup.yaml deleted file mode 100644 index f1faf0c3..00000000 --- a/charts/everest/templates/operators/operatorgroup.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- range $i, $ns := .Values.namespaces }} ---- -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: everest-monitoring - namespace: {{ $ns.name }} -spec: - targetNamespaces: - - {{ $ns.name }} - upgradeStrategy: Default -{{- end }} diff --git a/charts/everest/templates/everest-server/clusterrole.yaml b/charts/everest/templates/server/clusterrole.yaml similarity index 100% rename from charts/everest/templates/everest-server/clusterrole.yaml rename to charts/everest/templates/server/clusterrole.yaml diff --git a/charts/everest/templates/everest-server/clusterrolebinding.yaml b/charts/everest/templates/server/clusterrolebinding.yaml similarity index 100% rename from charts/everest/templates/everest-server/clusterrolebinding.yaml rename to charts/everest/templates/server/clusterrolebinding.yaml diff --git a/charts/everest/templates/everest-server/configmaps.yaml b/charts/everest/templates/server/configmaps.yaml similarity index 100% rename from charts/everest/templates/everest-server/configmaps.yaml rename to charts/everest/templates/server/configmaps.yaml diff --git a/charts/everest/templates/everest-server/deployment.yaml b/charts/everest/templates/server/deployment.yaml similarity index 100% rename from charts/everest/templates/everest-server/deployment.yaml rename to charts/everest/templates/server/deployment.yaml diff --git a/charts/everest/templates/everest-server/role.yaml b/charts/everest/templates/server/role.yaml similarity index 100% rename from charts/everest/templates/everest-server/role.yaml rename to charts/everest/templates/server/role.yaml diff --git a/charts/everest/templates/everest-server/rolebinding.yaml b/charts/everest/templates/server/rolebinding.yaml similarity index 100% rename from charts/everest/templates/everest-server/rolebinding.yaml rename to charts/everest/templates/server/rolebinding.yaml diff --git a/charts/everest/templates/everest-server/secrets.yaml b/charts/everest/templates/server/secrets.yaml similarity index 82% rename from charts/everest/templates/everest-server/secrets.yaml rename to charts/everest/templates/server/secrets.yaml index fb9727da..46ec3785 100644 --- a/charts/everest/templates/everest-server/secrets.yaml +++ b/charts/everest/templates/server/secrets.yaml @@ -15,5 +15,5 @@ metadata: annotations: insecure-password/admin: "true" data: - users.yaml: {{ tpl (.Files.Get "everest-admin.yaml") . | b64enc }} + users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} {{- end }} diff --git a/charts/everest/templates/everest-server/service.yaml b/charts/everest/templates/server/service.yaml similarity index 100% rename from charts/everest/templates/everest-server/service.yaml rename to charts/everest/templates/server/service.yaml diff --git a/charts/everest/templates/everest-server/serviceaccount.yaml b/charts/everest/templates/server/serviceaccount.yaml similarity index 100% rename from charts/everest/templates/everest-server/serviceaccount.yaml rename to charts/everest/templates/server/serviceaccount.yaml diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 18fd55ff..85ec11c5 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,19 +1,18 @@ image: perconalab/everest telemetry: true -olm: - catalogSourceImage: perconalab/everest-catalog vmOperator: channel: stable-v0 everestOperator: channel: fast-v0 -namespaces: - - name: everest - mongodb: - enabled: true - channel: stable-v1 - pxc: - enabled: true - channel: stable-v1 - pg: - enabled: true - channel: stable-v2 + +db-namespace: + # Do not set this to true when deploying the chart, + # unless you want everest-system to be a DB namespace. + enabled: false +olm: + enabled: true + everest: + catalogSourceImage: perconalab/everest-catalog +monitoring: + enabled: true + From 3ab51e6ef2f054b104813fc9e187c09b350e8883 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Sun, 29 Sep 2024 15:15:02 +0530 Subject: [PATCH 08/64] More changes Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 7 +- charts/everest/charts/common/Chart.yaml | 6 ++ .../common/templates/_post_install_hook.yaml | 88 ++++++++++++++++++ .../common/templates/_pre_delete_hook.yaml | 62 ++++++++++++ charts/everest/charts/db-namespace/Chart.lock | 6 ++ charts/everest/charts/db-namespace/Chart.yaml | 4 + .../db-namespace/charts/common-0.0.1.tgz | Bin 0 -> 1229 bytes .../charts/db-namespace/templates/hooks.yaml | 1 + .../everest/charts/db-namespace/values.yaml | 2 + .../charts/everest-monitoring/Chart.lock | 6 ++ .../charts/everest-monitoring/Chart.yaml | 5 + .../charts/common-0.0.1.tgz | Bin 0 -> 1229 bytes .../everest-monitoring/templates/hooks.yaml | 3 + .../templates/namespace.yaml | 2 +- .../templates/operatorgroup.yaml | 2 +- .../templates/subscription.yaml | 2 +- .../charts/everest-monitoring/values.yaml | 5 + charts/everest/templates/hooks.yaml | 3 + .../templates/hooks/post-install/job.yaml | 25 ----- .../templates/hooks/post-install/rbac.yaml | 43 --------- .../hooks/post-install/serviceaccount.yaml | 5 - .../templates/hooks/pre-delete/job.yaml | 22 ----- .../templates/hooks/pre-delete/rbac.yaml | 44 --------- .../hooks/pre-delete/serviceaccount.yaml | 5 - .../templates/operator/operatorgroup.yaml | 7 +- .../templates/operator/subscription.yaml | 2 +- charts/everest/values.yaml | 6 ++ 27 files changed, 208 insertions(+), 155 deletions(-) create mode 100644 charts/everest/charts/common/Chart.yaml create mode 100644 charts/everest/charts/common/templates/_post_install_hook.yaml create mode 100644 charts/everest/charts/common/templates/_pre_delete_hook.yaml create mode 100644 charts/everest/charts/db-namespace/Chart.lock create mode 100644 charts/everest/charts/db-namespace/charts/common-0.0.1.tgz create mode 100644 charts/everest/charts/db-namespace/templates/hooks.yaml create mode 100644 charts/everest/charts/everest-monitoring/Chart.lock create mode 100644 charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz create mode 100644 charts/everest/charts/everest-monitoring/templates/hooks.yaml create mode 100644 charts/everest/templates/hooks.yaml delete mode 100644 charts/everest/templates/hooks/post-install/job.yaml delete mode 100644 charts/everest/templates/hooks/post-install/rbac.yaml delete mode 100644 charts/everest/templates/hooks/post-install/serviceaccount.yaml delete mode 100644 charts/everest/templates/hooks/pre-delete/job.yaml delete mode 100644 charts/everest/templates/hooks/pre-delete/rbac.yaml delete mode 100644 charts/everest/templates/hooks/pre-delete/serviceaccount.yaml diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 00af6fb0..3da19c30 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -14,12 +14,15 @@ dependencies: version: "0.0.1" repository: "file://charts/" condition: db-namespace.enabled + - name: everest-monitoring + version: "0.0.1" + repository: "file://charts/" + condition: monitoring.enabled - name: olm version: "0.0.1" repository: "file://charts/" condition: olm.enabled - - name: everest-monitoring + - name: common version: "0.0.1" repository: "file://charts/" - condition: monitoring.enabled diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml new file mode 100644 index 00000000..c6d09409 --- /dev/null +++ b/charts/everest/charts/common/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: common +description: A library chart for common resources in the Everest Helm chart +type: library +version: 0.0.1 +appVersion: "0.0.1" diff --git a/charts/everest/charts/common/templates/_post_install_hook.yaml b/charts/everest/charts/common/templates/_post_install_hook.yaml new file mode 100644 index 00000000..a775b59a --- /dev/null +++ b/charts/everest/charts/common/templates/_post_install_hook.yaml @@ -0,0 +1,88 @@ +{{- define "common.postInstallHook" }} +{{- $ns := (tpl .Values.postInstallHook.namespace .) }} +{{- $hookName := "everest-helm-post-install-hook" }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +rules: + - apiGroups: + - operators.coreos.com + resources: + - installplans + verbs: + - get + - list + - patch + - update + - watch + - apiGroups: + - operators.coreos.com + resources: + - subscriptions + - clusterserviceversions + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ $hookName }} +subjects: + - kind: ServiceAccount + name: {{ $hookName }} + namespace: {{ $ns }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ $hookName }}-{{ randNumeric 6 }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook": post-install +spec: + ttlSecondsAfterFinished: 60 + template: + spec: + containers: + - image: bitnami/kubectl:latest + name: {{ $hookName }} + command: + - /bin/sh + - -c + - | + subs=$(kubectl -n {{ $ns }} get subscription -o jsonpath='{.items[*].metadata.name}') + # Get the subscriptions in this namespace + for sub in $subs + do + # Wait for installPlan to be created + kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n {{ $ns }} --timeout=600s + # Approve the installPlan + ip=$(kubectl -n {{ $ns }} get sub $sub -o jsonpath='{.status.installplan.name}') + kubectl -n {{ $ns }} patch installplan $ip --type='json' -p='[{"op": "replace", "path": "/spec/approved", "value": true}]' + # Wait for InstallPlan to be complete + kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n {{ $ns }} --timeout=600s + # Wait for CSV to succeed + csv=$(kubectl get sub $sub -n {{ $ns }} -o jsonpath='{.status.installedCSV}') + kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n {{ $ns }} --timeout=600s + done + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ $hookName }} + serviceAccountName: {{ $hookName }} + terminationGracePeriodSeconds: 30 +{{- end }} diff --git a/charts/everest/charts/common/templates/_pre_delete_hook.yaml b/charts/everest/charts/common/templates/_pre_delete_hook.yaml new file mode 100644 index 00000000..fe688024 --- /dev/null +++ b/charts/everest/charts/common/templates/_pre_delete_hook.yaml @@ -0,0 +1,62 @@ +{{- define "common.preDeleteHook" }} +{{- $ns := (tpl .Values.preDeleteHook.namespace . ) }} +{{- $hookName := printf "everest-helm-pre-delete-hook" }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +rules: + - apiGroups: + - operators.coreos.com + resources: + - clusterserviceversions + verbs: + - delete + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ $hookName }} +subjects: + - kind: ServiceAccount + name: {{ $hookName }} + namespace: {{ $ns }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ $hookName }}-{{ randNumeric 6 }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook": pre-delete +spec: + ttlSecondsAfterFinished: 60 + template: + spec: + containers: + - image: bitnami/kubectl:latest + name: {{ $hookName }} + command: + - /bin/sh + - -c + - | + kubectl delete csv -n {{ $ns }} --all --wait + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ $hookName }} + serviceAccountName: {{ $hookName }} + terminationGracePeriodSeconds: 30 +{{- end }} diff --git a/charts/everest/charts/db-namespace/Chart.lock b/charts/everest/charts/db-namespace/Chart.lock new file mode 100644 index 00000000..0d4208c1 --- /dev/null +++ b/charts/everest/charts/db-namespace/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../common + version: 0.0.1 +digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 +generated: "2024-09-29T15:06:28.977388+05:30" diff --git a/charts/everest/charts/db-namespace/Chart.yaml b/charts/everest/charts/db-namespace/Chart.yaml index f3512a59..c5282011 100644 --- a/charts/everest/charts/db-namespace/Chart.yaml +++ b/charts/everest/charts/db-namespace/Chart.yaml @@ -4,3 +4,7 @@ description: This subchart is used for deploying the Percona Operators for Evere type: application version: 0.0.1 appVersion: 0.0.1 +dependencies: + - name: common + version: "0.0.1" + repository: "file://../common" diff --git a/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz b/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..37470a8b921cfcacf8ec9b4d1a50630f7d23db88 GIT binary patch literal 1229 zcmV;;1Ty;{iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGiCZ`(F7&;At$FM!)&`iPs@g8)Bd*^+h-S(y*z|r7>*7Pi{CH| zyT9RZINm!r9F0fAVR$q?*b5JahvUON2>%CN?m=!W(R<;uWp$1FPJk$Oh1xJFBA5+( zM5+2S^h5ukm!P4VDO;e9fwNc>eFxMf3{0hlGJ`;)k-4U5fC;cE!XGo#Xe_)%o|WW1 zK{AXghMv7s7%lJX&Dv7GwOf7|sOsNhrZ}-^f@>v>y=KB#!ufS7UFgnpR|zDt02W&GbtdE1A@qUXr=g@I@SudL$WUlE?8>C*bH z!i^#n!GB%zxgX&qIexi7 zopUsf%LAg=nU=XKJ{@=<6>4IoHa?XarTfW>!@8fYXe&o4PJ}6tGt_b8{043PpEI-i zP{h)-{>oKCEY_c&tHWojXY#myDol-~JU14#DZ^K_`KPI0YWRhL`;Cc&iJND{PjY;Z zQ^&V-&<5c>fJV|hB+BIRC#1GYi?s>vOn*qvN2Ye{{I>GOpEBO=1#dnFO+<2@XQ&y4 z(FV@|5Fw;3%&+3ucV+FHG$@KWf@XpDj6&+jtmT(TrAW;2)S^CRf|(SP2u7hht)8Ot z!X=LbDupFXpstgqsEUl-U<5I!RwBU zpWqB_F>AF-uN=UbSp}`b=cYE3$Bu5_adwUq*+Do-e-l=YdsQ$mI1yka#0XR)v6$Rr zTH5~Ev3lNA>dDGV-&kUE<2QO*VdcPS7C5!qKJz@wGL*TUjKZ+1u~YC^DJ^GMxTB%t zJxZpwgau0B?T|d6?fsan%x>LXbl_$Khkd4;QFjU_11D(!o|+6k%==RHBj{^XoKWol z0)3~0Lj|rD0#e$UxRaTCg!>U#o#W!;U{l!M-4C106i3@ljz`8#rNrQ1a#CH=G%YAh zds6UfHBTTW(S!+Ab;n5~qamTrZhT>&bYixwWazH?%>EI%A^f=VzKw zyg^t_o>|m^*wG-b$R?y r`_pn3D@}(r^A+J7JkQN)yHRQfJJ`Vvo(}&700960*0Qp603HAU%3Nmr literal 0 HcmV?d00001 diff --git a/charts/everest/charts/db-namespace/templates/hooks.yaml b/charts/everest/charts/db-namespace/templates/hooks.yaml new file mode 100644 index 00000000..cbedf4cc --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/hooks.yaml @@ -0,0 +1 @@ +{{- include "common.postInstallHook" . }} diff --git a/charts/everest/charts/db-namespace/values.yaml b/charts/everest/charts/db-namespace/values.yaml index 7d3775b2..e41f6d12 100644 --- a/charts/everest/charts/db-namespace/values.yaml +++ b/charts/everest/charts/db-namespace/values.yaml @@ -4,3 +4,5 @@ pxc: enabled: true pg: enabled: true +postInstallHook: + namespace: '{{ .Release.Namespace }}' diff --git a/charts/everest/charts/everest-monitoring/Chart.lock b/charts/everest/charts/everest-monitoring/Chart.lock new file mode 100644 index 00000000..d8c624a4 --- /dev/null +++ b/charts/everest/charts/everest-monitoring/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../common + version: 0.0.1 +digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 +generated: "2024-09-29T15:14:29.095663+05:30" diff --git a/charts/everest/charts/everest-monitoring/Chart.yaml b/charts/everest/charts/everest-monitoring/Chart.yaml index a7f29cf7..5d369f9e 100644 --- a/charts/everest/charts/everest-monitoring/Chart.yaml +++ b/charts/everest/charts/everest-monitoring/Chart.yaml @@ -6,3 +6,8 @@ description: | type: application version: 0.0.1 appVersion: 0.0.1 +dependencies: + - name: common + version: "0.0.1" + repository: "file://../common" + diff --git a/charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz b/charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..d61e05128a6d0f61b1b06f02472d95bae42b4230 GIT binary patch literal 1229 zcmV;;1Ty;{iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGiCZ`(F7&;At$FM!)&`iPs@g8)Bd*^+h-S(y*z|r7>*7Pi{CH| zyT9RZINm!r9F0fAVR$q?+6xbcM`5@J;s2n^J;;qEdM|votgdn22@u7uP#Y#i1hZj} zC{=%ke&`?c5;RmZWee0Xa29K#?|{05fvMC`W)NsJGS?IhFab72_+y3|jfJc|kL%eLU9$TQEedsVJ^=~7s$Cmr-|nMfkIL_K2^k13V8u)Pc| zNr)v;51?!-^LazkVo~7>Wy(Wg9NP1|mH-_S>XY22QnP=EYjghXuf}IGs71e*9KT$k z&N&*#@%*78fFQY7YhYEhpu!Ay!t1f$TMR!>oR z;gZJzmBJDxP}fOQR7FN^FoKv_K{6KH<}p&sqvAEQHQgp>E^p5=B9f?qa@Pkj6M;!P zSdVrP|F*uND2B=Yt4bU2#L90j(Obm=o`g?E3Po%>8O(iVF*6^2{^&2GRkYQ`;B`mF zPjH5|n6+A^R}Nsztb*3zb5oniV@J2|I6KFQ>>!+^zX>bHy(*X&oCvTIVg#y@SWNCQ zEp7koSUqnl^<-tGZ!EF7@f$s@uyWuu3!GYQpLw2T8Oq#FMq$|1*eQ6dl$J9r+|khS z9wk#-!UCo6c1Rx3_I^xOX1DGxI&iar!#-2as5^y|fs-@FG~$EaXJP2)Xbh>aw5gj z?TIiKk~4Z2!Abd2o-$qcEjK93HW|N9!S zZvWHxdlCQb+h3Eix%91S`_yiO`W`o^x;%cU r{b@Oim8Qd*`HFB3p66z@-6*w#9qeESPlx{k009601;$h>03HAU^6XSC literal 0 HcmV?d00001 diff --git a/charts/everest/charts/everest-monitoring/templates/hooks.yaml b/charts/everest/charts/everest-monitoring/templates/hooks.yaml new file mode 100644 index 00000000..aa10995d --- /dev/null +++ b/charts/everest/charts/everest-monitoring/templates/hooks.yaml @@ -0,0 +1,3 @@ +{{- include "common.preDeleteHook" . }} +--- +{{- include "common.postInstallHook" . }} diff --git a/charts/everest/charts/everest-monitoring/templates/namespace.yaml b/charts/everest/charts/everest-monitoring/templates/namespace.yaml index 1296147c..0072c6d9 100644 --- a/charts/everest/charts/everest-monitoring/templates/namespace.yaml +++ b/charts/everest/charts/everest-monitoring/templates/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: everest-monitoring + name: {{ .Values.namespace }} diff --git a/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml b/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml index d28da82c..6622aa13 100644 --- a/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml +++ b/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: everest-monitoring - namespace: everest-monitoring + namespace: {{ .Values.namespace }} spec: targetNamespaces: - everest-monitoring diff --git a/charts/everest/charts/everest-monitoring/templates/subscription.yaml b/charts/everest/charts/everest-monitoring/templates/subscription.yaml index 7c25ca43..a148d1a8 100644 --- a/charts/everest/charts/everest-monitoring/templates/subscription.yaml +++ b/charts/everest/charts/everest-monitoring/templates/subscription.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: victoriametrics-operator - namespace: everest-monitoring + namespace: {{ .Values.namespace }} spec: channel: {{ .Values.channel }} installPlanApproval: Manual diff --git a/charts/everest/charts/everest-monitoring/values.yaml b/charts/everest/charts/everest-monitoring/values.yaml index a1bc6dc6..dc0d109a 100644 --- a/charts/everest/charts/everest-monitoring/values.yaml +++ b/charts/everest/charts/everest-monitoring/values.yaml @@ -1 +1,6 @@ +namespace: everest-monitoring # Do not change channel: stable-v0 +preDeleteHook: + namespace: '{{ .Values.namespace }}' +postInstallHook: + namespace: '{{ .Values.namespace }}' diff --git a/charts/everest/templates/hooks.yaml b/charts/everest/templates/hooks.yaml new file mode 100644 index 00000000..aa10995d --- /dev/null +++ b/charts/everest/templates/hooks.yaml @@ -0,0 +1,3 @@ +{{- include "common.preDeleteHook" . }} +--- +{{- include "common.postInstallHook" . }} diff --git a/charts/everest/templates/hooks/post-install/job.yaml b/charts/everest/templates/hooks/post-install/job.yaml deleted file mode 100644 index 7ca6172d..00000000 --- a/charts/everest/templates/hooks/post-install/job.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: everest-helm-post-install-hook - namespace: {{ .Release.Namespace }} - annotations: - "helm.sh/hook": post-install,post-upgrade -spec: - ttlSecondsAfterFinished: 60 - template: - spec: - containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-9 - command: ["/everest-helm-tools"] - args: - - run-hook - - post-install - - --version={{ .Chart.AppVersion }} - imagePullPolicy: Always - name: hook-runner - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - serviceAccount: everest-helm-post-install-hook - serviceAccountName: everest-helm-post-install-hook - terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/post-install/rbac.yaml b/charts/everest/templates/hooks/post-install/rbac.yaml deleted file mode 100644 index 584ec98a..00000000 --- a/charts/everest/templates/hooks/post-install/rbac.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: everest-helm-post-install-hook - namespace: {{ .Release.Namespace }} -rules: - - apiGroups: - - operators.coreos.com - resources: - - installplans - verbs: - - get - - list - - update - - apiGroups: - - operators.coreos.com - resources: - - subscriptions - - clusterserviceversions - verbs: - - get - - list - - apiGroups: - - "" - resources: - - namespaces - verbs: - - get - - list ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: everest-helm-post-install-hook -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: everest-helm-post-install-hook -subjects: - - kind: ServiceAccount - name: everest-helm-post-install-hook - namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/post-install/serviceaccount.yaml b/charts/everest/templates/hooks/post-install/serviceaccount.yaml deleted file mode 100644 index 5cd648d1..00000000 --- a/charts/everest/templates/hooks/post-install/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: everest-helm-post-install-hook - namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/pre-delete/job.yaml b/charts/everest/templates/hooks/pre-delete/job.yaml deleted file mode 100644 index 06e88c25..00000000 --- a/charts/everest/templates/hooks/pre-delete/job.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: batch/v1 -kind: Job -metadata: - name: everest-helm-pre-delete-hook - namespace: {{ .Release.Namespace }} - annotations: - "helm.sh/hook": pre-delete -spec: - ttlSecondsAfterFinished: 60 - template: - spec: - containers: - - image: docker.io/mayankshah1607/everest-helm-tools:test-9 - command: ["/everest-helm-tools"] - args: ["run-hook", "pre-delete"] - imagePullPolicy: Always - name: hook-runner - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - serviceAccount: everest-helm-pre-delete-hook - serviceAccountName: everest-helm-pre-delete-hook - terminationGracePeriodSeconds: 30 diff --git a/charts/everest/templates/hooks/pre-delete/rbac.yaml b/charts/everest/templates/hooks/pre-delete/rbac.yaml deleted file mode 100644 index 05f3d948..00000000 --- a/charts/everest/templates/hooks/pre-delete/rbac.yaml +++ /dev/null @@ -1,44 +0,0 @@ ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: everest-helm-pre-delete-hook -rules: - - apiGroups: - - "" - resources: - - namespaces - verbs: - - list - - get - - apiGroups: - - operators.coreos.com - resources: - - clusterserviceversions - verbs: - - delete - - get - - list - - apiGroups: - - everest.percona.com - resources: - - databaseclusters - - backupstorages - - monitoringconfigs - verbs: - - get - - list - - delete ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: everest-helm-pre-delete-hook -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: everest-helm-pre-delete-hook -subjects: - - kind: ServiceAccount - name: everest-helm-pre-delete-hook - namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/hooks/pre-delete/serviceaccount.yaml b/charts/everest/templates/hooks/pre-delete/serviceaccount.yaml deleted file mode 100644 index 41e51489..00000000 --- a/charts/everest/templates/hooks/pre-delete/serviceaccount.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: everest-helm-pre-delete-hook - namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml index daec0355..acc2181f 100644 --- a/charts/everest/templates/operator/operatorgroup.yaml +++ b/charts/everest/templates/operator/operatorgroup.yaml @@ -2,11 +2,8 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: {{ .Release.Namespace }} - namespace: {{ .Release.Namespace }} + namespace: everest-system spec: targetNamespaces: - - {{ .Release.Namespace }} - {{- range $i, $ns := .Values.namespaces }} - - {{ $ns.name }} - {{- end }} + - everest-system upgradeStrategy: Default diff --git a/charts/everest/templates/operator/subscription.yaml b/charts/everest/templates/operator/subscription.yaml index 425b5317..693a22a1 100644 --- a/charts/everest/templates/operator/subscription.yaml +++ b/charts/everest/templates/operator/subscription.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: everest-operator - namespace: {{ .Release.Namespace }} + namespace: everest-system spec: channel: {{ .Values.everestOperator.channel }} installPlanApproval: Manual diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 85ec11c5..d67b73ce 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -8,6 +8,7 @@ everestOperator: db-namespace: # Do not set this to true when deploying the chart, # unless you want everest-system to be a DB namespace. + # DB namespaces are provisioned as a separate (sub) chart. enabled: false olm: enabled: true @@ -16,3 +17,8 @@ olm: monitoring: enabled: true +preDeleteHook: + namespace: '{{ .Release.Namespace }}' +postInstallHook: + namespace: '{{ .Release.Namespace }}' + From 76c140a07b3f38d0da0c6d94f47c21a83d0981ce Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 30 Sep 2024 11:46:36 +0530 Subject: [PATCH 09/64] Fix OG Signed-off-by: Mayank Shah --- charts/everest/templates/operator/operatorgroup.yaml | 7 +++++-- charts/everest/templates/operator/subscription.yaml | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/everest/templates/operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml index acc2181f..70145308 100644 --- a/charts/everest/templates/operator/operatorgroup.yaml +++ b/charts/everest/templates/operator/operatorgroup.yaml @@ -2,8 +2,11 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: {{ .Release.Namespace }} - namespace: everest-system + namespace: {{ .Release.Namespace }} spec: + selector: + matchLabels: + everest.percona.com/db-namespace: "" targetNamespaces: - - everest-system + - {{ .Release.Namespace }} upgradeStrategy: Default diff --git a/charts/everest/templates/operator/subscription.yaml b/charts/everest/templates/operator/subscription.yaml index 693a22a1..c46218f7 100644 --- a/charts/everest/templates/operator/subscription.yaml +++ b/charts/everest/templates/operator/subscription.yaml @@ -1,8 +1,8 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: - name: everest-operator - namespace: everest-system + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} spec: channel: {{ .Values.everestOperator.channel }} installPlanApproval: Manual From 767664d64e3beef6fe1ffd4c8447a7319f38ba8a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 1 Oct 2024 11:40:32 +0530 Subject: [PATCH 10/64] More refactoring! Signed-off-by: Mayank Shah --- charts/everest/README.md | 19 ++++- .../templates/_db_namespace_label_hook.yaml | 70 +++++++++++++++++++ .../common/templates/_post_install_hook.yaml | 22 ++++-- .../common/templates/_pre_delete_hook.yaml | 7 ++ .../charts/db-namespace/templates/hooks.yaml | 2 + .../templates/operator/operatorgroup.yaml | 5 +- .../templates/operator/subscription.yaml | 1 - .../everest/templates/server/configmaps.yaml | 1 - .../everest/templates/server/deployment.yaml | 1 - charts/everest/templates/server/role.yaml | 1 - .../everest/templates/server/rolebinding.yaml | 1 - charts/everest/templates/server/secrets.yaml | 1 - charts/everest/templates/server/service.yaml | 1 - .../templates/server/serviceaccount.yaml | 1 - 14 files changed, 114 insertions(+), 19 deletions(-) create mode 100644 charts/everest/charts/common/templates/_db_namespace_label_hook.yaml diff --git a/charts/everest/README.md b/charts/everest/README.md index 1b57787d..6dea18b1 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -15,10 +15,25 @@ Useful links: ## Installation -Install Percona Everest in the `everest-system` namespace: +Insall Percona Everest in the `everest-system` namespace: + +1. Create the `everest-system` namespace: +```bash +cat < NOTE: We recommend creating the `everest-system` namespace as a separate step. This is because specifying the `--create-namespace` flag with `helm install` does not support setting labels on the namespace. + +2. Install the Helm chart: ```bash helm repo add percona https://percona.github.io/percona-helm-charts/ -helm install everest percona/everest --version 1.1.1 --namespace everest-system --create-namespace +helm install everest percona/everest --version 1.1.1 --namespace everest-system ``` > NOTE: Installing in any namespace other than `everest-system` can cause the installation to fail. diff --git a/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml b/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml new file mode 100644 index 00000000..956c5844 --- /dev/null +++ b/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml @@ -0,0 +1,70 @@ +{{- define "common.dbNamespaceLabelHook" }} +{{- $ns := (tpl {{ .Release.Namespace }} .) }} +{{- $hookName := "everest-db-namespace-label-hook" }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +rules: + - apiGroups: + - "" + resources: + - namespace + verbs: + - get + - list + - update +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ $hookName }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ $hookName }} +subjects: + - kind: ServiceAccount + name: {{ $hookName }} + namespace: {{ $ns }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ $hookName }}-{{ randNumeric 6 }} + namespace: {{ $ns }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-delete-policy": hook-succeeded +spec: + ttlSecondsAfterFinished: 60 + template: + spec: + containers: + - image: bitnami/kubectl:latest + name: {{ $hookName }} + command: + - /bin/sh + - -c + - | + kubectl label namespace {{ $ns }} app.kubernetes.io/managed-by=everest + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ $hookName }} + serviceAccountName: {{ $hookName }} + terminationGracePeriodSeconds: 30 +{{- end }} diff --git a/charts/everest/charts/common/templates/_post_install_hook.yaml b/charts/everest/charts/common/templates/_post_install_hook.yaml index a775b59a..43611f67 100644 --- a/charts/everest/charts/common/templates/_post_install_hook.yaml +++ b/charts/everest/charts/common/templates/_post_install_hook.yaml @@ -6,12 +6,16 @@ kind: ServiceAccount metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded rules: - apiGroups: - operators.coreos.com @@ -38,6 +42,8 @@ kind: RoleBinding metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -54,6 +60,7 @@ metadata: namespace: {{ $ns }} annotations: "helm.sh/hook": post-install + "helm.sh/hook-delete-policy": hook-succeeded spec: ttlSecondsAfterFinished: 60 template: @@ -66,18 +73,23 @@ spec: - -c - | subs=$(kubectl -n {{ $ns }} get subscription -o jsonpath='{.items[*].metadata.name}') - # Get the subscriptions in this namespace for sub in $subs do - # Wait for installPlan to be created + echo "Waiting for InstallPlan to be created for Subscription $sub" kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n {{ $ns }} --timeout=600s - # Approve the installPlan + ip=$(kubectl -n {{ $ns }} get sub $sub -o jsonpath='{.status.installplan.name}') + echo "InstallPlan $ip created for Subscription $sub" + + echo "Approving InstallPlan $ip" kubectl -n {{ $ns }} patch installplan $ip --type='json' -p='[{"op": "replace", "path": "/spec/approved", "value": true}]' - # Wait for InstallPlan to be complete + + echo "Waiting for InstallPlan to be complete $ip" kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n {{ $ns }} --timeout=600s - # Wait for CSV to succeed + csv=$(kubectl get sub $sub -n {{ $ns }} -o jsonpath='{.status.installedCSV}') + + echo "Waiting for CSV $csv to succeed" kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n {{ $ns }} --timeout=600s done dnsPolicy: ClusterFirst diff --git a/charts/everest/charts/common/templates/_pre_delete_hook.yaml b/charts/everest/charts/common/templates/_pre_delete_hook.yaml index fe688024..c1b65091 100644 --- a/charts/everest/charts/common/templates/_pre_delete_hook.yaml +++ b/charts/everest/charts/common/templates/_pre_delete_hook.yaml @@ -6,12 +6,16 @@ kind: ServiceAccount metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded rules: - apiGroups: - operators.coreos.com @@ -26,6 +30,8 @@ kind: RoleBinding metadata: name: {{ $hookName }} namespace: {{ $ns }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role @@ -42,6 +48,7 @@ metadata: namespace: {{ $ns }} annotations: "helm.sh/hook": pre-delete + "helm.sh/hook-delete-policy": hook-succeeded spec: ttlSecondsAfterFinished: 60 template: diff --git a/charts/everest/charts/db-namespace/templates/hooks.yaml b/charts/everest/charts/db-namespace/templates/hooks.yaml index cbedf4cc..0cdaf0d5 100644 --- a/charts/everest/charts/db-namespace/templates/hooks.yaml +++ b/charts/everest/charts/db-namespace/templates/hooks.yaml @@ -1 +1,3 @@ {{- include "common.postInstallHook" . }} +--- +{{- include "common.dbNamespaceLabelHook" . }} diff --git a/charts/everest/templates/operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml index 70145308..5be52b45 100644 --- a/charts/everest/templates/operator/operatorgroup.yaml +++ b/charts/everest/templates/operator/operatorgroup.yaml @@ -2,11 +2,8 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: {{ .Release.Namespace }} - namespace: {{ .Release.Namespace }} spec: selector: matchLabels: - everest.percona.com/db-namespace: "" - targetNamespaces: - - {{ .Release.Namespace }} + everest.percona.com/namespace: "" upgradeStrategy: Default diff --git a/charts/everest/templates/operator/subscription.yaml b/charts/everest/templates/operator/subscription.yaml index c46218f7..3885d761 100644 --- a/charts/everest/templates/operator/subscription.yaml +++ b/charts/everest/templates/operator/subscription.yaml @@ -2,7 +2,6 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: {{ .Release.Name }} - namespace: {{ .Release.Namespace }} spec: channel: {{ .Values.everestOperator.channel }} installPlanApproval: Manual diff --git a/charts/everest/templates/server/configmaps.yaml b/charts/everest/templates/server/configmaps.yaml index 474c65c6..d8c6cb2d 100644 --- a/charts/everest/templates/server/configmaps.yaml +++ b/charts/everest/templates/server/configmaps.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: ConfigMap metadata: name: everest-rbac - namespace: {{ .Release.Namespace }} data: policy.csv: | g, admin, role:admin diff --git a/charts/everest/templates/server/deployment.yaml b/charts/everest/templates/server/deployment.yaml index 4af179a7..fdec2b8d 100644 --- a/charts/everest/templates/server/deployment.yaml +++ b/charts/everest/templates/server/deployment.yaml @@ -2,7 +2,6 @@ apiVersion: apps/v1 kind: Deployment metadata: name: percona-everest - namespace: {{ .Release.Namespace }} spec: replicas: 1 strategy: diff --git a/charts/everest/templates/server/role.yaml b/charts/everest/templates/server/role.yaml index 65df6195..2ea10b38 100644 --- a/charts/everest/templates/server/role.yaml +++ b/charts/everest/templates/server/role.yaml @@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: everest-admin-role - namespace: {{ .Release.Namespace }} rules: - apiGroups: [""] resources: ["namespaces"] diff --git a/charts/everest/templates/server/rolebinding.yaml b/charts/everest/templates/server/rolebinding.yaml index 5e203a7f..e4ec201c 100644 --- a/charts/everest/templates/server/rolebinding.yaml +++ b/charts/everest/templates/server/rolebinding.yaml @@ -2,7 +2,6 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: everest-admin-role-binding - namespace: {{ .Release.Namespace }} roleRef: kind: "Role" apiGroup: "rbac.authorization.k8s.io" diff --git a/charts/everest/templates/server/secrets.yaml b/charts/everest/templates/server/secrets.yaml index 46ec3785..6c47922e 100644 --- a/charts/everest/templates/server/secrets.yaml +++ b/charts/everest/templates/server/secrets.yaml @@ -3,7 +3,6 @@ apiVersion: v1 kind: Secret metadata: name: everest-jwt - namespace: {{ .Release.Namespace }} data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} --- diff --git a/charts/everest/templates/server/service.yaml b/charts/everest/templates/server/service.yaml index b3ac3a7d..d394d220 100644 --- a/charts/everest/templates/server/service.yaml +++ b/charts/everest/templates/server/service.yaml @@ -2,7 +2,6 @@ apiVersion: v1 kind: Service metadata: name: everest - namespace: {{ .Release.Namespace }} labels: app.kubernetes.io/name: everest app.kubernetes.io/component: everest diff --git a/charts/everest/templates/server/serviceaccount.yaml b/charts/everest/templates/server/serviceaccount.yaml index c0947cd3..597ce2d0 100644 --- a/charts/everest/templates/server/serviceaccount.yaml +++ b/charts/everest/templates/server/serviceaccount.yaml @@ -2,4 +2,3 @@ apiVersion: v1 kind: ServiceAccount metadata: name: everest-admin - namespace: {{ .Release.Namespace }} From 47897d56b4bb60bf353d2336d4181909b26af8a0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 1 Oct 2024 12:31:33 +0530 Subject: [PATCH 11/64] Fix labeller Signed-off-by: Mayank Shah --- .../common/templates/_db_namespace_label_hook.yaml | 9 +++++---- charts/everest/templates/hooks.yaml | 2 ++ charts/everest/templates/operator/operatorgroup.yaml | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml b/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml index 956c5844..a9f959c7 100644 --- a/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml +++ b/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml @@ -1,5 +1,5 @@ {{- define "common.dbNamespaceLabelHook" }} -{{- $ns := (tpl {{ .Release.Namespace }} .) }} +{{- $ns := (tpl "{{ .Release.Namespace }}" .) }} {{- $hookName := "everest-db-namespace-label-hook" }} apiVersion: v1 kind: ServiceAccount @@ -20,11 +20,11 @@ rules: - apiGroups: - "" resources: - - namespace + - namespaces verbs: - get - list - - update + - patch --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding @@ -50,6 +50,7 @@ metadata: annotations: "helm.sh/hook": post-install "helm.sh/hook-delete-policy": hook-succeeded + "helm.sh/hook-weight": "-1" spec: ttlSecondsAfterFinished: 60 template: @@ -61,7 +62,7 @@ spec: - /bin/sh - -c - | - kubectl label namespace {{ $ns }} app.kubernetes.io/managed-by=everest + kubectl label namespace {{ $ns }} everest.percona.com/managed-namespace=true --overwrite dnsPolicy: ClusterFirst restartPolicy: OnFailure serviceAccount: {{ $hookName }} diff --git a/charts/everest/templates/hooks.yaml b/charts/everest/templates/hooks.yaml index aa10995d..09c5a43e 100644 --- a/charts/everest/templates/hooks.yaml +++ b/charts/everest/templates/hooks.yaml @@ -1,3 +1,5 @@ {{- include "common.preDeleteHook" . }} --- {{- include "common.postInstallHook" . }} +--- +{{- include "common.dbNamespaceLabelHook" . }} diff --git a/charts/everest/templates/operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml index 5be52b45..1e6d58f0 100644 --- a/charts/everest/templates/operator/operatorgroup.yaml +++ b/charts/everest/templates/operator/operatorgroup.yaml @@ -5,5 +5,5 @@ metadata: spec: selector: matchLabels: - everest.percona.com/namespace: "" + everest.percona.com/managed-namespace: "true" upgradeStrategy: Default From 99f9224b307921c571c32e4ad0d65c990741b1ad Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 3 Oct 2024 11:28:36 +0530 Subject: [PATCH 12/64] More refactor Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 20 - charts/everest/charts/common/Chart.yaml | 6 - .../templates/_db_namespace_label_hook.yaml | 71 - charts/everest/charts/db-namespace/Chart.lock | 6 - charts/everest/charts/db-namespace/Chart.yaml | 10 - .../db-namespace/charts/common-0.0.1.tgz | Bin 1229 -> 0 bytes .../charts/db-namespace/templates/hooks.yaml | 3 - .../db-namespace/templates/operatorgroup.yaml | 9 - .../everest/charts/db-namespace/values.yaml | 8 - .../charts/everest-monitoring/Chart.lock | 6 - .../charts/everest-monitoring/Chart.yaml | 13 - .../charts/common-0.0.1.tgz | Bin 1229 -> 0 bytes .../everest-monitoring/templates/hooks.yaml | 3 - .../templates/operatorgroup.yaml | 9 - .../charts/everest-monitoring/values.yaml | 6 - charts/everest/charts/olm/Chart.yaml | 7 - .../charts/olm/templates/namespace.yaml | 4 - charts/everest/charts/olm/values.yaml | 6 - charts/everest/crds/everest.yaml | 1184 +++++++++++++++++ charts/everest/{charts/olm => }/crds/olm.yaml | 1 - .../db-namespace/dbnamespace.yaml} | 55 +- .../everest/templates/db-namespace/hooks.yaml | 5 + .../templates/everest-monitoring/hooks.yaml | 4 + .../everest-monitoring/namespace.yaml | 4 + .../everest-monitoring/operatorgroup.yaml | 9 + .../everest-monitoring}/subscription.yaml | 5 +- .../catalog-operator.deployment.yaml | 6 +- .../everest-olm}/clusterrole.yaml | 0 .../everest-olm}/clusterrolebinding.yaml | 2 +- .../everest-olm}/everest-catalogsource.yaml | 4 +- .../everest-olm}/namespace.yaml | 2 +- .../everest-olm}/olm-operator.deployment.yaml | 4 +- .../everest-olm}/olmconfig.yaml | 0 .../everest-olm}/operatorgroup.yaml | 2 +- .../packageserver.apiservice.yaml | 16 +- .../packageserver.deployment.yaml | 6 +- .../everest-olm}/packageserver.rbac.yaml | 2 +- .../everest-olm}/packageserver.service.yaml | 2 +- .../everest-olm}/serviceaccount.yaml | 2 +- .../everest-operator/clusterrole.yaml | 360 +++++ .../everest-operator/deployment.yaml | 138 ++ .../everest-operator/metrics-service.yaml | 19 + .../everest-operator/rolebinding.yaml | 13 + .../everest-operator/serviceaccount.yaml | 5 + .../clusterrole.yaml | 0 .../clusterrolebinding.yaml | 0 .../configmaps.yaml | 2 + .../deployment.yaml | 8 +- .../{server => everest-server}/role.yaml | 0 .../rolebinding.yaml | 0 .../{server => everest-server}/secrets.yaml | 7 +- .../{server => everest-server}/service.yaml | 0 .../serviceaccount.yaml | 0 charts/everest/templates/hooks.yaml | 5 - .../hooks/_csv_cleanup.tpl.yaml} | 19 +- .../hooks/_installplan_approver.tpl.yaml} | 33 +- .../templates/operator/operatorgroup.yaml | 9 - .../templates/operator/subscription.yaml | 26 - charts/everest/values.yaml | 39 +- 59 files changed, 1882 insertions(+), 303 deletions(-) delete mode 100644 charts/everest/charts/common/Chart.yaml delete mode 100644 charts/everest/charts/common/templates/_db_namespace_label_hook.yaml delete mode 100644 charts/everest/charts/db-namespace/Chart.lock delete mode 100644 charts/everest/charts/db-namespace/Chart.yaml delete mode 100644 charts/everest/charts/db-namespace/charts/common-0.0.1.tgz delete mode 100644 charts/everest/charts/db-namespace/templates/hooks.yaml delete mode 100644 charts/everest/charts/db-namespace/templates/operatorgroup.yaml delete mode 100644 charts/everest/charts/db-namespace/values.yaml delete mode 100644 charts/everest/charts/everest-monitoring/Chart.lock delete mode 100644 charts/everest/charts/everest-monitoring/Chart.yaml delete mode 100644 charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz delete mode 100644 charts/everest/charts/everest-monitoring/templates/hooks.yaml delete mode 100644 charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml delete mode 100644 charts/everest/charts/everest-monitoring/values.yaml delete mode 100644 charts/everest/charts/olm/Chart.yaml delete mode 100644 charts/everest/charts/olm/templates/namespace.yaml delete mode 100644 charts/everest/charts/olm/values.yaml create mode 100644 charts/everest/crds/everest.yaml rename charts/everest/{charts/olm => }/crds/olm.yaml (99%) rename charts/everest/{charts/db-namespace/templates/subscriptions.yaml => templates/db-namespace/dbnamespace.yaml} (55%) create mode 100644 charts/everest/templates/db-namespace/hooks.yaml create mode 100644 charts/everest/templates/everest-monitoring/hooks.yaml create mode 100644 charts/everest/templates/everest-monitoring/namespace.yaml create mode 100644 charts/everest/templates/everest-monitoring/operatorgroup.yaml rename charts/everest/{charts/everest-monitoring/templates => templates/everest-monitoring}/subscription.yaml (73%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/catalog-operator.deployment.yaml (84%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/clusterrole.yaml (100%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/clusterrolebinding.yaml (87%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/everest-catalogsource.yaml (70%) rename charts/everest/{charts/everest-monitoring/templates => templates/everest-olm}/namespace.yaml (53%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/olm-operator.deployment.yaml (95%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/olmconfig.yaml (100%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/operatorgroup.yaml (76%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/packageserver.apiservice.yaml (60%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/packageserver.deployment.yaml (95%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/packageserver.rbac.yaml (95%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/packageserver.service.yaml (85%) rename charts/everest/{charts/olm/templates => templates/everest-olm}/serviceaccount.yaml (66%) create mode 100644 charts/everest/templates/everest-operator/clusterrole.yaml create mode 100644 charts/everest/templates/everest-operator/deployment.yaml create mode 100644 charts/everest/templates/everest-operator/metrics-service.yaml create mode 100644 charts/everest/templates/everest-operator/rolebinding.yaml create mode 100644 charts/everest/templates/everest-operator/serviceaccount.yaml rename charts/everest/templates/{server => everest-server}/clusterrole.yaml (100%) rename charts/everest/templates/{server => everest-server}/clusterrolebinding.yaml (100%) rename charts/everest/templates/{server => everest-server}/configmaps.yaml (55%) rename charts/everest/templates/{server => everest-server}/deployment.yaml (80%) rename charts/everest/templates/{server => everest-server}/role.yaml (100%) rename charts/everest/templates/{server => everest-server}/rolebinding.yaml (100%) rename charts/everest/templates/{server => everest-server}/secrets.yaml (59%) rename charts/everest/templates/{server => everest-server}/service.yaml (100%) rename charts/everest/templates/{server => everest-server}/serviceaccount.yaml (100%) delete mode 100644 charts/everest/templates/hooks.yaml rename charts/everest/{charts/common/templates/_pre_delete_hook.yaml => templates/hooks/_csv_cleanup.tpl.yaml} (80%) rename charts/everest/{charts/common/templates/_post_install_hook.yaml => templates/hooks/_installplan_approver.tpl.yaml} (69%) delete mode 100644 charts/everest/templates/operator/operatorgroup.yaml delete mode 100644 charts/everest/templates/operator/subscription.yaml diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 3da19c30..02208c0d 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -6,23 +6,3 @@ version: 0.0.0 appVersion: 0.0.0 type: application kubeVersion: ">=1.27.0-0" - -dependencies: - # While this isn't really a dependency for the chart, we still specify it - # here so that we're able to conditionally disable rendering the DB namespace manifests. - - name: db-namespace - version: "0.0.1" - repository: "file://charts/" - condition: db-namespace.enabled - - name: everest-monitoring - version: "0.0.1" - repository: "file://charts/" - condition: monitoring.enabled - - name: olm - version: "0.0.1" - repository: "file://charts/" - condition: olm.enabled - - name: common - version: "0.0.1" - repository: "file://charts/" - diff --git a/charts/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml deleted file mode 100644 index c6d09409..00000000 --- a/charts/everest/charts/common/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -name: common -description: A library chart for common resources in the Everest Helm chart -type: library -version: 0.0.1 -appVersion: "0.0.1" diff --git a/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml b/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml deleted file mode 100644 index a9f959c7..00000000 --- a/charts/everest/charts/common/templates/_db_namespace_label_hook.yaml +++ /dev/null @@ -1,71 +0,0 @@ -{{- define "common.dbNamespaceLabelHook" }} -{{- $ns := (tpl "{{ .Release.Namespace }}" .) }} -{{- $hookName := "everest-db-namespace-label-hook" }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ $hookName }} - namespace: {{ $ns }} - annotations: - "helm.sh/hook-delete-policy": hook-succeeded ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: {{ $hookName }} - namespace: {{ $ns }} - annotations: - "helm.sh/hook-delete-policy": hook-succeeded -rules: - - apiGroups: - - "" - resources: - - namespaces - verbs: - - get - - list - - patch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: {{ $hookName }} - namespace: {{ $ns }} - annotations: - "helm.sh/hook-delete-policy": hook-succeeded -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: {{ $hookName }} -subjects: - - kind: ServiceAccount - name: {{ $hookName }} - namespace: {{ $ns }} ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ $hookName }}-{{ randNumeric 6 }} - namespace: {{ $ns }} - annotations: - "helm.sh/hook": post-install - "helm.sh/hook-delete-policy": hook-succeeded - "helm.sh/hook-weight": "-1" -spec: - ttlSecondsAfterFinished: 60 - template: - spec: - containers: - - image: bitnami/kubectl:latest - name: {{ $hookName }} - command: - - /bin/sh - - -c - - | - kubectl label namespace {{ $ns }} everest.percona.com/managed-namespace=true --overwrite - dnsPolicy: ClusterFirst - restartPolicy: OnFailure - serviceAccount: {{ $hookName }} - serviceAccountName: {{ $hookName }} - terminationGracePeriodSeconds: 30 -{{- end }} diff --git a/charts/everest/charts/db-namespace/Chart.lock b/charts/everest/charts/db-namespace/Chart.lock deleted file mode 100644 index 0d4208c1..00000000 --- a/charts/everest/charts/db-namespace/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: common - repository: file://../common - version: 0.0.1 -digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 -generated: "2024-09-29T15:06:28.977388+05:30" diff --git a/charts/everest/charts/db-namespace/Chart.yaml b/charts/everest/charts/db-namespace/Chart.yaml deleted file mode 100644 index c5282011..00000000 --- a/charts/everest/charts/db-namespace/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: db-namespace -description: This subchart is used for deploying the Percona Operators for Everest. -type: application -version: 0.0.1 -appVersion: 0.0.1 -dependencies: - - name: common - version: "0.0.1" - repository: "file://../common" diff --git a/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz b/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz deleted file mode 100644 index 37470a8b921cfcacf8ec9b4d1a50630f7d23db88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1229 zcmV;;1Ty;{iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGiCZ`(F7&;At$FM!)&`iPs@g8)Bd*^+h-S(y*z|r7>*7Pi{CH| zyT9RZINm!r9F0fAVR$q?*b5JahvUON2>%CN?m=!W(R<;uWp$1FPJk$Oh1xJFBA5+( zM5+2S^h5ukm!P4VDO;e9fwNc>eFxMf3{0hlGJ`;)k-4U5fC;cE!XGo#Xe_)%o|WW1 zK{AXghMv7s7%lJX&Dv7GwOf7|sOsNhrZ}-^f@>v>y=KB#!ufS7UFgnpR|zDt02W&GbtdE1A@qUXr=g@I@SudL$WUlE?8>C*bH z!i^#n!GB%zxgX&qIexi7 zopUsf%LAg=nU=XKJ{@=<6>4IoHa?XarTfW>!@8fYXe&o4PJ}6tGt_b8{043PpEI-i zP{h)-{>oKCEY_c&tHWojXY#myDol-~JU14#DZ^K_`KPI0YWRhL`;Cc&iJND{PjY;Z zQ^&V-&<5c>fJV|hB+BIRC#1GYi?s>vOn*qvN2Ye{{I>GOpEBO=1#dnFO+<2@XQ&y4 z(FV@|5Fw;3%&+3ucV+FHG$@KWf@XpDj6&+jtmT(TrAW;2)S^CRf|(SP2u7hht)8Ot z!X=LbDupFXpstgqsEUl-U<5I!RwBU zpWqB_F>AF-uN=UbSp}`b=cYE3$Bu5_adwUq*+Do-e-l=YdsQ$mI1yka#0XR)v6$Rr zTH5~Ev3lNA>dDGV-&kUE<2QO*VdcPS7C5!qKJz@wGL*TUjKZ+1u~YC^DJ^GMxTB%t zJxZpwgau0B?T|d6?fsan%x>LXbl_$Khkd4;QFjU_11D(!o|+6k%==RHBj{^XoKWol z0)3~0Lj|rD0#e$UxRaTCg!>U#o#W!;U{l!M-4C106i3@ljz`8#rNrQ1a#CH=G%YAh zds6UfHBTTW(S!+Ab;n5~qamTrZhT>&bYixwWazH?%>EI%A^f=VzKw zyg^t_o>|m^*wG-b$R?y r`_pn3D@}(r^A+J7JkQN)yHRQfJJ`Vvo(}&700960*0Qp603HAU%3Nmr diff --git a/charts/everest/charts/db-namespace/templates/hooks.yaml b/charts/everest/charts/db-namespace/templates/hooks.yaml deleted file mode 100644 index 0cdaf0d5..00000000 --- a/charts/everest/charts/db-namespace/templates/hooks.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- include "common.postInstallHook" . }} ---- -{{- include "common.dbNamespaceLabelHook" . }} diff --git a/charts/everest/charts/db-namespace/templates/operatorgroup.yaml b/charts/everest/charts/db-namespace/templates/operatorgroup.yaml deleted file mode 100644 index 2136e7a3..00000000 --- a/charts/everest/charts/db-namespace/templates/operatorgroup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: everest-databases - namespace: {{ .Release.Namespace }} -spec: - targetNamespaces: - - {{ .Release.Namespace }} - upgradeStrategy: Default diff --git a/charts/everest/charts/db-namespace/values.yaml b/charts/everest/charts/db-namespace/values.yaml deleted file mode 100644 index e41f6d12..00000000 --- a/charts/everest/charts/db-namespace/values.yaml +++ /dev/null @@ -1,8 +0,0 @@ -mongodb: - enabled: true -pxc: - enabled: true -pg: - enabled: true -postInstallHook: - namespace: '{{ .Release.Namespace }}' diff --git a/charts/everest/charts/everest-monitoring/Chart.lock b/charts/everest/charts/everest-monitoring/Chart.lock deleted file mode 100644 index d8c624a4..00000000 --- a/charts/everest/charts/everest-monitoring/Chart.lock +++ /dev/null @@ -1,6 +0,0 @@ -dependencies: -- name: common - repository: file://../common - version: 0.0.1 -digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 -generated: "2024-09-29T15:14:29.095663+05:30" diff --git a/charts/everest/charts/everest-monitoring/Chart.yaml b/charts/everest/charts/everest-monitoring/Chart.yaml deleted file mode 100644 index 5d369f9e..00000000 --- a/charts/everest/charts/everest-monitoring/Chart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v2 -name: everest-monitoring -description: | - This subchart is used for deploying the monitoring stack for Percona Everest. - Not meant to be used as a standalone chart. -type: application -version: 0.0.1 -appVersion: 0.0.1 -dependencies: - - name: common - version: "0.0.1" - repository: "file://../common" - diff --git a/charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz b/charts/everest/charts/everest-monitoring/charts/common-0.0.1.tgz deleted file mode 100644 index d61e05128a6d0f61b1b06f02472d95bae42b4230..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1229 zcmV;;1Ty;{iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGiCZ`(F7&;At$FM!)&`iPs@g8)Bd*^+h-S(y*z|r7>*7Pi{CH| zyT9RZINm!r9F0fAVR$q?+6xbcM`5@J;s2n^J;;qEdM|votgdn22@u7uP#Y#i1hZj} zC{=%ke&`?c5;RmZWee0Xa29K#?|{05fvMC`W)NsJGS?IhFab72_+y3|jfJc|kL%eLU9$TQEedsVJ^=~7s$Cmr-|nMfkIL_K2^k13V8u)Pc| zNr)v;51?!-^LazkVo~7>Wy(Wg9NP1|mH-_S>XY22QnP=EYjghXuf}IGs71e*9KT$k z&N&*#@%*78fFQY7YhYEhpu!Ay!t1f$TMR!>oR z;gZJzmBJDxP}fOQR7FN^FoKv_K{6KH<}p&sqvAEQHQgp>E^p5=B9f?qa@Pkj6M;!P zSdVrP|F*uND2B=Yt4bU2#L90j(Obm=o`g?E3Po%>8O(iVF*6^2{^&2GRkYQ`;B`mF zPjH5|n6+A^R}Nsztb*3zb5oniV@J2|I6KFQ>>!+^zX>bHy(*X&oCvTIVg#y@SWNCQ zEp7koSUqnl^<-tGZ!EF7@f$s@uyWuu3!GYQpLw2T8Oq#FMq$|1*eQ6dl$J9r+|khS z9wk#-!UCo6c1Rx3_I^xOX1DGxI&iar!#-2as5^y|fs-@FG~$EaXJP2)Xbh>aw5gj z?TIiKk~4Z2!Abd2o-$qcEjK93HW|N9!S zZvWHxdlCQb+h3Eix%91S`_yiO`W`o^x;%cU r{b@Oim8Qd*`HFB3p66z@-6*w#9qeESPlx{k009601;$h>03HAU^6XSC diff --git a/charts/everest/charts/everest-monitoring/templates/hooks.yaml b/charts/everest/charts/everest-monitoring/templates/hooks.yaml deleted file mode 100644 index aa10995d..00000000 --- a/charts/everest/charts/everest-monitoring/templates/hooks.yaml +++ /dev/null @@ -1,3 +0,0 @@ -{{- include "common.preDeleteHook" . }} ---- -{{- include "common.postInstallHook" . }} diff --git a/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml b/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml deleted file mode 100644 index 6622aa13..00000000 --- a/charts/everest/charts/everest-monitoring/templates/operatorgroup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: everest-monitoring - namespace: {{ .Values.namespace }} -spec: - targetNamespaces: - - everest-monitoring - upgradeStrategy: Default diff --git a/charts/everest/charts/everest-monitoring/values.yaml b/charts/everest/charts/everest-monitoring/values.yaml deleted file mode 100644 index dc0d109a..00000000 --- a/charts/everest/charts/everest-monitoring/values.yaml +++ /dev/null @@ -1,6 +0,0 @@ -namespace: everest-monitoring # Do not change -channel: stable-v0 -preDeleteHook: - namespace: '{{ .Values.namespace }}' -postInstallHook: - namespace: '{{ .Values.namespace }}' diff --git a/charts/everest/charts/olm/Chart.yaml b/charts/everest/charts/olm/Chart.yaml deleted file mode 100644 index 911c7b49..00000000 --- a/charts/everest/charts/olm/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v2 -name: olm -description: This subchart is used for deploying OLM for Percona Everest. -type: application -version: 0.0.1 -appVersion: 0.0.1 - diff --git a/charts/everest/charts/olm/templates/namespace.yaml b/charts/everest/charts/olm/templates/namespace.yaml deleted file mode 100644 index 0072c6d9..00000000 --- a/charts/everest/charts/olm/templates/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.namespace }} diff --git a/charts/everest/charts/olm/values.yaml b/charts/everest/charts/olm/values.yaml deleted file mode 100644 index 823323c7..00000000 --- a/charts/everest/charts/olm/values.yaml +++ /dev/null @@ -1,6 +0,0 @@ -image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 -namespace: everest-olm -everest: - catalogSourceImage: perconalab/everest-catalog - version: 0.0.0 - diff --git a/charts/everest/crds/everest.yaml b/charts/everest/crds/everest.yaml new file mode 100644 index 00000000..759a6b93 --- /dev/null +++ b/charts/everest/crds/everest.yaml @@ -0,0 +1,1184 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: backupstorages.everest.percona.com +spec: + group: everest.percona.com + names: + kind: BackupStorage + listKind: BackupStorageList + plural: backupstorages + singular: backupstorage + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: BackupStorage is the Schema for the backupstorages 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: BackupStorageSpec defines the desired state of BackupStorage. + properties: + allowedNamespaces: + description: |- + AllowedNamespaces is the list of namespaces where the operator will copy secrets provided in the CredentialsSecretsName. + + + Deprecated: BackupStorages are now used only in the namespaces where they are created. + items: + type: string + type: array + bucket: + description: Bucket is a name of bucket. + type: string + credentialsSecretName: + description: CredentialsSecretName is the name of the secret with + credentials. + type: string + description: + description: Description stores description of a backup storage. + type: string + endpointURL: + description: EndpointURL is an endpoint URL of backup storage. + type: string + forcePathStyle: + default: false + description: |- + ForcePathStyle is set to use path-style URLs. + If unspecified, the default value is false. + type: boolean + region: + description: Region is a region where the bucket is located. + type: string + type: + description: Type is a type of backup storage. + enum: + - s3 + - azure + type: string + verifyTLS: + default: true + description: |- + VerifyTLS is set to ensure TLS/SSL verification. + If unspecified, the default value is true. + type: boolean + required: + - bucket + - credentialsSecretName + - type + type: object + status: + description: BackupStorageStatus defines the observed state of BackupStorage. + properties: + usedNamespaces: + additionalProperties: + type: boolean + description: 'Deprecated: BackupStorages are now used only in the + namespaces where they are created.' + type: object + required: + - usedNamespaces + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: databaseclusterbackups.everest.percona.com +spec: + group: everest.percona.com + names: + kind: DatabaseClusterBackup + listKind: DatabaseClusterBackupList + plural: databaseclusterbackups + shortNames: + - dbbackup + - dbb + singular: databaseclusterbackup + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: The original database cluster name + jsonPath: .spec.dbClusterName + name: Cluster + type: string + - description: Backup destination + jsonPath: .status.destination + name: Destination + type: string + - description: Job status + jsonPath: .status.state + name: Status + type: string + - description: Time the job was completed + jsonPath: .status.completed + name: Completed + type: date + - description: Age of the resource + jsonPath: .status.created + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: DatabaseClusterBackup is the Schema for the databaseclusterbackups + 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: DatabaseClusterBackupSpec defines the desired state of DatabaseClusterBackup. + properties: + backupStorageName: + description: |- + BackupStorageName is the name of the BackupStorage used for backups. + The BackupStorage must be created in the same namespace as the DatabaseCluster. + type: string + dbClusterName: + description: DBClusterName is the original database cluster name. + type: string + required: + - backupStorageName + - dbClusterName + type: object + status: + description: DatabaseClusterBackupStatus defines the observed state of + DatabaseClusterBackup. + properties: + completed: + description: Completed is the time when the job was completed. + format: date-time + type: string + created: + description: Created is the timestamp of the upstream backup's creation. + format: date-time + type: string + destination: + description: Destination is the full path to the backup. + type: string + gaps: + description: Gaps identifies if there are gaps detected in the PITR + logs + type: boolean + latestRestorableTime: + description: LatestRestorableTime is the latest time that can be used + for PITR restore + format: date-time + type: string + state: + description: State is the DatabaseBackup state. + type: string + required: + - gaps + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: databaseclusterrestores.everest.percona.com +spec: + group: everest.percona.com + names: + kind: DatabaseClusterRestore + listKind: DatabaseClusterRestoreList + plural: databaseclusterrestores + shortNames: + - dbrestore + - dbr + singular: databaseclusterrestore + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Cluster name + jsonPath: .spec.dbClusterName + name: Cluster + type: string + - description: DBClusterBackup name + jsonPath: .spec.dataSource.dbClusterBackupName + name: Backup + type: string + - description: Backup path + jsonPath: .spec.dataSource.backupSource.path + name: Path + type: string + - description: Storage name + jsonPath: .spec.dataSource.backupSource.backupStorageName + name: Storage + type: string + - description: Job status + jsonPath: .status.state + name: Status + type: string + - description: Completed time + jsonPath: .status.completed + name: Completed + type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: DatabaseClusterRestore is the Schema for the databaseclusterrestores + 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: DatabaseClusterRestoreSpec defines the desired state of DatabaseClusterRestore. + properties: + dataSource: + description: DataSource defines a data source for restoration. + properties: + backupSource: + description: BackupSource is the backup source to restore from + properties: + backupStorageName: + description: |- + BackupStorageName is the name of the BackupStorage used for backups. + The BackupStorage must be created in the same namespace as the DatabaseCluster. + type: string + path: + description: Path is the path to the backup file/directory. + type: string + required: + - backupStorageName + - path + type: object + dbClusterBackupName: + description: DBClusterBackupName is the name of the DB cluster + backup to restore from + type: string + pitr: + description: PITR is the point-in-time recovery configuration + properties: + date: + description: 'Date is the UTC date to recover to. The accepted + format: "2006-01-02T15:04:05Z".' + type: string + type: + default: date + description: Type is the type of recovery. + enum: + - date + - latest + type: string + type: object + type: object + dbClusterName: + description: DBClusterName defines the cluster name to restore. + type: string + required: + - dataSource + - dbClusterName + type: object + status: + description: DatabaseClusterRestoreStatus defines the observed state of + DatabaseClusterRestore. + properties: + completed: + format: date-time + type: string + message: + type: string + state: + description: RestoreState represents state of restoration. + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: databaseclusters.everest.percona.com +spec: + group: everest.percona.com + names: + kind: DatabaseCluster + listKind: DatabaseClusterList + plural: databaseclusters + shortNames: + - db + - dbc + - dbcluster + singular: databasecluster + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.size + name: Size + type: string + - jsonPath: .status.ready + name: Ready + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .status.hostname + name: Hostname + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: DatabaseCluster is the Schema for the databaseclusters 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: DatabaseClusterSpec defines the desired state of DatabaseCluster. + properties: + allowUnsafeConfiguration: + description: AllowUnsafeConfiguration field used to ensure that the + user can create configurations unfit for production use. + type: boolean + backup: + description: Backup is the backup specification + properties: + enabled: + description: Enabled is a flag to enable backups + type: boolean + pitr: + description: PITR is the configuration of the point in time recovery + properties: + backupStorageName: + description: |- + BackupStorageName is the name of the BackupStorage where the PITR is enabled + The BackupStorage must be created in the same namespace as the DatabaseCluster. + type: string + enabled: + description: Enabled is a flag to enable PITR + type: boolean + uploadIntervalSec: + description: UploadIntervalSec number of seconds between the + binlogs uploads + type: integer + required: + - enabled + type: object + schedules: + description: Schedules is a list of backup schedules + items: + description: BackupSchedule is the backup schedule configuration. + properties: + backupStorageName: + description: |- + BackupStorageName is the name of the BackupStorage CR that defines the + storage location. + The BackupStorage must be created in the same namespace as the DatabaseCluster. + type: string + enabled: + description: Enabled is a flag to enable the schedule + type: boolean + name: + description: Name is the name of the schedule + type: string + retentionCopies: + description: RetentionCopies is the number of backup copies + to retain + format: int32 + type: integer + schedule: + description: Schedule is the cron schedule + type: string + required: + - backupStorageName + - enabled + - name + - schedule + type: object + type: array + required: + - enabled + type: object + dataSource: + description: DataSource defines a data source for bootstraping a new + cluster + properties: + backupSource: + description: BackupSource is the backup source to restore from + properties: + backupStorageName: + description: |- + BackupStorageName is the name of the BackupStorage used for backups. + The BackupStorage must be created in the same namespace as the DatabaseCluster. + type: string + path: + description: Path is the path to the backup file/directory. + type: string + required: + - backupStorageName + - path + type: object + dbClusterBackupName: + description: DBClusterBackupName is the name of the DB cluster + backup to restore from + type: string + pitr: + description: PITR is the point-in-time recovery configuration + properties: + date: + description: 'Date is the UTC date to recover to. The accepted + format: "2006-01-02T15:04:05Z".' + type: string + type: + default: date + description: Type is the type of recovery. + enum: + - date + - latest + type: string + type: object + type: object + engine: + description: Engine is the database engine specification + properties: + config: + description: Config is the engine configuration + type: string + crVersion: + description: |- + CRVersion is the desired version of the CR to use with the + underlying operator. + If unspecified, everest-operator will use the same version as the operator. + + + NOTE: Updating this property post installation may lead to a restart of the cluster. + type: string + replicas: + description: Replicas is the number of engine replicas + format: int32 + minimum: 1 + type: integer + resources: + description: |- + Resources are the resource limits for each engine replica. + If not set, resource limits are not imposed + properties: + cpu: + anyOf: + - type: integer + - type: string + description: CPU is the CPU resource requirements + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + description: Memory is the memory resource requirements + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + storage: + description: Storage is the engine storage configuration + properties: + class: + description: Class is the storage class to use for the persistent + volume claim + type: string + size: + anyOf: + - type: integer + - type: string + description: Size is the size of the persistent volume claim + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - size + type: object + type: + description: Type is the engine type + enum: + - pxc + - postgresql + - psmdb + type: string + userSecretsName: + description: UserSecretsName is the name of the secret containing + the user secrets + type: string + version: + description: Version is the engine version + type: string + required: + - storage + - type + type: object + monitoring: + description: Monitoring is the monitoring configuration + properties: + monitoringConfigName: + description: |- + MonitoringConfigName is the name of a monitoringConfig CR. + The MonitoringConfig must be created in the same namespace as the DatabaseCluster. + type: string + resources: + description: Resources defines resource limitations for the monitoring. + properties: + claims: + description: |- + Claims lists the names of resources, defined in spec.resourceClaims, + that are used by this container. + + + This is an alpha field and requires enabling the + DynamicResourceAllocation feature gate. + + + This field is immutable. It can only be set for containers. + items: + description: ResourceClaim references one entry in PodSpec.ResourceClaims. + properties: + name: + description: |- + Name must match the name of one entry in pod.spec.resourceClaims of + the Pod where this field is used. It makes that resource available + inside a container. + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Limits describes the maximum amount of compute resources allowed. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Requests describes the minimum amount of compute resources required. + If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + otherwise to an implementation-defined value. Requests cannot exceed Limits. + More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + type: object + type: object + type: object + paused: + description: Paused is a flag to stop the cluster + type: boolean + proxy: + description: |- + Proxy is the proxy specification. If not set, an appropriate + proxy specification will be applied for the given engine. A + common use case for setting this field is to control the + external access to the database cluster. + properties: + config: + description: Config is the proxy configuration + type: string + expose: + description: Expose is the proxy expose configuration + properties: + ipSourceRanges: + description: |- + IPSourceRanges is the list of IP source ranges (CIDR notation) + to allow access from. If not set, there is no limitations + items: + description: IPSourceRange represents IP addresses in CIDR + notation or without a netmask. + type: string + type: array + type: + default: internal + description: Type is the expose type, can be internal or external + enum: + - internal + - external + type: string + type: object + replicas: + description: Replicas is the number of proxy replicas + format: int32 + minimum: 1 + type: integer + resources: + description: |- + Resources are the resource limits for each proxy replica. + If not set, resource limits are not imposed + properties: + cpu: + anyOf: + - type: integer + - type: string + description: CPU is the CPU resource requirements + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + memory: + anyOf: + - type: integer + - type: string + description: Memory is the memory resource requirements + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: + description: Type is the proxy type + enum: + - mongos + - haproxy + - proxysql + - pgbouncer + type: string + type: object + sharding: + description: Sharding is the sharding configuration. PSMDB-only + properties: + configServer: + description: ConfigServer represents the sharding configuration + server settings + properties: + replicas: + description: Replicas is the amount of configServers + format: int32 + minimum: 1 + type: integer + required: + - replicas + type: object + enabled: + description: Enabled defines if the sharding is enabled + type: boolean + shards: + description: Shards defines the number of shards + format: int32 + minimum: 1 + type: integer + required: + - configServer + - enabled + - shards + type: object + required: + - engine + type: object + status: + description: DatabaseClusterStatus defines the observed state of DatabaseCluster. + properties: + activeStorage: + description: ActiveStorage is the storage used in cluster (psmdb only) + type: string + crVersion: + description: CRVersion is the observed version of the CR used with + the underlying operator. + type: string + details: + description: Details provides full status of the upstream cluster + as a plain text. + type: string + hostname: + description: Hostname is the hostname where the cluster can be reached + type: string + message: + description: Message is extra information about the cluster + type: string + observedGeneration: + description: ObservedGeneration is the most recent generation observed + for this DatabaseCluster. + format: int64 + type: integer + port: + description: Port is the port where the cluster can be reached + format: int32 + type: integer + ready: + description: Ready is the number of ready pods + format: int32 + type: integer + recommendedCRVersion: + description: |- + RecommendedCRVersion is the recommended version of the CR to use. + If set, the CR needs to be updated to this version before upgrading the operator. + If unset, the CR is already at the recommended version. + type: string + size: + description: Size is the total number of pods + format: int32 + type: integer + status: + description: Status is the status of the cluster + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: databaseengines.everest.percona.com +spec: + group: everest.percona.com + names: + kind: DatabaseEngine + listKind: DatabaseEngineList + plural: databaseengines + shortNames: + - dbengine + singular: databaseengine + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .status.operatorVersion + name: Operator Version + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: DatabaseEngine is the Schema for the databaseengines 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: DatabaseEngineSpec is a spec for a database engine. + properties: + allowedVersions: + items: + type: string + type: array + type: + description: |- + EngineType stands for the supported database engines. Right now it's only pxc + and psmdb. However, it can be ps, pg and any other source. + type: string + required: + - type + type: object + status: + description: DatabaseEngineStatus defines the observed state of DatabaseEngine. + properties: + availableVersions: + description: Versions struct represents available versions of database + engine components. + properties: + backup: + additionalProperties: + description: |- + Component contains information of the database engine component. + Database Engine component can be database engine, database proxy or tools image path. + properties: + critical: + type: boolean + imageHash: + type: string + imagePath: + type: string + status: + description: ComponentStatus represents status of the database + engine component. + type: string + type: object + description: ComponentsMap is a map of database engine components. + type: object + engine: + additionalProperties: + description: |- + Component contains information of the database engine component. + Database Engine component can be database engine, database proxy or tools image path. + properties: + critical: + type: boolean + imageHash: + type: string + imagePath: + type: string + status: + description: ComponentStatus represents status of the database + engine component. + type: string + type: object + description: ComponentsMap is a map of database engine components. + type: object + proxy: + additionalProperties: + additionalProperties: + description: |- + Component contains information of the database engine component. + Database Engine component can be database engine, database proxy or tools image path. + properties: + critical: + type: boolean + imageHash: + type: string + imagePath: + type: string + status: + description: ComponentStatus represents status of the + database engine component. + type: string + type: object + description: ComponentsMap is a map of database engine components. + type: object + type: object + tools: + additionalProperties: + additionalProperties: + description: |- + Component contains information of the database engine component. + Database Engine component can be database engine, database proxy or tools image path. + properties: + critical: + type: boolean + imageHash: + type: string + imagePath: + type: string + status: + description: ComponentStatus represents status of the + database engine component. + type: string + type: object + description: ComponentsMap is a map of database engine components. + type: object + type: object + type: object + operatorUpgrade: + description: OperatorUpgrade contains the status of the operator upgrade. + properties: + installPlanRef: + description: |- + InstallPlanRef is a reference to the InstallPlan object created for the operator upgrade. + + + We do not recommended approving this InstallPlan directly from the Kubernetes API. + This is because this InstallPlan may also upgrade other operators in the namespace and that + can have unintended consequences. + This behaviour is not a bug from Everest, but an unfortunate limitation of OLM. + We suggest using the Everest API/UI to handle operator upgrades, which will perform a series + of checks and safely upgrade all operators in the 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. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + type: string + type: object + x-kubernetes-map-type: atomic + message: + type: string + phase: + description: UpgradePhase represents the phase of the operator + upgrade. + type: string + startedAt: + format: date-time + type: string + targetVersion: + description: TargetVersion is the version to which the operator + should be upgraded. + type: string + type: object + operatorVersion: + type: string + pendingOperatorUpgrades: + items: + description: OperatorUpgrade contains the information about the + operator upgrade. + properties: + installPlanRef: + description: |- + InstallPlanRef is a reference to the InstallPlan object created for the operator upgrade. + + + We do not recommended approving this InstallPlan directly from the Kubernetes API. + This is because this InstallPlan may also upgrade other operators in the namespace and that + can have unintended consequences. + This behaviour is not a bug from Everest, but an unfortunate limitation of OLM. + We suggest using the Everest API/UI to handle operator upgrades, which will perform a series + of checks and safely upgrade all operators in the 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. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + type: string + type: object + x-kubernetes-map-type: atomic + targetVersion: + description: TargetVersion is the version to which the operator + should be upgraded. + type: string + type: object + type: array + status: + description: EngineState represents state of engine in a k8s cluster. + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + creationTimestamp: null + name: monitoringconfigs.everest.percona.com +spec: + group: everest.percona.com + names: + kind: MonitoringConfig + listKind: MonitoringConfigList + plural: monitoringconfigs + singular: monitoringconfig + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Monitoring instance type + jsonPath: .spec.type + name: Type + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: MonitoringConfig is the Schema for the monitoringconfigs 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: MonitoringConfigSpec defines the desired state of MonitoringConfig. + properties: + allowedNamespaces: + description: AllowedNamespaces is the list of namespaces where the + operator will copy secrets provided in the CredentialsSecretsName. + items: + type: string + type: array + credentialsSecretName: + description: CredentialsSecretName is the name of the secret with + credentials. + type: string + pmm: + description: PMM is configuration for the PMM monitoring type. + properties: + image: + description: Image is a Docker image name to use for deploying + PMM client. Defaults to using the latest version. + type: string + url: + description: URL is url to the monitoring instance. + type: string + required: + - image + - url + type: object + type: + description: Type is type of monitoring. + enum: + - pmm + type: string + verifyTLS: + default: true + description: |- + VerifyTLS is set to ensure TLS/SSL verification. + If unspecified, the default value is true. + type: boolean + required: + - credentialsSecretName + - type + type: object + status: + description: MonitoringConfigStatus defines the observed state of MonitoringConfig. + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null +--- diff --git a/charts/everest/charts/olm/crds/olm.yaml b/charts/everest/crds/olm.yaml similarity index 99% rename from charts/everest/charts/olm/crds/olm.yaml rename to charts/everest/crds/olm.yaml index f33e8b12..fe42bb4b 100644 --- a/charts/everest/charts/olm/crds/olm.yaml +++ b/charts/everest/crds/olm.yaml @@ -8501,4 +8501,3 @@ spec: subresources: status: {} - diff --git a/charts/everest/charts/db-namespace/templates/subscriptions.yaml b/charts/everest/templates/db-namespace/dbnamespace.yaml similarity index 55% rename from charts/everest/charts/db-namespace/templates/subscriptions.yaml rename to charts/everest/templates/db-namespace/dbnamespace.yaml index 48a822bb..432246de 100644 --- a/charts/everest/charts/db-namespace/templates/subscriptions.yaml +++ b/charts/everest/templates/db-namespace/dbnamespace.yaml @@ -1,16 +1,23 @@ -{{- if .Values.mongodb.enabled }} +{{- range $i, $ns := .Values.dbNamespaces }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ $ns.name }} + labels: + app.kubernetes.io/managed-by: everest --- +{{- if $ns.psmdb }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-server-mongodb-operator - namespace: {{ .Release.Namespace }} + namespace: {{ $ns.name }} spec: channel: stable-v1 installPlanApproval: Manual name: percona-server-mongodb-operator source: everest-catalog - sourceNamespace: everest-olm + sourceNamespace: {{ $.Values.olm.namespace }} config: env: - name: DISABLE_TELEMETRY @@ -19,20 +26,20 @@ spec: {{- else }} value: "false" {{- end }} -{{- end }} -{{- if .Values.pxc.enabled }} --- +{{- end }} +{{- if $ns.pxc }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-xtradb-cluster-operator - namespace: {{ .Release.Namespace }} + namespace: {{ $ns.name }} spec: channel: stable-v1 installPlanApproval: Manual name: percona-xtradb-cluster-operator source: everest-catalog - sourceNamespace: everest-olm + sourceNamespace: {{ $.Values.olm.namespace }} config: env: - name: DISABLE_TELEMETRY @@ -41,20 +48,20 @@ spec: {{- else }} value: "false" {{- end }} -{{- end }} -{{- if .Values.pg.enabled }} --- +{{- end }} +{{- if $ns.pg }} apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-postgresql-operator - namespace: {{ .Release.Namespace }} + namespace: {{ $ns.name }} spec: channel: stable-v2 installPlanApproval: Manual name: percona-postgresql-operator source: everest-catalog - sourceNamespace: everest-olm + sourceNamespace: {{ $.Values.olm.namespace }} config: env: - name: DISABLE_TELEMETRY @@ -63,4 +70,30 @@ spec: {{- else }} value: "false" {{- end }} +--- +{{- end }} +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: database-operators + namespace: {{ $ns.name }} +spec: + targetNamespaces: + - {{ $ns.name }} + upgradeStrategy: Default +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: everest-operator + namespace: {{ $ns.name }} +subjects: +- kind: ServiceAccount + name: everest-operator + namespace: {{ $.Release.Namespace }} +roleRef: + kind: ClusterRole + name: everest-operator + apiGroup: rbac.authorization.k8s.io +--- {{- end }} diff --git a/charts/everest/templates/db-namespace/hooks.yaml b/charts/everest/templates/db-namespace/hooks.yaml new file mode 100644 index 00000000..440ad4bc --- /dev/null +++ b/charts/everest/templates/db-namespace/hooks.yaml @@ -0,0 +1,5 @@ +{{- range $i, $ns := .Values.dbNamespaces }} +{{- include "everest.csvCleanup" (dict "namespace" $ns.name) }} +--- +{{- include "everest.installplanApprover" (dict "namespace" $ns.name) }} +{{- end }} diff --git a/charts/everest/templates/everest-monitoring/hooks.yaml b/charts/everest/templates/everest-monitoring/hooks.yaml new file mode 100644 index 00000000..edacecf6 --- /dev/null +++ b/charts/everest/templates/everest-monitoring/hooks.yaml @@ -0,0 +1,4 @@ +{{- include "everest.csvCleanup" (dict "namespace" .Values.monitoring.namespace) }} +--- +{{- include "everest.installplanApprover" (dict "namespace" .Values.monitoring.namespace) }} + diff --git a/charts/everest/templates/everest-monitoring/namespace.yaml b/charts/everest/templates/everest-monitoring/namespace.yaml new file mode 100644 index 00000000..72046784 --- /dev/null +++ b/charts/everest/templates/everest-monitoring/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Values.monitoring.namespace }} diff --git a/charts/everest/templates/everest-monitoring/operatorgroup.yaml b/charts/everest/templates/everest-monitoring/operatorgroup.yaml new file mode 100644 index 00000000..6edffac4 --- /dev/null +++ b/charts/everest/templates/everest-monitoring/operatorgroup.yaml @@ -0,0 +1,9 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: {{ .Values.monitoring.namespace }} + namespace: {{ .Values.monitoring.namespace }} +spec: + targetNamespaces: + - {{ .Values.monitoring.namespace }} + upgradeStrategy: Default diff --git a/charts/everest/charts/everest-monitoring/templates/subscription.yaml b/charts/everest/templates/everest-monitoring/subscription.yaml similarity index 73% rename from charts/everest/charts/everest-monitoring/templates/subscription.yaml rename to charts/everest/templates/everest-monitoring/subscription.yaml index a148d1a8..e7d3cc9f 100644 --- a/charts/everest/charts/everest-monitoring/templates/subscription.yaml +++ b/charts/everest/templates/everest-monitoring/subscription.yaml @@ -2,9 +2,10 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: victoriametrics-operator - namespace: {{ .Values.namespace }} + namespace: {{ .Values.monitoring.namespace }} spec: - channel: {{ .Values.channel }} + channel: stable-v0 + config: {} installPlanApproval: Manual name: victoriametrics-operator source: everest-catalog diff --git a/charts/everest/charts/olm/templates/catalog-operator.deployment.yaml b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml similarity index 84% rename from charts/everest/charts/olm/templates/catalog-operator.deployment.yaml rename to charts/everest/templates/everest-olm/catalog-operator.deployment.yaml index e60527de..e597268d 100644 --- a/charts/everest/charts/olm/templates/catalog-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: catalog-operator - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} labels: app: catalog-operator spec: @@ -35,9 +35,9 @@ spec: - everest-olm - --configmapServerImage=quay.io/operator-framework/configmap-operator-registry:latest - --util-image - - quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + - {{ .Values.olm.image }} - --set-workload-user-id=true - image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + image: {{ .Values.olm.image }} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 diff --git a/charts/everest/charts/olm/templates/clusterrole.yaml b/charts/everest/templates/everest-olm/clusterrole.yaml similarity index 100% rename from charts/everest/charts/olm/templates/clusterrole.yaml rename to charts/everest/templates/everest-olm/clusterrole.yaml diff --git a/charts/everest/charts/olm/templates/clusterrolebinding.yaml b/charts/everest/templates/everest-olm/clusterrolebinding.yaml similarity index 87% rename from charts/everest/charts/olm/templates/clusterrolebinding.yaml rename to charts/everest/templates/everest-olm/clusterrolebinding.yaml index 1563c7b0..63ab10d3 100644 --- a/charts/everest/charts/olm/templates/clusterrolebinding.yaml +++ b/charts/everest/templates/everest-olm/clusterrolebinding.yaml @@ -9,4 +9,4 @@ roleRef: subjects: - kind: ServiceAccount name: olm-operator-serviceaccount - namespace: everest-olm + namespace: {{ .Values.olm.namespace }} diff --git a/charts/everest/charts/olm/templates/everest-catalogsource.yaml b/charts/everest/templates/everest-olm/everest-catalogsource.yaml similarity index 70% rename from charts/everest/charts/olm/templates/everest-catalogsource.yaml rename to charts/everest/templates/everest-olm/everest-catalogsource.yaml index 8289d321..acb25b2c 100644 --- a/charts/everest/charts/olm/templates/everest-catalogsource.yaml +++ b/charts/everest/templates/everest-olm/everest-catalogsource.yaml @@ -2,12 +2,12 @@ apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: everest-catalog - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} spec: displayName: Everest Catalog grpcPodConfig: securityContextConfig: restricted - image: {{ .Values.everest.catalogSourceImage }}:{{ .Values.everest.version }} + image: {{ .Values.olm.catalogSourceImage }}:{{ .Chart.Version }} publisher: Percona sourceType: grpc updateStrategy: diff --git a/charts/everest/charts/everest-monitoring/templates/namespace.yaml b/charts/everest/templates/everest-olm/namespace.yaml similarity index 53% rename from charts/everest/charts/everest-monitoring/templates/namespace.yaml rename to charts/everest/templates/everest-olm/namespace.yaml index 0072c6d9..0d16e074 100644 --- a/charts/everest/charts/everest-monitoring/templates/namespace.yaml +++ b/charts/everest/templates/everest-olm/namespace.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: Namespace metadata: - name: {{ .Values.namespace }} + name: {{ .Values.olm.namespace }} diff --git a/charts/everest/charts/olm/templates/olm-operator.deployment.yaml b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml similarity index 95% rename from charts/everest/charts/olm/templates/olm-operator.deployment.yaml rename to charts/everest/templates/everest-olm/olm-operator.deployment.yaml index a679d9df..736a1ca3 100644 --- a/charts/everest/charts/olm/templates/olm-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: olm-operator - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} labels: app: olm-operator spec: @@ -35,7 +35,7 @@ spec: - $(OPERATOR_NAMESPACE) - --writeStatusName - "" - image: {{ .Values.image }} + image: {{ .Values.olm.image }} imagePullPolicy: IfNotPresent ports: - containerPort: 8080 diff --git a/charts/everest/charts/olm/templates/olmconfig.yaml b/charts/everest/templates/everest-olm/olmconfig.yaml similarity index 100% rename from charts/everest/charts/olm/templates/olmconfig.yaml rename to charts/everest/templates/everest-olm/olmconfig.yaml diff --git a/charts/everest/charts/olm/templates/operatorgroup.yaml b/charts/everest/templates/everest-olm/operatorgroup.yaml similarity index 76% rename from charts/everest/charts/olm/templates/operatorgroup.yaml rename to charts/everest/templates/everest-olm/operatorgroup.yaml index d54dfacc..c3c6cbfe 100644 --- a/charts/everest/charts/olm/templates/operatorgroup.yaml +++ b/charts/everest/templates/everest-olm/operatorgroup.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: olm-operators - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} spec: targetNamespaces: - everest-olm diff --git a/charts/everest/charts/olm/templates/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml similarity index 60% rename from charts/everest/charts/olm/templates/packageserver.apiservice.yaml rename to charts/everest/templates/everest-olm/packageserver.apiservice.yaml index b2bfa144..63666c87 100644 --- a/charts/everest/charts/olm/templates/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -2,13 +2,16 @@ {{- $psSvcNameWithNS := ( printf "%s.%s" $psSvcName "everest-olm" ) }} {{- $psFullName := ( printf "%s.svc" $psSvcNameWithNS ) }} {{- $psAltNames := list $psSvcName $psSvcNameWithNS $psFullName }} -{{- $psCA := genCA $psSvcName 365 }} -{{- $psCert := genSignedCert $psFullName nil $psAltNames 365 $psCA }} +{{- $psCA := genCA $psSvcName 3650 }} +{{- $psCert := genSignedCert $psFullName nil $psAltNames 3650 $psCA }} --- +{{- if not (lookup "apiregistration.k8s.io/v1" "APIService" "" "v1.packages.operators.coreos.com" )}} apiVersion: apiregistration.k8s.io/v1 kind: APIService metadata: name: v1.packages.operators.coreos.com + annotations: + helm.sh/resource-policy: keep spec: caBundle: {{ b64enc $psCA.Cert }} group: packages.operators.coreos.com @@ -17,9 +20,11 @@ spec: versionPriority: 800 service: name: packageserver-service - namespace: everest-olm + namespace: {{ .Values.olm.namespace }} port: 5443 +{{- end }} --- +{{- if not (lookup "v1" "Secret" .Values.olm.namespace $psSvcName )}} apiVersion: v1 data: tls.crt: {{ b64enc $psCert.Cert }} @@ -27,5 +32,8 @@ data: kind: Secret metadata: name: packageserver-service-cert - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} + annotations: + helm.sh/resource-policy: keep type: kubernetes.io/tls +{{- end }} diff --git a/charts/everest/charts/olm/templates/packageserver.deployment.yaml b/charts/everest/templates/everest-olm/packageserver.deployment.yaml similarity index 95% rename from charts/everest/charts/olm/templates/packageserver.deployment.yaml rename to charts/everest/templates/everest-olm/packageserver.deployment.yaml index 98fb7155..958b84ba 100644 --- a/charts/everest/charts/olm/templates/packageserver.deployment.yaml +++ b/charts/everest/templates/everest-olm/packageserver.deployment.yaml @@ -3,7 +3,7 @@ kind: Deployment metadata: generation: 2 name: packageserver - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} spec: progressDeadlineSeconds: 600 replicas: 2 @@ -29,11 +29,11 @@ spec: - --secure-port - "5443" - --global-namespace - - everest-olm + - {{ .Values.olm.namespace }} env: - name: OPERATOR_CONDITION_NAME value: packageserver - image: {{ .Values.image }} + image: {{ .Values.olm.image }} imagePullPolicy: Always livenessProbe: failureThreshold: 3 diff --git a/charts/everest/charts/olm/templates/packageserver.rbac.yaml b/charts/everest/templates/everest-olm/packageserver.rbac.yaml similarity index 95% rename from charts/everest/charts/olm/templates/packageserver.rbac.yaml rename to charts/everest/templates/everest-olm/packageserver.rbac.yaml index c21fa1f5..f64ac31b 100644 --- a/charts/everest/charts/olm/templates/packageserver.rbac.yaml +++ b/charts/everest/templates/everest-olm/packageserver.rbac.yaml @@ -43,4 +43,4 @@ roleRef: subjects: - kind: ServiceAccount name: olm-operator-serviceaccount - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} diff --git a/charts/everest/charts/olm/templates/packageserver.service.yaml b/charts/everest/templates/everest-olm/packageserver.service.yaml similarity index 85% rename from charts/everest/charts/olm/templates/packageserver.service.yaml rename to charts/everest/templates/everest-olm/packageserver.service.yaml index 9bb8cc02..dd1b8611 100644 --- a/charts/everest/charts/olm/templates/packageserver.service.yaml +++ b/charts/everest/templates/everest-olm/packageserver.service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: packageserver-service - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} spec: internalTrafficPolicy: Cluster ports: diff --git a/charts/everest/charts/olm/templates/serviceaccount.yaml b/charts/everest/templates/everest-olm/serviceaccount.yaml similarity index 66% rename from charts/everest/charts/olm/templates/serviceaccount.yaml rename to charts/everest/templates/everest-olm/serviceaccount.yaml index 29e2b866..ecd31ba5 100644 --- a/charts/everest/charts/olm/templates/serviceaccount.yaml +++ b/charts/everest/templates/everest-olm/serviceaccount.yaml @@ -2,5 +2,5 @@ kind: ServiceAccount apiVersion: v1 metadata: name: olm-operator-serviceaccount - namespace: {{ .Values.namespace }} + namespace: {{ .Values.olm.namespace }} diff --git a/charts/everest/templates/everest-operator/clusterrole.yaml b/charts/everest/templates/everest-operator/clusterrole.yaml new file mode 100644 index 00000000..add762d8 --- /dev/null +++ b/charts/everest/templates/everest-operator/clusterrole.yaml @@ -0,0 +1,360 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: everest-operator +rules: +- apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - get + - list + - watch +- apiGroups: + - apps + resources: + - deployments + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - secrets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - backupstorages + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - backupstorages/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - backupstorages/status + verbs: + - get + - patch + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusterbackups + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - databaseclusterbackups/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusterbackups/status + verbs: + - get + - patch + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusterrestores + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - databaseclusterrestores/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusterrestores/status + verbs: + - get + - patch + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - databaseclusters/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - databaseclusters/status + verbs: + - get + - patch + - update +- apiGroups: + - everest.percona.com + resources: + - databaseengines + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - databaseengines/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - databaseengines/status + verbs: + - get + - patch + - update +- apiGroups: + - everest.percona.com + resources: + - monitoringconfigs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - everest.percona.com + resources: + - monitoringconfigs/finalizers + verbs: + - update +- apiGroups: + - everest.percona.com + resources: + - monitoringconfigs/status + verbs: + - get + - patch + - update +- apiGroups: + - operator.victoriametrics.com + resources: + - vmagents + verbs: + - create + - delete + - get + - update +- apiGroups: + - operators.coreos.com + resources: + - clusterserviceversions + verbs: + - get + - list + - update + - watch +- apiGroups: + - operators.coreos.com + resources: + - installplans + verbs: + - get + - list + - update + - watch +- apiGroups: + - operators.coreos.com + resources: + - subscriptions + verbs: + - get + - list + - watch +- apiGroups: + - pgv2.percona.com + resources: + - perconapgbackups + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - pgv2.percona.com + resources: + - perconapgclusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - pgv2.percona.com + resources: + - perconapgrestores + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - psmdb.percona.com + resources: + - perconaservermongodbbackups + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - psmdb.percona.com + resources: + - perconaservermongodbrestores + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - psmdb.percona.com + resources: + - perconaservermongodbs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - pxc.percona.com + resources: + - perconaxtradbclusterbackups + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - pxc.percona.com + resources: + - perconaxtradbclusterrestores + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - pxc.percona.com + resources: + - perconaxtradbclusters + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - list + - watch +- apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml new file mode 100644 index 00000000..b0cf08c4 --- /dev/null +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -0,0 +1,138 @@ +{{- $namespaceList := "" -}} +{{- range $index, $ns := .Values.dbNamespaces -}} + {{- if $index -}} + {{- $namespaceList = printf "%s,%s" $namespaceList $ns.name -}} + {{- else -}} + {{- $namespaceList = $ns.name -}} + {{- end -}} +{{- end -}} + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: everest-operator + namespace: {{ .Release.Namespace }} +spec: + replicas: 1 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: everest-operator + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + labels: + app: everest-operator + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - amd64 + - arm64 + - ppc64le + - s390x + - key: kubernetes.io/os + operator: In + values: + - linux + containers: + - args: + - --secure-listen-address=0.0.0.0:8443 + - --upstream=http://127.0.0.1:8080/ + - --logtostderr=true + - --v=0 + image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 + imagePullPolicy: IfNotPresent + name: kube-rbac-proxy + ports: + - containerPort: 8443 + name: https + protocol: TCP + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 5m + memory: 64Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - args: + - --health-probe-bind-address=:8081 + - --metrics-bind-address=127.0.0.1:8080 + - --leader-elect + command: + - /manager + env: + - name: SYSTEM_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: DISABLE_TELEMETRY + {{- if .Values.telemetry }} + value: "true" + {{- end }} + - name: MONITORING_NAMESPACE + value: {{ .Values.monitoring.namespace }} + - name: DB_NAMESPACES + value: {{ $namespaceList }} + image: {{ .Values.operator.image }}:{{ .Chart.Version }} + imagePullPolicy: IfNotPresent + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 8081 + scheme: HTTP + initialDelaySeconds: 15 + periodSeconds: 20 + successThreshold: 1 + timeoutSeconds: 1 + name: manager + readinessProbe: + failureThreshold: 3 + httpGet: + path: /readyz + port: 8081 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 10m + memory: 64Mi + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - ALL + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + runAsNonRoot: true + serviceAccount: everest-operator + serviceAccountName: everest-operator + terminationGracePeriodSeconds: 10 diff --git a/charts/everest/templates/everest-operator/metrics-service.yaml b/charts/everest/templates/everest-operator/metrics-service.yaml new file mode 100644 index 00000000..64c94593 --- /dev/null +++ b/charts/everest/templates/everest-operator/metrics-service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: everest-operator-metrics-service + namespace: {{ .Release.Namespace }} +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - name: https + port: 8443 + protocol: TCP + targetPort: https + selector: + app: everest-operator + sessionAffinity: None + type: ClusterIP diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml new file mode 100644 index 00000000..7b25e4ec --- /dev/null +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: everest-operator + namespace: {{ .Release.Namespace }} +subjects: +- kind: ServiceAccount + name: everest-operator + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: everest-operator + apiGroup: rbac.authorization.k8s.io diff --git a/charts/everest/templates/everest-operator/serviceaccount.yaml b/charts/everest/templates/everest-operator/serviceaccount.yaml new file mode 100644 index 00000000..0c1c1e49 --- /dev/null +++ b/charts/everest/templates/everest-operator/serviceaccount.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: everest-operator + namespace: {{ .Release.Namespace }} diff --git a/charts/everest/templates/server/clusterrole.yaml b/charts/everest/templates/everest-server/clusterrole.yaml similarity index 100% rename from charts/everest/templates/server/clusterrole.yaml rename to charts/everest/templates/everest-server/clusterrole.yaml diff --git a/charts/everest/templates/server/clusterrolebinding.yaml b/charts/everest/templates/everest-server/clusterrolebinding.yaml similarity index 100% rename from charts/everest/templates/server/clusterrolebinding.yaml rename to charts/everest/templates/everest-server/clusterrolebinding.yaml diff --git a/charts/everest/templates/server/configmaps.yaml b/charts/everest/templates/everest-server/configmaps.yaml similarity index 55% rename from charts/everest/templates/server/configmaps.yaml rename to charts/everest/templates/everest-server/configmaps.yaml index d8c6cb2d..3619fc07 100644 --- a/charts/everest/templates/server/configmaps.yaml +++ b/charts/everest/templates/everest-server/configmaps.yaml @@ -1,3 +1,4 @@ +{{- if not (lookup "v1" "ConfigMap" .Release.Namespace "everest-rbac" ) }} apiVersion: v1 kind: ConfigMap metadata: @@ -5,3 +6,4 @@ metadata: data: policy.csv: | g, admin, role:admin +{{- end }} diff --git a/charts/everest/templates/server/deployment.yaml b/charts/everest/templates/everest-server/deployment.yaml similarity index 80% rename from charts/everest/templates/server/deployment.yaml rename to charts/everest/templates/everest-server/deployment.yaml index fdec2b8d..0f121a2f 100644 --- a/charts/everest/templates/server/deployment.yaml +++ b/charts/everest/templates/everest-server/deployment.yaml @@ -1,3 +1,9 @@ +{{- if (ne .Release.Namespace "everest-system") }} +{{ fail "Namespace cannot be set to anything other than everest-system" }} +{{- end }} +{{- if not .Values.dbNamespaces }} +{{ fail "Need to specify at least one DB namespace" }} +{{- end }} apiVersion: apps/v1 kind: Deployment metadata: @@ -24,7 +30,7 @@ spec: secretName: everest-jwt containers: - name: everest - image: {{ .Values.image }}:{{ .Chart.Version }} + image: {{ .Values.server.image }}:{{ .Chart.Version }} ports: - containerPort: 8080 readinessProbe: diff --git a/charts/everest/templates/server/role.yaml b/charts/everest/templates/everest-server/role.yaml similarity index 100% rename from charts/everest/templates/server/role.yaml rename to charts/everest/templates/everest-server/role.yaml diff --git a/charts/everest/templates/server/rolebinding.yaml b/charts/everest/templates/everest-server/rolebinding.yaml similarity index 100% rename from charts/everest/templates/server/rolebinding.yaml rename to charts/everest/templates/everest-server/rolebinding.yaml diff --git a/charts/everest/templates/server/secrets.yaml b/charts/everest/templates/everest-server/secrets.yaml similarity index 59% rename from charts/everest/templates/server/secrets.yaml rename to charts/everest/templates/everest-server/secrets.yaml index 6c47922e..cbe8dd7a 100644 --- a/charts/everest/templates/server/secrets.yaml +++ b/charts/everest/templates/everest-server/secrets.yaml @@ -1,11 +1,15 @@ -{{- if .Release.IsInstall }} +{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-jwt" ) }} apiVersion: v1 kind: Secret metadata: name: everest-jwt + annotations: + helm.sh/resource-policy: keep data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} +{{- end }} --- +{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-accounts" ) }} apiVersion: v1 kind: Secret metadata: @@ -13,6 +17,7 @@ metadata: namespace: {{ .Release.Namespace }} annotations: insecure-password/admin: "true" + helm.sh/resource-policy: keep data: users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} {{- end }} diff --git a/charts/everest/templates/server/service.yaml b/charts/everest/templates/everest-server/service.yaml similarity index 100% rename from charts/everest/templates/server/service.yaml rename to charts/everest/templates/everest-server/service.yaml diff --git a/charts/everest/templates/server/serviceaccount.yaml b/charts/everest/templates/everest-server/serviceaccount.yaml similarity index 100% rename from charts/everest/templates/server/serviceaccount.yaml rename to charts/everest/templates/everest-server/serviceaccount.yaml diff --git a/charts/everest/templates/hooks.yaml b/charts/everest/templates/hooks.yaml deleted file mode 100644 index 09c5a43e..00000000 --- a/charts/everest/templates/hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -{{- include "common.preDeleteHook" . }} ---- -{{- include "common.postInstallHook" . }} ---- -{{- include "common.dbNamespaceLabelHook" . }} diff --git a/charts/everest/charts/common/templates/_pre_delete_hook.yaml b/charts/everest/templates/hooks/_csv_cleanup.tpl.yaml similarity index 80% rename from charts/everest/charts/common/templates/_pre_delete_hook.yaml rename to charts/everest/templates/hooks/_csv_cleanup.tpl.yaml index c1b65091..79c8e4d0 100644 --- a/charts/everest/charts/common/templates/_pre_delete_hook.yaml +++ b/charts/everest/templates/hooks/_csv_cleanup.tpl.yaml @@ -1,11 +1,13 @@ -{{- define "common.preDeleteHook" }} -{{- $ns := (tpl .Values.preDeleteHook.namespace . ) }} +# +# @param .namespace The namespace where the operator is installed +# +{{- define "everest.csvCleanup" }} {{- $hookName := printf "everest-helm-pre-delete-hook" }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded --- @@ -13,7 +15,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded rules: @@ -29,7 +31,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded roleRef: @@ -39,13 +41,13 @@ roleRef: subjects: - kind: ServiceAccount name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} --- apiVersion: batch/v1 kind: Job metadata: name: {{ $hookName }}-{{ randNumeric 6 }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook": pre-delete "helm.sh/hook-delete-policy": hook-succeeded @@ -60,10 +62,11 @@ spec: - /bin/sh - -c - | - kubectl delete csv -n {{ $ns }} --all --wait + kubectl delete csv -n {{ .namespace }} --all --wait dnsPolicy: ClusterFirst restartPolicy: OnFailure serviceAccount: {{ $hookName }} serviceAccountName: {{ $hookName }} terminationGracePeriodSeconds: 30 +--- {{- end }} diff --git a/charts/everest/charts/common/templates/_post_install_hook.yaml b/charts/everest/templates/hooks/_installplan_approver.tpl.yaml similarity index 69% rename from charts/everest/charts/common/templates/_post_install_hook.yaml rename to charts/everest/templates/hooks/_installplan_approver.tpl.yaml index 43611f67..5f9ad4c5 100644 --- a/charts/everest/charts/common/templates/_post_install_hook.yaml +++ b/charts/everest/templates/hooks/_installplan_approver.tpl.yaml @@ -1,11 +1,13 @@ -{{- define "common.postInstallHook" }} -{{- $ns := (tpl .Values.postInstallHook.namespace .) }} +# +# @param .namespace The namespace where the operator is installed +# +{{- define "everest.installplanApprover" }} {{- $hookName := "everest-helm-post-install-hook" }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded --- @@ -13,7 +15,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded rules: @@ -41,7 +43,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: "helm.sh/hook-delete-policy": hook-succeeded roleRef: @@ -51,15 +53,15 @@ roleRef: subjects: - kind: ServiceAccount name: {{ $hookName }} - namespace: {{ $ns }} + namespace: {{ .namespace }} --- apiVersion: batch/v1 kind: Job metadata: name: {{ $hookName }}-{{ randNumeric 6 }} - namespace: {{ $ns }} + namespace: {{ .namespace }} annotations: - "helm.sh/hook": post-install + "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-delete-policy": hook-succeeded spec: ttlSecondsAfterFinished: 60 @@ -72,29 +74,30 @@ spec: - /bin/sh - -c - | - subs=$(kubectl -n {{ $ns }} get subscription -o jsonpath='{.items[*].metadata.name}') + subs=$(kubectl -n {{ .namespace }} get subscription -o jsonpath='{.items[*].metadata.name}') for sub in $subs do echo "Waiting for InstallPlan to be created for Subscription $sub" - kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n {{ $ns }} --timeout=600s + kubectl wait --for=jsonpath='.status.installplan.name' sub/$sub -n {{ .namespace }} --timeout=600s - ip=$(kubectl -n {{ $ns }} get sub $sub -o jsonpath='{.status.installplan.name}') + ip=$(kubectl -n {{ .namespace }} get sub $sub -o jsonpath='{.status.installplan.name}') echo "InstallPlan $ip created for Subscription $sub" echo "Approving InstallPlan $ip" - kubectl -n {{ $ns }} patch installplan $ip --type='json' -p='[{"op": "replace", "path": "/spec/approved", "value": true}]' + kubectl -n {{ .namespace }} patch installplan $ip --type='json' -p='[{"op": "replace", "path": "/spec/approved", "value": true}]' echo "Waiting for InstallPlan to be complete $ip" - kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n {{ $ns }} --timeout=600s + kubectl wait --for=jsonpath='.status.phase'=Complete installplan/$ip -n {{ .namespace }} --timeout=600s - csv=$(kubectl get sub $sub -n {{ $ns }} -o jsonpath='{.status.installedCSV}') + csv=$(kubectl get sub $sub -n {{ .namespace }} -o jsonpath='{.status.installedCSV}') echo "Waiting for CSV $csv to succeed" - kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n {{ $ns }} --timeout=600s + kubectl wait --for=jsonpath='.status.phase'=Succeeded csv/$csv -n {{ .namespace }} --timeout=600s done dnsPolicy: ClusterFirst restartPolicy: OnFailure serviceAccount: {{ $hookName }} serviceAccountName: {{ $hookName }} terminationGracePeriodSeconds: 30 +--- {{- end }} diff --git a/charts/everest/templates/operator/operatorgroup.yaml b/charts/everest/templates/operator/operatorgroup.yaml deleted file mode 100644 index 1e6d58f0..00000000 --- a/charts/everest/templates/operator/operatorgroup.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: {{ .Release.Namespace }} -spec: - selector: - matchLabels: - everest.percona.com/managed-namespace: "true" - upgradeStrategy: Default diff --git a/charts/everest/templates/operator/subscription.yaml b/charts/everest/templates/operator/subscription.yaml deleted file mode 100644 index 3885d761..00000000 --- a/charts/everest/templates/operator/subscription.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: {{ .Release.Name }} -spec: - channel: {{ .Values.everestOperator.channel }} - installPlanApproval: Manual - name: everest-operator - source: everest-catalog - sourceNamespace: everest-olm - {{- if ne .Values.everestOperator.version "" }} - startingCSV: everest-operator.v{{ .Chart.Version }} - {{- end }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if .Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} - - name: MONITORING_NAMESPACE - value: everest-monitoring - - name: DB_NAMESPACES - value: test - diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index d67b73ce..3d326b99 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,24 +1,29 @@ -image: perconalab/everest +# Set to false to disable telemetry. telemetry: true -vmOperator: - channel: stable-v0 -everestOperator: - channel: fast-v0 -db-namespace: - # Do not set this to true when deploying the chart, - # unless you want everest-system to be a DB namespace. - # DB namespaces are provisioned as a separate (sub) chart. - enabled: false +# Config for Everest API server. +server: + image: perconalab/everest + +# Config for Everest Operator +operator: + image: perconalab/everest-operator + +# Config for OLM olm: + namespace: everest-olm enabled: true - everest: - catalogSourceImage: perconalab/everest-catalog + catalogSourceImage: perconalab/everest-catalog + image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + +# Config for Everest Monitoring monitoring: + namespace: everest-monitoring enabled: true -preDeleteHook: - namespace: '{{ .Release.Namespace }}' -postInstallHook: - namespace: '{{ .Release.Namespace }}' - +# DB Namespaces to be installed. +dbNamespaces: + # - name: everest + # psmdb: true + # pxc: true + # pg: true From a7174fcdd885fc1ec4a827f60ef88e03df81ce32 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 3 Oct 2024 11:30:30 +0530 Subject: [PATCH 13/64] Renaming Signed-off-by: Mayank Shah --- .../{_csv_cleanup.tpl.yaml => _csv_cleanup.yaml.tpl} | 0 ..._approver.tpl.yaml => _installplan_approver.yaml.tpl} | 0 charts/everest/values.yaml | 9 +++++---- 3 files changed, 5 insertions(+), 4 deletions(-) rename charts/everest/templates/hooks/{_csv_cleanup.tpl.yaml => _csv_cleanup.yaml.tpl} (100%) rename charts/everest/templates/hooks/{_installplan_approver.tpl.yaml => _installplan_approver.yaml.tpl} (100%) diff --git a/charts/everest/templates/hooks/_csv_cleanup.tpl.yaml b/charts/everest/templates/hooks/_csv_cleanup.yaml.tpl similarity index 100% rename from charts/everest/templates/hooks/_csv_cleanup.tpl.yaml rename to charts/everest/templates/hooks/_csv_cleanup.yaml.tpl diff --git a/charts/everest/templates/hooks/_installplan_approver.tpl.yaml b/charts/everest/templates/hooks/_installplan_approver.yaml.tpl similarity index 100% rename from charts/everest/templates/hooks/_installplan_approver.tpl.yaml rename to charts/everest/templates/hooks/_installplan_approver.yaml.tpl diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 3d326b99..83610f74 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -22,8 +22,9 @@ monitoring: enabled: true # DB Namespaces to be installed. +# Cannot be nil or empty. dbNamespaces: - # - name: everest - # psmdb: true - # pxc: true - # pg: true + - name: everest + psmdb: true + pxc: true + pg: true From d73bf60d6231cbcfe5894d779a5369b2ad0752bf Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 3 Oct 2024 11:34:56 +0530 Subject: [PATCH 14/64] Fix Makefile Signed-off-by: Mayank Shah --- charts/everest/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/everest/Makefile b/charts/everest/Makefile index 4ed8140f..c975e4dd 100644 --- a/charts/everest/Makefile +++ b/charts/everest/Makefile @@ -4,12 +4,12 @@ prepare-chart: release: prepare-chart - yq eval -i '.image = "percona/everest"' values.yaml + yq eval -i '.server.image = "percona/everest"' values.yaml yq eval -i '.olm.catalogSourceImage = "percona/everest-catalog"' values.yaml - yq eval -i '.everestOperator.channel = "stable-v0"' values.yaml + yq eval -i '.operator.image = "percona/everest-operator"' values.yaml release-dev: prepare-chart - yq eval -i '.image = "perconalab/everest"' values.yaml + yq eval -i '.server.image = "perconalab/everest"' values.yaml yq eval -i '.olm.catalogSourceImage = "perconalab/everest-catalog"' values.yaml - yq eval -i '.everestOperator.channel = "fast-v0"' values.yaml + yq eval -i '.operator.image = "perconalab/everest-operator"' values.yaml From 474bced7bceeacb37207266326ac1545e3ce4c9a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 3 Oct 2024 16:44:07 +0530 Subject: [PATCH 15/64] More refactoring Signed-off-by: Mayank Shah --- .../_everest_operator_rolebinding.yaml.tpl | 19 ++++++++++ .../templates/db-namespace/dbnamespace.yaml | 14 +------ .../everest-monitoring/rolebinding.yaml | 2 + .../everest-olm/packageserver.deployment.yaml | 1 - .../templates/everest-operator/role.yaml | 37 +++++++++++++++++++ .../everest-operator/rolebinding.yaml | 6 ++- 6 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 charts/everest/templates/_everest_operator_rolebinding.yaml.tpl create mode 100644 charts/everest/templates/everest-monitoring/rolebinding.yaml create mode 100644 charts/everest/templates/everest-operator/role.yaml diff --git a/charts/everest/templates/_everest_operator_rolebinding.yaml.tpl b/charts/everest/templates/_everest_operator_rolebinding.yaml.tpl new file mode 100644 index 00000000..6c743dc3 --- /dev/null +++ b/charts/everest/templates/_everest_operator_rolebinding.yaml.tpl @@ -0,0 +1,19 @@ +# +# @paramts .root Root object +# @param .namespace Namespace where this RoleBinding is created +# +{{- define "everest.operatorRoleBinding" }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: everest-operator + namespace: {{ .namespace }} +subjects: +- kind: ServiceAccount + name: everest-operator + namespace: {{ .root.Release.Namespace }} +roleRef: + kind: ClusterRole + name: everest-operator + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/charts/everest/templates/db-namespace/dbnamespace.yaml b/charts/everest/templates/db-namespace/dbnamespace.yaml index 432246de..e3be3637 100644 --- a/charts/everest/templates/db-namespace/dbnamespace.yaml +++ b/charts/everest/templates/db-namespace/dbnamespace.yaml @@ -82,18 +82,6 @@ spec: - {{ $ns.name }} upgradeStrategy: Default --- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: everest-operator - namespace: {{ $ns.name }} -subjects: -- kind: ServiceAccount - name: everest-operator - namespace: {{ $.Release.Namespace }} -roleRef: - kind: ClusterRole - name: everest-operator - apiGroup: rbac.authorization.k8s.io +{{- include "everest.operatorRoleBinding" (dict "root" $ "namespace" $ns.name) }} --- {{- end }} diff --git a/charts/everest/templates/everest-monitoring/rolebinding.yaml b/charts/everest/templates/everest-monitoring/rolebinding.yaml new file mode 100644 index 00000000..ebeaad01 --- /dev/null +++ b/charts/everest/templates/everest-monitoring/rolebinding.yaml @@ -0,0 +1,2 @@ +{{- include "everest.operatorRoleBinding" (dict "root" . "namespace" .Values.monitoring.namespace) }} + diff --git a/charts/everest/templates/everest-olm/packageserver.deployment.yaml b/charts/everest/templates/everest-olm/packageserver.deployment.yaml index 958b84ba..a7492161 100644 --- a/charts/everest/templates/everest-olm/packageserver.deployment.yaml +++ b/charts/everest/templates/everest-olm/packageserver.deployment.yaml @@ -1,7 +1,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - generation: 2 name: packageserver namespace: {{ .Values.olm.namespace }} spec: diff --git a/charts/everest/templates/everest-operator/role.yaml b/charts/everest/templates/everest-operator/role.yaml new file mode 100644 index 00000000..90759ec5 --- /dev/null +++ b/charts/everest/templates/everest-operator/role.yaml @@ -0,0 +1,37 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: everest-operator + namespace: {{ .Release.Namespace }} +rules: +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - delete + - patch +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - delete + - patch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml index 7b25e4ec..09cd8d96 100644 --- a/charts/everest/templates/everest-operator/rolebinding.yaml +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -1,13 +1,15 @@ +{{- include "everest.operatorRoleBinding" (dict "root" . "namespace" .Release.Namespace) }} +--- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: everest-operator + name: everest-operator-local namespace: {{ .Release.Namespace }} subjects: - kind: ServiceAccount name: everest-operator namespace: {{ .Release.Namespace }} roleRef: - kind: ClusterRole + kind: Role name: everest-operator apiGroup: rbac.authorization.k8s.io From 13a070940645024219716ab08c6c311acbe4b902 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Sat, 5 Oct 2024 15:15:34 +0530 Subject: [PATCH 16/64] Refactor into subcharts again Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 8 ++ charts/everest/charts/common/.helmignore | 23 +++++ charts/everest/charts/common/Chart.yaml | 6 ++ .../common/templates}/_csv_cleanup.yaml.tpl | 0 .../_everest_operator_rolebinding.yaml.tpl | 3 +- .../templates}/_installplan_approver.yaml.tpl | 0 charts/everest/charts/common/values.yaml | 0 .../everest/charts/db-namespace/.helmignore | 23 +++++ charts/everest/charts/db-namespace/Chart.lock | 6 ++ charts/everest/charts/db-namespace/Chart.yaml | 10 ++ .../db-namespace/charts/common-0.0.1.tgz | Bin 0 -> 1661 bytes .../charts/db-namespace/templates/hooks.yaml | 3 + .../db-namespace/templates/operatorgroup.yaml | 10 ++ .../templates/pg.subscription.yaml | 21 +++++ .../templates/psmdb.subscription.yaml | 21 +++++ .../templates/pxc.subscription.yaml | 21 +++++ .../db-namespace/templates/rolebinding.yaml | 1 + .../everest/charts/db-namespace/values.yaml | 6 ++ .../templates/db-namespace/dbnamespace.yaml | 87 ------------------ .../everest/templates/db-namespace/hooks.yaml | 5 - .../everest-monitoring/rolebinding.yaml | 2 +- .../everest-operator/deployment.yaml | 11 +-- .../everest-operator/rolebinding.yaml | 2 +- .../templates/everest-server/configmaps.yaml | 4 +- .../templates/everest-server/deployment.yaml | 3 - charts/everest/values.yaml | 14 ++- 26 files changed, 170 insertions(+), 120 deletions(-) create mode 100644 charts/everest/charts/common/.helmignore create mode 100644 charts/everest/charts/common/Chart.yaml rename charts/everest/{templates/hooks => charts/common/templates}/_csv_cleanup.yaml.tpl (100%) rename charts/everest/{ => charts/common}/templates/_everest_operator_rolebinding.yaml.tpl (76%) rename charts/everest/{templates/hooks => charts/common/templates}/_installplan_approver.yaml.tpl (100%) create mode 100644 charts/everest/charts/common/values.yaml create mode 100644 charts/everest/charts/db-namespace/.helmignore create mode 100644 charts/everest/charts/db-namespace/Chart.lock create mode 100644 charts/everest/charts/db-namespace/Chart.yaml create mode 100644 charts/everest/charts/db-namespace/charts/common-0.0.1.tgz create mode 100644 charts/everest/charts/db-namespace/templates/hooks.yaml create mode 100644 charts/everest/charts/db-namespace/templates/operatorgroup.yaml create mode 100644 charts/everest/charts/db-namespace/templates/pg.subscription.yaml create mode 100644 charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml create mode 100644 charts/everest/charts/db-namespace/templates/pxc.subscription.yaml create mode 100644 charts/everest/charts/db-namespace/templates/rolebinding.yaml create mode 100644 charts/everest/charts/db-namespace/values.yaml delete mode 100644 charts/everest/templates/db-namespace/dbnamespace.yaml delete mode 100644 charts/everest/templates/db-namespace/hooks.yaml diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 02208c0d..ffbef4e4 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -6,3 +6,11 @@ version: 0.0.0 appVersion: 0.0.0 type: application kubeVersion: ">=1.27.0-0" +dependencies: +- name: common + version: 0.0.1 + repository: "file://charts/" +- name: db-namespace + version: 0.0.1 + repository: "file://charts/" + condition: dbNamespace.enabled diff --git a/charts/everest/charts/common/.helmignore b/charts/everest/charts/common/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/everest/charts/common/.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/everest/charts/common/Chart.yaml b/charts/everest/charts/common/Chart.yaml new file mode 100644 index 00000000..fd7c6274 --- /dev/null +++ b/charts/everest/charts/common/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: common +description: A library chart for Everest containing common resources. +type: library +version: 0.0.1 +appVersion: "0.0.1" diff --git a/charts/everest/templates/hooks/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl similarity index 100% rename from charts/everest/templates/hooks/_csv_cleanup.yaml.tpl rename to charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl diff --git a/charts/everest/templates/_everest_operator_rolebinding.yaml.tpl b/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl similarity index 76% rename from charts/everest/templates/_everest_operator_rolebinding.yaml.tpl rename to charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl index 6c743dc3..1b50deb7 100644 --- a/charts/everest/templates/_everest_operator_rolebinding.yaml.tpl +++ b/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl @@ -1,6 +1,5 @@ # # @paramts .root Root object -# @param .namespace Namespace where this RoleBinding is created # {{- define "everest.operatorRoleBinding" }} apiVersion: rbac.authorization.k8s.io/v1 @@ -11,7 +10,7 @@ metadata: subjects: - kind: ServiceAccount name: everest-operator - namespace: {{ .root.Release.Namespace }} + namespace: everest-system roleRef: kind: ClusterRole name: everest-operator diff --git a/charts/everest/templates/hooks/_installplan_approver.yaml.tpl b/charts/everest/charts/common/templates/_installplan_approver.yaml.tpl similarity index 100% rename from charts/everest/templates/hooks/_installplan_approver.yaml.tpl rename to charts/everest/charts/common/templates/_installplan_approver.yaml.tpl diff --git a/charts/everest/charts/common/values.yaml b/charts/everest/charts/common/values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/everest/charts/db-namespace/.helmignore b/charts/everest/charts/db-namespace/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/everest/charts/db-namespace/.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/everest/charts/db-namespace/Chart.lock b/charts/everest/charts/db-namespace/Chart.lock new file mode 100644 index 00000000..6804aa43 --- /dev/null +++ b/charts/everest/charts/db-namespace/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../common + version: 0.0.1 +digest: sha256:a25c79b74ec6d89ca5c732e4222f8726ed02aa6a4a21f376afc499e53696c9b5 +generated: "2024-10-05T15:02:38.315401+05:30" diff --git a/charts/everest/charts/db-namespace/Chart.yaml b/charts/everest/charts/db-namespace/Chart.yaml new file mode 100644 index 00000000..b4f9b049 --- /dev/null +++ b/charts/everest/charts/db-namespace/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: db-namespace +description: A sub-chart for provisioning Everest DB namespaces. +type: application +version: 0.0.1 +appVersion: "0.0.1" +dependencies: +- name: common + version: 0.0.1 + repository: "file://../common" diff --git a/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz b/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..c14e09e11f076136da422660dc465167f70d58e2 GIT binary patch literal 1661 zcmV-@27>t?iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGrFZ{xTz&-xWpJAm(k)kmDHQwT87t?%}5eb`&959!0<5Kz?E z;zl9~l5(1J)8Af@l5AOy?d@ha>9(E+I~tP1`TmeYMNtSIPBNlQa8HW-Zej5h+)XQ4j^^UW%G3CXGYAft)3ZsC%H+VPGZ{{J21c+5i>Y5XKpwL*-PUP>WJg z)PcuIfpLxZ%)P|8q2w(#?|W&5{GUM`{|l0rsJ~JII28Z(?@s(*MOVl8e-5baZ?KR# zF{r~EsuwpjN5V_#{2?&%i9T__{ujg1>yG_LqtWZ5{htH+ULXD13)UV(pgD`26M7D02LOGkda8;~p72 zfR+pF;#il-N2I2<&ZAy$`P?P$eu2CCPKcq|TDN}_$zh%P%Oxnn(|2WoicuInUC+H3 z)*0YGH-nZ)EmdRkDN?~x{bpuRy=9!~4AU4!kzK9pU3GtR#zNi3qFQ;YRXr=n9AikB z;iO>UZJ8i7dF)E2S?$|riH3Sn5T3>@lqDY~jE6ewV13#_{Bz?Opk||vCZKu&KHt(f z_&&*V@clc&8eUVb-#Z1yFsXv}EmJE=Y%V6sG&_FbZwbpw)x@jb@W5T-Zti-wM==If z!MJmXpA@0^9u*U5ZM_&SBIl~Mcpy*hv6n8I|3k3d|JAklrb+xaHnAmDlKs4f@KFCh z8g}}>;qYR3dF=n51J?bY(Ex!G!ffUk_+U}O)uA0-UgIgPYP{97J-L`SEn;)ofhx1E zoIC60r_gOy^}RM&v}=4tv`(HIMf?$ppVAP#On%#r|GKA_IpH@%N+lMko;C;`i2qR( zU3KC=8l4~K|7U@(JO8zO=}qlQj}L;K2~cR`*JqD2;I}mcwoLx$UAwcwJNY&=*7%wVB^JNrFoEbop#48HGNH51Cx0mk9f((5dz zqJscHnhEIroiM}r+@1fqGVuGHa4-TA1gel2Ox^0V&85Agw?(oM)XwJM`!k`&Ygqzq zh$(fuj5=8cmhaFK+%fMPR-h=&coaolu>iIZOn#cip}KKX+dEj?R(GSmw#rVKJfyH4 zRH}BunxR8)w~8N=%oUw>&2lXHzPXn;9#}aC;LGvgw`EVrUJN~jGA9&!ub^i&U{Rrs zwXklLQ@i4RP3y&AREZD24|d6Lz>!2D-D{n_Lhbb%nGubH@uZ>Dk~4I29(JCsi>Y3; zyk*lf9wWEUTQHqWudSzif`TT~YdEEPVYO4I#;0jz+T>R&Qh2)i<=LKKN(IN`8?_^R zyHL;nf$c}woC}3t{*FWM|6X5ofBzkht}c%A|8qbe-VQ{k*NkbxQ?EYNq-I|~wW>zxIruzw51=HA)A zygpnL#YCy$=O2F5ULcilZ$$%^A_=SQN__N!g{C6K@R(JPaD*fLH^aXJ00960IbU8W H04x9i;9NPc literal 0 HcmV?d00001 diff --git a/charts/everest/charts/db-namespace/templates/hooks.yaml b/charts/everest/charts/db-namespace/templates/hooks.yaml new file mode 100644 index 00000000..46062baf --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/hooks.yaml @@ -0,0 +1,3 @@ +{{- include "everest.csvCleanup" (dict "namespace" .Release.Namespace) }} +--- +{{- include "everest.installplanApprover" (dict "namespace" .Release.Namespace) }} diff --git a/charts/everest/charts/db-namespace/templates/operatorgroup.yaml b/charts/everest/charts/db-namespace/templates/operatorgroup.yaml new file mode 100644 index 00000000..91a0f3fc --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/operatorgroup.yaml @@ -0,0 +1,10 @@ +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: database-operators + namespace: {{ .Release.Namespace }} +spec: + targetNamespaces: + - {{ .Release.Namespace }} + upgradeStrategy: Default + diff --git a/charts/everest/charts/db-namespace/templates/pg.subscription.yaml b/charts/everest/charts/db-namespace/templates/pg.subscription.yaml new file mode 100644 index 00000000..33aeacdb --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/pg.subscription.yaml @@ -0,0 +1,21 @@ +{{- if .Values.pg }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-postgresql-operator + namespace: {{ .Release.Namespace }} +spec: + channel: stable-v2 + installPlanApproval: Manual + name: percona-postgresql-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} diff --git a/charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml b/charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml new file mode 100644 index 00000000..2b171bdd --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml @@ -0,0 +1,21 @@ +{{- if .Values.psmdb }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-server-mongodb-operator + namespace: {{ .Release.Namespace }} +spec: + channel: stable-v1 + installPlanApproval: Manual + name: percona-server-mongodb-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} diff --git a/charts/everest/charts/db-namespace/templates/pxc.subscription.yaml b/charts/everest/charts/db-namespace/templates/pxc.subscription.yaml new file mode 100644 index 00000000..375f74fa --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/pxc.subscription.yaml @@ -0,0 +1,21 @@ +{{- if .Values.pxc }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-xtradb-cluster-operator + namespace: {{ .Release.Namespace }} +spec: + channel: stable-v1 + installPlanApproval: Manual + name: percona-xtradb-cluster-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +{{- end }} diff --git a/charts/everest/charts/db-namespace/templates/rolebinding.yaml b/charts/everest/charts/db-namespace/templates/rolebinding.yaml new file mode 100644 index 00000000..91a4f198 --- /dev/null +++ b/charts/everest/charts/db-namespace/templates/rolebinding.yaml @@ -0,0 +1 @@ +{{- include "everest.operatorRoleBinding" (dict "namespace" .Release.Namespace) }} diff --git a/charts/everest/charts/db-namespace/values.yaml b/charts/everest/charts/db-namespace/values.yaml new file mode 100644 index 00000000..3fd85751 --- /dev/null +++ b/charts/everest/charts/db-namespace/values.yaml @@ -0,0 +1,6 @@ +psmdb: true +pxc: true +pg: true +telemetry: true +olm: + namespace: everest-olm diff --git a/charts/everest/templates/db-namespace/dbnamespace.yaml b/charts/everest/templates/db-namespace/dbnamespace.yaml deleted file mode 100644 index e3be3637..00000000 --- a/charts/everest/templates/db-namespace/dbnamespace.yaml +++ /dev/null @@ -1,87 +0,0 @@ -{{- range $i, $ns := .Values.dbNamespaces }} -apiVersion: v1 -kind: Namespace -metadata: - name: {{ $ns.name }} - labels: - app.kubernetes.io/managed-by: everest ---- -{{- if $ns.psmdb }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-server-mongodb-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v1 - installPlanApproval: Manual - name: percona-server-mongodb-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -{{- if $ns.pxc }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-xtradb-cluster-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v1 - installPlanApproval: Manual - name: percona-xtradb-cluster-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -{{- if $ns.pg }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-postgresql-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v2 - installPlanApproval: Manual - name: percona-postgresql-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: database-operators - namespace: {{ $ns.name }} -spec: - targetNamespaces: - - {{ $ns.name }} - upgradeStrategy: Default ---- -{{- include "everest.operatorRoleBinding" (dict "root" $ "namespace" $ns.name) }} ---- -{{- end }} diff --git a/charts/everest/templates/db-namespace/hooks.yaml b/charts/everest/templates/db-namespace/hooks.yaml deleted file mode 100644 index 440ad4bc..00000000 --- a/charts/everest/templates/db-namespace/hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -{{- range $i, $ns := .Values.dbNamespaces }} -{{- include "everest.csvCleanup" (dict "namespace" $ns.name) }} ---- -{{- include "everest.installplanApprover" (dict "namespace" $ns.name) }} -{{- end }} diff --git a/charts/everest/templates/everest-monitoring/rolebinding.yaml b/charts/everest/templates/everest-monitoring/rolebinding.yaml index ebeaad01..785e2609 100644 --- a/charts/everest/templates/everest-monitoring/rolebinding.yaml +++ b/charts/everest/templates/everest-monitoring/rolebinding.yaml @@ -1,2 +1,2 @@ -{{- include "everest.operatorRoleBinding" (dict "root" . "namespace" .Values.monitoring.namespace) }} +{{- include "everest.operatorRoleBinding" (dict "namespace" .Values.monitoring.namespace) }} diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml index b0cf08c4..31fe015f 100644 --- a/charts/everest/templates/everest-operator/deployment.yaml +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -1,12 +1,3 @@ -{{- $namespaceList := "" -}} -{{- range $index, $ns := .Values.dbNamespaces -}} - {{- if $index -}} - {{- $namespaceList = printf "%s,%s" $namespaceList $ns.name -}} - {{- else -}} - {{- $namespaceList = $ns.name -}} - {{- end -}} -{{- end -}} - apiVersion: apps/v1 kind: Deployment metadata: @@ -90,7 +81,7 @@ spec: - name: MONITORING_NAMESPACE value: {{ .Values.monitoring.namespace }} - name: DB_NAMESPACES - value: {{ $namespaceList }} + value: everest #TODO image: {{ .Values.operator.image }}:{{ .Chart.Version }} imagePullPolicy: IfNotPresent livenessProbe: diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml index 09cd8d96..e186d163 100644 --- a/charts/everest/templates/everest-operator/rolebinding.yaml +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -1,4 +1,4 @@ -{{- include "everest.operatorRoleBinding" (dict "root" . "namespace" .Release.Namespace) }} +{{- include "everest.operatorRoleBinding" (dict "namespace" .Release.Namespace) }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/charts/everest/templates/everest-server/configmaps.yaml b/charts/everest/templates/everest-server/configmaps.yaml index 3619fc07..d9b0a2b3 100644 --- a/charts/everest/templates/everest-server/configmaps.yaml +++ b/charts/everest/templates/everest-server/configmaps.yaml @@ -1,9 +1,7 @@ -{{- if not (lookup "v1" "ConfigMap" .Release.Namespace "everest-rbac" ) }} apiVersion: v1 kind: ConfigMap metadata: name: everest-rbac data: policy.csv: | - g, admin, role:admin -{{- end }} + {{- .Values.rbac | nindent 4 }} diff --git a/charts/everest/templates/everest-server/deployment.yaml b/charts/everest/templates/everest-server/deployment.yaml index 0f121a2f..5f9b93e6 100644 --- a/charts/everest/templates/everest-server/deployment.yaml +++ b/charts/everest/templates/everest-server/deployment.yaml @@ -1,9 +1,6 @@ {{- if (ne .Release.Namespace "everest-system") }} {{ fail "Namespace cannot be set to anything other than everest-system" }} {{- end }} -{{- if not .Values.dbNamespaces }} -{{ fail "Need to specify at least one DB namespace" }} -{{- end }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 83610f74..b3c62100 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -9,6 +9,12 @@ server: operator: image: perconalab/everest-operator +rbac: | + g, admin role:admin + +dbNamespace: + enabled: false + # Config for OLM olm: namespace: everest-olm @@ -20,11 +26,3 @@ olm: monitoring: namespace: everest-monitoring enabled: true - -# DB Namespaces to be installed. -# Cannot be nil or empty. -dbNamespaces: - - name: everest - psmdb: true - pxc: true - pg: true From e71a3136ec6dab5516b93abe41c6c40fcf3c6682 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 7 Oct 2024 16:24:26 +0530 Subject: [PATCH 17/64] More changes Signed-off-by: Mayank Shah --- charts/everest/Chart.lock | 9 ++ charts/everest/Chart.yaml | 6 +- .../_everest_operator_rolebinding.yaml.tpl | 2 +- .../db-namespace/charts/common-0.0.1.tgz | Bin 1661 -> 0 bytes .../.helmignore | 0 .../Chart.lock | 0 .../Chart.yaml | 2 +- .../templates/hooks.yaml | 0 .../templates/operatorgroup.yaml | 0 .../templates/pg.subscription.yaml | 0 .../templates/psmdb.subscription.yaml | 0 .../templates/pxc.subscription.yaml | 0 .../templates/rolebinding.yaml | 0 .../values.yaml | 0 charts/everest/templates/_helpers.tpl | 7 ++ .../templates/db-namespace/dbnamespace.yaml | 87 ++++++++++++++++++ .../everest/templates/db-namespace/hooks.yaml | 5 + ...rics-service.yaml => metrics.service.yaml} | 0 .../{secrets.yaml => accounts.secret.yaml} | 11 --- .../templates/everest-server/jwt.secret.yaml | 10 ++ .../{configmaps.yaml => rbac.configmaps.yaml} | 2 +- charts/everest/values.yaml | 12 +-- 22 files changed, 128 insertions(+), 25 deletions(-) create mode 100644 charts/everest/Chart.lock delete mode 100644 charts/everest/charts/db-namespace/charts/common-0.0.1.tgz rename charts/everest/charts/{db-namespace => everest-db-namespace}/.helmignore (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/Chart.lock (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/Chart.yaml (88%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/hooks.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/operatorgroup.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/pg.subscription.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/psmdb.subscription.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/pxc.subscription.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/templates/rolebinding.yaml (100%) rename charts/everest/charts/{db-namespace => everest-db-namespace}/values.yaml (100%) create mode 100644 charts/everest/templates/db-namespace/dbnamespace.yaml create mode 100644 charts/everest/templates/db-namespace/hooks.yaml rename charts/everest/templates/everest-operator/{metrics-service.yaml => metrics.service.yaml} (100%) rename charts/everest/templates/everest-server/{secrets.yaml => accounts.secret.yaml} (58%) create mode 100644 charts/everest/templates/everest-server/jwt.secret.yaml rename charts/everest/templates/everest-server/{configmaps.yaml => rbac.configmaps.yaml} (66%) diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock new file mode 100644 index 00000000..fe91a677 --- /dev/null +++ b/charts/everest/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: common + repository: file://common + version: 0.0.1 +- name: everest-db-namespace + repository: file://everest-db-namespace + version: 0.0.1 +digest: sha256:19b92c0f49ea7126347ab71d3f42a82587f01c8c2b3109d932c423f02b446436 +generated: "2024-10-07T10:40:42.36764+05:30" diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index ffbef4e4..f8303fc8 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -9,8 +9,4 @@ kubeVersion: ">=1.27.0-0" dependencies: - name: common version: 0.0.1 - repository: "file://charts/" -- name: db-namespace - version: 0.0.1 - repository: "file://charts/" - condition: dbNamespace.enabled + repository: "file://charts/common" diff --git a/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl b/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl index 1b50deb7..6bb6f643 100644 --- a/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl +++ b/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl @@ -1,5 +1,5 @@ # -# @paramts .root Root object +# @params .namespace Namespace where this RoleBinding should be created # {{- define "everest.operatorRoleBinding" }} apiVersion: rbac.authorization.k8s.io/v1 diff --git a/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz b/charts/everest/charts/db-namespace/charts/common-0.0.1.tgz deleted file mode 100644 index c14e09e11f076136da422660dc465167f70d58e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1661 zcmV-@27>t?iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PGrFZ{xTz&-xWpJAm(k)kmDHQwT87t?%}5eb`&959!0<5Kz?E z;zl9~l5(1J)8Af@l5AOy?d@ha>9(E+I~tP1`TmeYMNtSIPBNlQa8HW-Zej5h+)XQ4j^^UW%G3CXGYAft)3ZsC%H+VPGZ{{J21c+5i>Y5XKpwL*-PUP>WJg z)PcuIfpLxZ%)P|8q2w(#?|W&5{GUM`{|l0rsJ~JII28Z(?@s(*MOVl8e-5baZ?KR# zF{r~EsuwpjN5V_#{2?&%i9T__{ujg1>yG_LqtWZ5{htH+ULXD13)UV(pgD`26M7D02LOGkda8;~p72 zfR+pF;#il-N2I2<&ZAy$`P?P$eu2CCPKcq|TDN}_$zh%P%Oxnn(|2WoicuInUC+H3 z)*0YGH-nZ)EmdRkDN?~x{bpuRy=9!~4AU4!kzK9pU3GtR#zNi3qFQ;YRXr=n9AikB z;iO>UZJ8i7dF)E2S?$|riH3Sn5T3>@lqDY~jE6ewV13#_{Bz?Opk||vCZKu&KHt(f z_&&*V@clc&8eUVb-#Z1yFsXv}EmJE=Y%V6sG&_FbZwbpw)x@jb@W5T-Zti-wM==If z!MJmXpA@0^9u*U5ZM_&SBIl~Mcpy*hv6n8I|3k3d|JAklrb+xaHnAmDlKs4f@KFCh z8g}}>;qYR3dF=n51J?bY(Ex!G!ffUk_+U}O)uA0-UgIgPYP{97J-L`SEn;)ofhx1E zoIC60r_gOy^}RM&v}=4tv`(HIMf?$ppVAP#On%#r|GKA_IpH@%N+lMko;C;`i2qR( zU3KC=8l4~K|7U@(JO8zO=}qlQj}L;K2~cR`*JqD2;I}mcwoLx$UAwcwJNY&=*7%wVB^JNrFoEbop#48HGNH51Cx0mk9f((5dz zqJscHnhEIroiM}r+@1fqGVuGHa4-TA1gel2Ox^0V&85Agw?(oM)XwJM`!k`&Ygqzq zh$(fuj5=8cmhaFK+%fMPR-h=&coaolu>iIZOn#cip}KKX+dEj?R(GSmw#rVKJfyH4 zRH}BunxR8)w~8N=%oUw>&2lXHzPXn;9#}aC;LGvgw`EVrUJN~jGA9&!ub^i&U{Rrs zwXklLQ@i4RP3y&AREZD24|d6Lz>!2D-D{n_Lhbb%nGubH@uZ>Dk~4I29(JCsi>Y3; zyk*lf9wWEUTQHqWudSzif`TT~YdEEPVYO4I#;0jz+T>R&Qh2)i<=LKKN(IN`8?_^R zyHL;nf$c}woC}3t{*FWM|6X5ofBzkht}c%A|8qbe-VQ{k*NkbxQ?EYNq-I|~wW>zxIruzw51=HA)A zygpnL#YCy$=O2F5ULcilZ$$%^A_=SQN__N!g{C6K@R(JPaD*fLH^aXJ00960IbU8W H04x9i;9NPc diff --git a/charts/everest/charts/db-namespace/.helmignore b/charts/everest/charts/everest-db-namespace/.helmignore similarity index 100% rename from charts/everest/charts/db-namespace/.helmignore rename to charts/everest/charts/everest-db-namespace/.helmignore diff --git a/charts/everest/charts/db-namespace/Chart.lock b/charts/everest/charts/everest-db-namespace/Chart.lock similarity index 100% rename from charts/everest/charts/db-namespace/Chart.lock rename to charts/everest/charts/everest-db-namespace/Chart.lock diff --git a/charts/everest/charts/db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml similarity index 88% rename from charts/everest/charts/db-namespace/Chart.yaml rename to charts/everest/charts/everest-db-namespace/Chart.yaml index b4f9b049..45f601b2 100644 --- a/charts/everest/charts/db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: db-namespace +name: everest-db-namespace description: A sub-chart for provisioning Everest DB namespaces. type: application version: 0.0.1 diff --git a/charts/everest/charts/db-namespace/templates/hooks.yaml b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/hooks.yaml rename to charts/everest/charts/everest-db-namespace/templates/hooks.yaml diff --git a/charts/everest/charts/db-namespace/templates/operatorgroup.yaml b/charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/operatorgroup.yaml rename to charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml diff --git a/charts/everest/charts/db-namespace/templates/pg.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/pg.subscription.yaml rename to charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml diff --git a/charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/psmdb.subscription.yaml rename to charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml diff --git a/charts/everest/charts/db-namespace/templates/pxc.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/pxc.subscription.yaml rename to charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml diff --git a/charts/everest/charts/db-namespace/templates/rolebinding.yaml b/charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml similarity index 100% rename from charts/everest/charts/db-namespace/templates/rolebinding.yaml rename to charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml diff --git a/charts/everest/charts/db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml similarity index 100% rename from charts/everest/charts/db-namespace/values.yaml rename to charts/everest/charts/everest-db-namespace/values.yaml diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index 5b80367f..1e344cd2 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -5,6 +5,13 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Allows overriding the install namespace in combined charts. +*/}} +{{- define "everest.namepace" -}} +{{- default .Release.Namespace .Values.namespaceOverride | 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). diff --git a/charts/everest/templates/db-namespace/dbnamespace.yaml b/charts/everest/templates/db-namespace/dbnamespace.yaml new file mode 100644 index 00000000..e3be3637 --- /dev/null +++ b/charts/everest/templates/db-namespace/dbnamespace.yaml @@ -0,0 +1,87 @@ +{{- range $i, $ns := .Values.dbNamespaces }} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ $ns.name }} + labels: + app.kubernetes.io/managed-by: everest +--- +{{- if $ns.psmdb }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-server-mongodb-operator + namespace: {{ $ns.name }} +spec: + channel: stable-v1 + installPlanApproval: Manual + name: percona-server-mongodb-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +--- +{{- end }} +{{- if $ns.pxc }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-xtradb-cluster-operator + namespace: {{ $ns.name }} +spec: + channel: stable-v1 + installPlanApproval: Manual + name: percona-xtradb-cluster-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +--- +{{- end }} +{{- if $ns.pg }} +apiVersion: operators.coreos.com/v1alpha1 +kind: Subscription +metadata: + name: percona-postgresql-operator + namespace: {{ $ns.name }} +spec: + channel: stable-v2 + installPlanApproval: Manual + name: percona-postgresql-operator + source: everest-catalog + sourceNamespace: {{ $.Values.olm.namespace }} + config: + env: + - name: DISABLE_TELEMETRY + {{- if $.Values.telemetry }} + value: "true" + {{- else }} + value: "false" + {{- end }} +--- +{{- end }} +apiVersion: operators.coreos.com/v1 +kind: OperatorGroup +metadata: + name: database-operators + namespace: {{ $ns.name }} +spec: + targetNamespaces: + - {{ $ns.name }} + upgradeStrategy: Default +--- +{{- include "everest.operatorRoleBinding" (dict "root" $ "namespace" $ns.name) }} +--- +{{- end }} diff --git a/charts/everest/templates/db-namespace/hooks.yaml b/charts/everest/templates/db-namespace/hooks.yaml new file mode 100644 index 00000000..440ad4bc --- /dev/null +++ b/charts/everest/templates/db-namespace/hooks.yaml @@ -0,0 +1,5 @@ +{{- range $i, $ns := .Values.dbNamespaces }} +{{- include "everest.csvCleanup" (dict "namespace" $ns.name) }} +--- +{{- include "everest.installplanApprover" (dict "namespace" $ns.name) }} +{{- end }} diff --git a/charts/everest/templates/everest-operator/metrics-service.yaml b/charts/everest/templates/everest-operator/metrics.service.yaml similarity index 100% rename from charts/everest/templates/everest-operator/metrics-service.yaml rename to charts/everest/templates/everest-operator/metrics.service.yaml diff --git a/charts/everest/templates/everest-server/secrets.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml similarity index 58% rename from charts/everest/templates/everest-server/secrets.yaml rename to charts/everest/templates/everest-server/accounts.secret.yaml index cbe8dd7a..71327038 100644 --- a/charts/everest/templates/everest-server/secrets.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -1,14 +1,3 @@ -{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-jwt" ) }} -apiVersion: v1 -kind: Secret -metadata: - name: everest-jwt - annotations: - helm.sh/resource-policy: keep -data: - id_rsa: {{ genPrivateKey "rsa" | b64enc }} -{{- end }} ---- {{- if not (lookup "v1" "Secret" .Release.Namespace "everest-accounts" ) }} apiVersion: v1 kind: Secret diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml new file mode 100644 index 00000000..f273aa6f --- /dev/null +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -0,0 +1,10 @@ +{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-jwt" ) }} +apiVersion: v1 +kind: Secret +metadata: + name: everest-jwt + annotations: + helm.sh/resource-policy: keep +data: + id_rsa: {{ genPrivateKey "rsa" | b64enc }} +{{- end }} diff --git a/charts/everest/templates/everest-server/configmaps.yaml b/charts/everest/templates/everest-server/rbac.configmaps.yaml similarity index 66% rename from charts/everest/templates/everest-server/configmaps.yaml rename to charts/everest/templates/everest-server/rbac.configmaps.yaml index d9b0a2b3..4c1b34dc 100644 --- a/charts/everest/templates/everest-server/configmaps.yaml +++ b/charts/everest/templates/everest-server/rbac.configmaps.yaml @@ -4,4 +4,4 @@ metadata: name: everest-rbac data: policy.csv: | - {{- .Values.rbac | nindent 4 }} + {{- .Values.server.rbac | nindent 4 }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index b3c62100..8f9676f2 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,20 +1,20 @@ +# Override the install namespace. +# Defaults to .Release.Namespace +namespaceOverride: "" + # Set to false to disable telemetry. telemetry: true # Config for Everest API server. server: image: perconalab/everest + rbac: | + g, admin, role:admin # Config for Everest Operator operator: image: perconalab/everest-operator -rbac: | - g, admin role:admin - -dbNamespace: - enabled: false - # Config for OLM olm: namespace: everest-olm From 1d3be06ea78ead8dcc2536fc2466c2a2d541dda4 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 7 Oct 2024 16:38:00 +0530 Subject: [PATCH 18/64] More fixes Signed-off-by: Mayank Shah --- .gitignore | 1 + charts/everest/Chart.lock | 9 +- .../templates/_helpers.tpl | 6 ++ .../everest-db-namespace/templates/hooks.yaml | 4 +- .../charts/everest-db-namespace/values.yaml | 3 + charts/everest/templates/_helpers.tpl | 2 +- .../templates/db-namespace/dbnamespace.yaml | 87 ------------------- .../everest/templates/db-namespace/hooks.yaml | 5 -- .../everest-operator/deployment.yaml | 2 +- .../everest-operator/metrics.service.yaml | 2 +- .../templates/everest-operator/role.yaml | 2 +- .../everest-operator/rolebinding.yaml | 4 +- .../everest-operator/serviceaccount.yaml | 2 +- .../everest-server/accounts.secret.yaml | 2 +- .../templates/everest-server/deployment.yaml | 3 +- .../templates/everest-server/jwt.secret.yaml | 3 +- .../everest-server/rbac.configmaps.yaml | 1 + .../templates/everest-server/role.yaml | 1 + .../templates/everest-server/rolebinding.yaml | 1 + .../templates/everest-server/service.yaml | 1 + .../everest-server/serviceaccount.yaml | 1 + 21 files changed, 31 insertions(+), 111 deletions(-) create mode 100644 charts/everest/charts/everest-db-namespace/templates/_helpers.tpl delete mode 100644 charts/everest/templates/db-namespace/dbnamespace.yaml delete mode 100644 charts/everest/templates/db-namespace/hooks.yaml diff --git a/.gitignore b/.gitignore index e0c0543a..cb8e6e0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .deploy/ .idea/ +*.tgz diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock index fe91a677..d5cf3800 100644 --- a/charts/everest/Chart.lock +++ b/charts/everest/Chart.lock @@ -1,9 +1,6 @@ dependencies: - name: common - repository: file://common + repository: file://charts/common version: 0.0.1 -- name: everest-db-namespace - repository: file://everest-db-namespace - version: 0.0.1 -digest: sha256:19b92c0f49ea7126347ab71d3f42a82587f01c8c2b3109d932c423f02b446436 -generated: "2024-10-07T10:40:42.36764+05:30" +digest: sha256:dd964587205aac5398fd33451dc5bd10a0169694286db38a10a963a352f46aed +generated: "2024-10-07T16:36:08.628446+05:30" diff --git a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl new file mode 100644 index 00000000..03690fb3 --- /dev/null +++ b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl @@ -0,0 +1,6 @@ +{{/* +Allows overriding the install namespace in combined charts. +*/}} +{{- define "db.namespace" -}} +{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }} +{{- end }} diff --git a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml index 46062baf..b546224a 100644 --- a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml @@ -1,3 +1,3 @@ -{{- include "everest.csvCleanup" (dict "namespace" .Release.Namespace) }} +{{- include "everest.csvCleanup" (dict "namespace" (include "db.namespace" .)) }} --- -{{- include "everest.installplanApprover" (dict "namespace" .Release.Namespace) }} +{{- include "everest.installplanApprover" (dict "namespace" (include "db.namespace" .)) }} diff --git a/charts/everest/charts/everest-db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml index 3fd85751..938184b5 100644 --- a/charts/everest/charts/everest-db-namespace/values.yaml +++ b/charts/everest/charts/everest-db-namespace/values.yaml @@ -1,3 +1,6 @@ +# Override the install namespace. +# Defaults to .Release.Namespace +namespaceOverride: "" psmdb: true pxc: true pg: true diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index 1e344cd2..0392bf2e 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -8,7 +8,7 @@ Expand the name of the chart. {{/* Allows overriding the install namespace in combined charts. */}} -{{- define "everest.namepace" -}} +{{- define "everest.namespace" -}} {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }} {{- end }} diff --git a/charts/everest/templates/db-namespace/dbnamespace.yaml b/charts/everest/templates/db-namespace/dbnamespace.yaml deleted file mode 100644 index e3be3637..00000000 --- a/charts/everest/templates/db-namespace/dbnamespace.yaml +++ /dev/null @@ -1,87 +0,0 @@ -{{- range $i, $ns := .Values.dbNamespaces }} -apiVersion: v1 -kind: Namespace -metadata: - name: {{ $ns.name }} - labels: - app.kubernetes.io/managed-by: everest ---- -{{- if $ns.psmdb }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-server-mongodb-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v1 - installPlanApproval: Manual - name: percona-server-mongodb-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -{{- if $ns.pxc }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-xtradb-cluster-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v1 - installPlanApproval: Manual - name: percona-xtradb-cluster-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -{{- if $ns.pg }} -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: percona-postgresql-operator - namespace: {{ $ns.name }} -spec: - channel: stable-v2 - installPlanApproval: Manual - name: percona-postgresql-operator - source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} - config: - env: - - name: DISABLE_TELEMETRY - {{- if $.Values.telemetry }} - value: "true" - {{- else }} - value: "false" - {{- end }} ---- -{{- end }} -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: database-operators - namespace: {{ $ns.name }} -spec: - targetNamespaces: - - {{ $ns.name }} - upgradeStrategy: Default ---- -{{- include "everest.operatorRoleBinding" (dict "root" $ "namespace" $ns.name) }} ---- -{{- end }} diff --git a/charts/everest/templates/db-namespace/hooks.yaml b/charts/everest/templates/db-namespace/hooks.yaml deleted file mode 100644 index 440ad4bc..00000000 --- a/charts/everest/templates/db-namespace/hooks.yaml +++ /dev/null @@ -1,5 +0,0 @@ -{{- range $i, $ns := .Values.dbNamespaces }} -{{- include "everest.csvCleanup" (dict "namespace" $ns.name) }} ---- -{{- include "everest.installplanApprover" (dict "namespace" $ns.name) }} -{{- end }} diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml index 31fe015f..b0e925a0 100644 --- a/charts/everest/templates/everest-operator/deployment.yaml +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -2,7 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: everest-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} spec: replicas: 1 revisionHistoryLimit: 1 diff --git a/charts/everest/templates/everest-operator/metrics.service.yaml b/charts/everest/templates/everest-operator/metrics.service.yaml index 64c94593..96065b50 100644 --- a/charts/everest/templates/everest-operator/metrics.service.yaml +++ b/charts/everest/templates/everest-operator/metrics.service.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: everest-operator-metrics-service - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} spec: internalTrafficPolicy: Cluster ipFamilies: diff --git a/charts/everest/templates/everest-operator/role.yaml b/charts/everest/templates/everest-operator/role.yaml index 90759ec5..e6e5c535 100644 --- a/charts/everest/templates/everest-operator/role.yaml +++ b/charts/everest/templates/everest-operator/role.yaml @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: everest-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} rules: - apiGroups: - "" diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml index e186d163..a0425aae 100644 --- a/charts/everest/templates/everest-operator/rolebinding.yaml +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -1,10 +1,10 @@ -{{- include "everest.operatorRoleBinding" (dict "namespace" .Release.Namespace) }} +{{- include "everest.operatorRoleBinding" (dict "namespace" (include ".everest.namespace" . )) }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: everest-operator-local - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} subjects: - kind: ServiceAccount name: everest-operator diff --git a/charts/everest/templates/everest-operator/serviceaccount.yaml b/charts/everest/templates/everest-operator/serviceaccount.yaml index 0c1c1e49..d30dcd27 100644 --- a/charts/everest/templates/everest-operator/serviceaccount.yaml +++ b/charts/everest/templates/everest-operator/serviceaccount.yaml @@ -2,4 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: everest-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 71327038..485870be 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Secret metadata: name: everest-accounts - namespace: {{ .Release.Namespace }} + namespace: {{ include "everest.namespace" . }} annotations: insecure-password/admin: "true" helm.sh/resource-policy: keep diff --git a/charts/everest/templates/everest-server/deployment.yaml b/charts/everest/templates/everest-server/deployment.yaml index 5f9b93e6..ed18c21f 100644 --- a/charts/everest/templates/everest-server/deployment.yaml +++ b/charts/everest/templates/everest-server/deployment.yaml @@ -1,10 +1,11 @@ -{{- if (ne .Release.Namespace "everest-system") }} +{{- if (ne (include "everest.namespace" .) "everest-system") }} {{ fail "Namespace cannot be set to anything other than everest-system" }} {{- end }} apiVersion: apps/v1 kind: Deployment metadata: name: percona-everest + namespace: {{ include "everest.namespace" . }} spec: replicas: 1 strategy: diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index f273aa6f..1b1a3628 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -1,10 +1,9 @@ -{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-jwt" ) }} apiVersion: v1 kind: Secret metadata: name: everest-jwt + namespace: {{ include "everest.namespace" . }} annotations: helm.sh/resource-policy: keep data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} -{{- end }} diff --git a/charts/everest/templates/everest-server/rbac.configmaps.yaml b/charts/everest/templates/everest-server/rbac.configmaps.yaml index 4c1b34dc..4d29dfcb 100644 --- a/charts/everest/templates/everest-server/rbac.configmaps.yaml +++ b/charts/everest/templates/everest-server/rbac.configmaps.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: everest-rbac + namespace: {{ include "everest.namespace" . }} data: policy.csv: | {{- .Values.server.rbac | nindent 4 }} diff --git a/charts/everest/templates/everest-server/role.yaml b/charts/everest/templates/everest-server/role.yaml index 2ea10b38..85665647 100644 --- a/charts/everest/templates/everest-server/role.yaml +++ b/charts/everest/templates/everest-server/role.yaml @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: everest-admin-role + namespace: {{ include "everest.namespace" . }} rules: - apiGroups: [""] resources: ["namespaces"] diff --git a/charts/everest/templates/everest-server/rolebinding.yaml b/charts/everest/templates/everest-server/rolebinding.yaml index e4ec201c..3589609d 100644 --- a/charts/everest/templates/everest-server/rolebinding.yaml +++ b/charts/everest/templates/everest-server/rolebinding.yaml @@ -2,6 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: everest-admin-role-binding + namespace: {{ include "everest.namespace" . }} roleRef: kind: "Role" apiGroup: "rbac.authorization.k8s.io" diff --git a/charts/everest/templates/everest-server/service.yaml b/charts/everest/templates/everest-server/service.yaml index d394d220..187dc7c9 100644 --- a/charts/everest/templates/everest-server/service.yaml +++ b/charts/everest/templates/everest-server/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: everest + namespace: {{ include "everest.namespace" . }} labels: app.kubernetes.io/name: everest app.kubernetes.io/component: everest diff --git a/charts/everest/templates/everest-server/serviceaccount.yaml b/charts/everest/templates/everest-server/serviceaccount.yaml index 597ce2d0..99228657 100644 --- a/charts/everest/templates/everest-server/serviceaccount.yaml +++ b/charts/everest/templates/everest-server/serviceaccount.yaml @@ -2,3 +2,4 @@ apiVersion: v1 kind: ServiceAccount metadata: name: everest-admin + namespace: {{ include "everest.namespace" . }} From d30dff35075f395002a635580ceacea309033cc1 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 8 Oct 2024 12:02:33 +0530 Subject: [PATCH 19/64] Typo Signed-off-by: Mayank Shah --- charts/everest/templates/everest-operator/rolebinding.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml index a0425aae..279abc84 100644 --- a/charts/everest/templates/everest-operator/rolebinding.yaml +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -1,4 +1,4 @@ -{{- include "everest.operatorRoleBinding" (dict "namespace" (include ".everest.namespace" . )) }} +{{- include "everest.operatorRoleBinding" (dict "namespace" (include "everest.namespace" . )) }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding From e6eb44f01ffcafb0e807088b943df62b35ddb5c1 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 8 Oct 2024 14:48:20 +0530 Subject: [PATCH 20/64] Add docs script Signed-off-by: Mayank Shah --- scripts/gen-docs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 scripts/gen-docs.sh diff --git a/scripts/gen-docs.sh b/scripts/gen-docs.sh new file mode 100644 index 00000000..79f0f209 --- /dev/null +++ b/scripts/gen-docs.sh @@ -0,0 +1,9 @@ +#!/bin/bash +## Reference: https://github.com/norwoodj/helm-docs +set -eux + +# Usage: +# sh ./scripts/gen-docs.sh + +echo "Generating docs..." +docker run --rm -v "$1/:/helm-docs" -u $(id -u) jnorwood/helm-docs:v1.9.1 From 61ebc4688d047caa72772d4ccf6605074e4d7722 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Tue, 8 Oct 2024 14:50:08 +0530 Subject: [PATCH 21/64] Fix docs Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 7 ++ charts/everest/README.md | 108 ++++++------------ charts/everest/README.md.gotmpl | 21 ++++ charts/everest/charts/common/README.md | 8 ++ .../charts/everest-db-namespace/README.md | 25 ++++ .../everest-operator/deployment.yaml | 14 +-- .../templates/everest-server/deployment.yaml | 8 +- charts/everest/values.yaml | 43 +++++-- 8 files changed, 135 insertions(+), 99 deletions(-) create mode 100644 charts/everest/README.md.gotmpl create mode 100644 charts/everest/charts/common/README.md create mode 100644 charts/everest/charts/everest-db-namespace/README.md diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index f8303fc8..9a0ed0f8 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -10,3 +10,10 @@ dependencies: - name: common version: 0.0.1 repository: "file://charts/common" + # This is not really a dependency, but we define it as one so that we're + # able to conditionally disable rendering these manifests along with the core chart manifests. + # The default behaviour of Helm is to always include the sub-chart manfiests unless explicitly disabled. +- name: everest-db-namespace + version: 0.0.1 + repository: "file://charts/everest-db-namespace" + condition: "everest-db-namespace.enabled" diff --git a/charts/everest/README.md b/charts/everest/README.md index 6dea18b1..5ed7bd35 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -1,79 +1,35 @@ # Percona Everest -This helm chart deploys the components needed for Percona Everest. -Useful links: -- [Everest Github repository](https://github.com/percona/everest) -- [Everest Documentation](https://docs.percona.com/everest/index.html) - -> NOTE: This Helm chart is currently in technical preview. - -## Pre-requisites -* Kubernetes 1.27+ -* At least `v3.2.3` version of helm - -# Usage - -## Installation - -Insall Percona Everest in the `everest-system` namespace: - -1. Create the `everest-system` namespace: -```bash -cat < NOTE: We recommend creating the `everest-system` namespace as a separate step. This is because specifying the `--create-namespace` flag with `helm install` does not support setting labels on the namespace. - -2. Install the Helm chart: -```bash -helm repo add percona https://percona.github.io/percona-helm-charts/ -helm install everest percona/everest --version 1.1.1 --namespace everest-system -``` +This helm chart deploys Percona Everest. -> NOTE: Installing in any namespace other than `everest-system` can cause the installation to fail. - -This command may take a couple of minutes to complete. Upon completion, you should see the following output: -```bash -NAME: everest -LAST DEPLOYED: Wed Sep 11 13:54:08 2024 -NAMESPACE: everest-system -STATUS: deployed -REVISION: 1 -TEST SUITE: None -``` - -## Retrieving admin credentials -Upon installation, an `admin` user is created for you. To retrieve the password for the `admin` user, run the following command: -```bash -kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' -``` - -## Uninstallation -```bash -helm uninstall everest -n everest-system -``` - -# Configuration - -The table below lists the configurable parameters of the Everest chart and their default values. - -| Parameter | Description | Default | -|--------------------------------|-------------------------------------------------------------------------------|-------------------------| -| image | Image to use for the Everest API server | percona/everest | -| olm.catalogSourceImage | Name of the CatalogSource image that is used for installing all operators | percona/everest-catalog | -| telemetry | If set, reports Telemetry information and usage data back to Percona | true | -| vmOperator.channel | Name of the OLM bundle channel to use for installing VictoriaMetrics operator | stable-v0 | -| everestOperator.channel | Name of the OLM bundle channel to use for installing the Everest Operator | stable-v0 | -| namespaces.[*].name | Namespace where databases and database operators will be installed | | -| namespaces.[*].mongodb.enabled | If set, PSMDB operator is installed in this namespace | | -| namespaces.[*].mongodb.channel | Name of the OLM bundle channel to use for installing PSMDB operator | stable-v1 | -| namespaces.[*].pxc.enabled | If set, PXC operator is installed in this namespace | | -| namespaces.[*].pxc.channel | Name of the OLM bundle channel to use for installing PXC operator | stable-v1 | -| namespaces.[*].pg.enabled | If set, PG operator is installed in this namespace | | -| namespaces.[*].pg.channel | Name of the OLM bundle channel to use for installing PG operator | stable-v2 | +Useful links: +- [Percona Everest Documentation](https://docs.percona.com/everest/index.html) +- [Percona Everest GitHub](https://github.com/percona/everest) + +## Usage + +> WIP + +## Configuration + +The following table shows the configurable parameters of the Percona Everest chart and their default values. + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| everest-db-namespace.enabled | bool | `false` | | +| monitoring.enabled | bool | `true` | Enable monitoring for Everest. | +| monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | +| namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | +| olm.catalogSourceImage | string | `"perconalab/everest-catalog"` | Image to use for Everest CatalogSource. | +| olm.enabled | bool | `true` | Enable OLM for Everest. | +| olm.image | string | `"quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6"` | Image to use for the OLM components. | +| olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed. Do no change unless you know what you are doing. | +| operator.enableLeaderElection | bool | `true` | Enable leader election for the operator. | +| operator.healthProbeAddr | string | `":8081"` | Health probe address for the operator. | +| operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. | +| operator.metricsAddr | string | `"127.0.0.1:8080"` | Metrics address for the operator. | +| operator.resources | object | `{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"5m","memory":"64Mi"}}` | Resources to allocate for the operator container. | +| server.image | string | `"perconalab/everest"` | Image to use for the server container. | +| server.rbac | string | `"g, admin, role:admin\n"` | RBAC policy for Everest. | +| server.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"20Mi"}}` | Resources to allocate for the server container. | +| telemetry | bool | `true` | If set, enabled sending telemetry information. | diff --git a/charts/everest/README.md.gotmpl b/charts/everest/README.md.gotmpl new file mode 100644 index 00000000..f97d036b --- /dev/null +++ b/charts/everest/README.md.gotmpl @@ -0,0 +1,21 @@ +# Percona Everest + +This helm chart deploys Percona Everest. + +Useful links: +- [Percona Everest Documentation](https://docs.percona.com/everest/index.html) +- [Percona Everest GitHub](https://github.com/percona/everest) + +## Usage + +> WIP + +## Configuration + +The following table shows the configurable parameters of the Percona Everest chart and their default values. + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} +| {{ .Key }} | {{ .Type }} | {{ .Default }} | {{ .AutoDescription }} | +{{- end }} diff --git a/charts/everest/charts/common/README.md b/charts/everest/charts/common/README.md new file mode 100644 index 00000000..79cf2f7f --- /dev/null +++ b/charts/everest/charts/common/README.md @@ -0,0 +1,8 @@ +# common + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square) + +A library chart for Everest containing common resources. + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md new file mode 100644 index 00000000..47c6565b --- /dev/null +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -0,0 +1,25 @@ +# everest-db-namespace + +![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square) + +A sub-chart for provisioning Everest DB namespaces. + +## Requirements + +| Repository | Name | Version | +|------------|------|---------| +| file://../common | common | 0.0.1 | + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| namespaceOverride | string | `""` | | +| olm.namespace | string | `"everest-olm"` | | +| pg | bool | `true` | | +| psmdb | bool | `true` | | +| pxc | bool | `true` | | +| telemetry | bool | `true` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml index b0e925a0..109e9c13 100644 --- a/charts/everest/templates/everest-operator/deployment.yaml +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -63,9 +63,11 @@ spec: terminationMessagePath: /dev/termination-log terminationMessagePolicy: File - args: - - --health-probe-bind-address=:8081 - - --metrics-bind-address=127.0.0.1:8080 + - --health-probe-bind-address={{ .Values.operator.healthProbeAddr }} + - --metrics-bind-address={{ .Values.operator.metricsAddr }} + {{- if .Values.operator.enableLeaderElection }} - --leader-elect + {{- end }} command: - /manager env: @@ -105,13 +107,7 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 - resources: - limits: - cpu: 500m - memory: 128Mi - requests: - cpu: 10m - memory: 64Mi + resources: {{ toYaml .Values.operator.resources | nindent 10 }} securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/charts/everest/templates/everest-server/deployment.yaml b/charts/everest/templates/everest-server/deployment.yaml index ed18c21f..01e741d8 100644 --- a/charts/everest/templates/everest-server/deployment.yaml +++ b/charts/everest/templates/everest-server/deployment.yaml @@ -43,13 +43,7 @@ spec: port: 8080 initialDelaySeconds: 300 periodSeconds: 15 - resources: - limits: - cpu: 200m - memory: 500Mi - requests: - cpu: 100m - memory: 20Mi + resources: {{ toYaml .Values.server.resources | nindent 12 }} volumeMounts: - name: jwt-secret mountPath: /etc/jwt diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 8f9676f2..d9cf8436 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,28 +1,57 @@ -# Override the install namespace. -# Defaults to .Release.Namespace +# -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" -# Set to false to disable telemetry. +# -- If set, enabled sending telemetry information. telemetry: true -# Config for Everest API server. server: + # -- Image to use for the server container. image: perconalab/everest + # -- Resources to allocate for the server container. + resources: + limits: + cpu: 200m + memory: 500Mi + requests: + cpu: 100m + memory: 20Mi + # -- RBAC policy for Everest. rbac: | g, admin, role:admin -# Config for Everest Operator operator: + # -- Image to use for the Everest operator container. image: perconalab/everest-operator + # -- Health probe address for the operator. + healthProbeAddr: ":8081" + # -- Metrics address for the operator. + metricsAddr: "127.0.0.1:8080" + # -- Enable leader election for the operator. + enableLeaderElection: true + # -- Resources to allocate for the operator container. + resources: + limits: + cpu: 500m + memory: 128Mi + requests: + cpu: 5m + memory: 64Mi -# Config for OLM olm: + # -- Namespace where OLM is installed. Do no change unless you know what you are doing. namespace: everest-olm + # -- Enable OLM for Everest. enabled: true + # -- Image to use for Everest CatalogSource. catalogSourceImage: perconalab/everest-catalog + # -- Image to use for the OLM components. image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 -# Config for Everest Monitoring monitoring: + # -- Namespace where monitoring is installed. Do no change unless you know what you are doing. namespace: everest-monitoring + # -- Enable monitoring for Everest. enabled: true + +everest-db-namespace: + enabled: false From c5fb62be1c99f992a36799dcbe5797734bc34150 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 9 Oct 2024 14:27:21 +0530 Subject: [PATCH 22/64] Fix tls, add cert-manager support Signed-off-by: Mayank Shah --- charts/everest/Chart.lock | 7 +- charts/everest/README.md | 6 +- .../templates/_db_resources_cleanup.yaml.tpl | 82 +++++++++++++++++++ .../_everest_operator_rolebinding.yaml.tpl | 18 ---- .../charts/everest-db-namespace/README.md | 13 +-- .../templates/rolebinding.yaml | 1 - .../charts/everest-db-namespace/values.yaml | 13 ++- charts/everest/templates/_helpers.tpl | 25 ++++++ .../everest-monitoring/rolebinding.yaml | 2 - .../everest-olm/certs.certmanager.yaml | 50 +++++++++++ .../everest-olm/packageserver.apiservice.yaml | 26 +++--- .../everest-operator/deployment.yaml | 20 +---- .../{role.yaml => leaderelection.role.yaml} | 2 +- .../leaderelection.rolebinding.yaml | 13 +++ ...sterrole.yaml => manager.clusterrole.yaml} | 2 +- .../manager.clusterrolebinding.yaml | 13 +++ .../metricsreader.clusterrole.yaml | 10 +++ .../everest-operator/proxy.clusterrole.yaml | 17 ++++ .../proxy.clusterrolebinding.yaml | 12 +++ .../everest-operator/rolebinding.yaml | 2 - .../everest-operator/serviceaccount.yaml | 2 +- .../everest-server/accounts.secret.yaml | 3 - .../templates/everest-server/jwt.secret.yaml | 2 - charts/everest/values.yaml | 15 ++++ 24 files changed, 282 insertions(+), 74 deletions(-) create mode 100644 charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl delete mode 100644 charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl delete mode 100644 charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml delete mode 100644 charts/everest/templates/everest-monitoring/rolebinding.yaml create mode 100644 charts/everest/templates/everest-olm/certs.certmanager.yaml rename charts/everest/templates/everest-operator/{role.yaml => leaderelection.role.yaml} (90%) create mode 100644 charts/everest/templates/everest-operator/leaderelection.rolebinding.yaml rename charts/everest/templates/everest-operator/{clusterrole.yaml => manager.clusterrole.yaml} (99%) create mode 100644 charts/everest/templates/everest-operator/manager.clusterrolebinding.yaml create mode 100644 charts/everest/templates/everest-operator/metricsreader.clusterrole.yaml create mode 100644 charts/everest/templates/everest-operator/proxy.clusterrole.yaml create mode 100644 charts/everest/templates/everest-operator/proxy.clusterrolebinding.yaml diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock index d5cf3800..77e1ff8c 100644 --- a/charts/everest/Chart.lock +++ b/charts/everest/Chart.lock @@ -2,5 +2,8 @@ dependencies: - name: common repository: file://charts/common version: 0.0.1 -digest: sha256:dd964587205aac5398fd33451dc5bd10a0169694286db38a10a963a352f46aed -generated: "2024-10-07T16:36:08.628446+05:30" +- name: everest-db-namespace + repository: file://charts/everest-db-namespace + version: 0.0.1 +digest: sha256:ba5282ada65ac76797ff6e6e9d9a1b989102196a74934e6dd07522e94e47c178 +generated: "2024-10-09T14:20:24.150243+05:30" diff --git a/charts/everest/README.md b/charts/everest/README.md index 5ed7bd35..2b771e06 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -16,7 +16,7 @@ The following table shows the configurable parameters of the Percona Everest cha | Key | Type | Default | Description | |-----|------|---------|-------------| -| everest-db-namespace.enabled | bool | `false` | | +| everest-db-namespace.enabled | bool | `false` | Do not enable. | | monitoring.enabled | bool | `true` | Enable monitoring for Everest. | | monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | @@ -24,6 +24,10 @@ The following table shows the configurable parameters of the Percona Everest cha | olm.enabled | bool | `true` | Enable OLM for Everest. | | olm.image | string | `"quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6"` | Image to use for the OLM components. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed. Do no change unless you know what you are doing. | +| olm.packageserver.tls.caCert | string | `""` | CA certificate for the PackageServer APIService. Overrides the tls.type setting. | +| olm.packageserver.tls.tlsCert | string | `""` | Client certificate for the PackageServer APIService. Overrides the tls.type setting. | +| olm.packageserver.tls.tlsKey | string | `""` | Client key for the PackageServer APIService. Overrides the tls.type setting. | +| olm.packageserver.tls.type | string | `"cert-manager"` | Type of TLS certificates. Supported values are "helm" and "cert-manager". For production setup, it is recommended to use "cert-manager". | | operator.enableLeaderElection | bool | `true` | Enable leader election for the operator. | | operator.healthProbeAddr | string | `":8081"` | Health probe address for the operator. | | operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. | diff --git a/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl new file mode 100644 index 00000000..71e15148 --- /dev/null +++ b/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl @@ -0,0 +1,82 @@ +# +# @param .namespace The namespace where DB and its resources are deployed +# +{{- define "everest.dbResourcesCleanup" }} +{{- $hookName := printf "everest-helm-pre-delete-db-resource-cleanup" }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ $hookName }} + namespace: {{ .namespace }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ $hookName }} + namespace: {{ .namespace }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +rules: + - apiGroups: + - everest.percona.com + resources: + - databaseclusters + - backupstorages + - monitoringconfigs + verbs: + - delete + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ $hookName }} + namespace: {{ .namespace }} + annotations: + "helm.sh/hook-delete-policy": hook-succeeded +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ $hookName }} +subjects: + - kind: ServiceAccount + name: {{ $hookName }} + namespace: {{ .namespace }} +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ $hookName }}-{{ randNumeric 6 }} + namespace: {{ .namespace }} + annotations: + "helm.sh/hook": pre-delete + "helm.sh/hook-delete-policy": hook-succeeded +spec: + ttlSecondsAfterFinished: 60 + template: + spec: + containers: + - image: bitnami/kubectl:latest + name: {{ $hookName }} + command: + - /bin/sh + - -c + - | + echo "Deleting DatabaseClusters" + kubectl delete databaseclusters -n {{ .namespace }} --all --wait + + echo "Deleting BackupStorages" + kubectl delete backupstorages -n {{ .namespace }} --all --wait + + echo "Deleting MonitoringConfigs" + kubectl delete monitoringconfigs -n {{ .namespace }} --all --wait + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + serviceAccount: {{ $hookName }} + serviceAccountName: {{ $hookName }} + terminationGracePeriodSeconds: 30 +--- +{{- end }} + diff --git a/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl b/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl deleted file mode 100644 index 6bb6f643..00000000 --- a/charts/everest/charts/common/templates/_everest_operator_rolebinding.yaml.tpl +++ /dev/null @@ -1,18 +0,0 @@ -# -# @params .namespace Namespace where this RoleBinding should be created -# -{{- define "everest.operatorRoleBinding" }} -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: everest-operator - namespace: {{ .namespace }} -subjects: -- kind: ServiceAccount - name: everest-operator - namespace: everest-system -roleRef: - kind: ClusterRole - name: everest-operator - apiGroup: rbac.authorization.k8s.io -{{- end }} diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md index 47c6565b..5e0da18b 100644 --- a/charts/everest/charts/everest-db-namespace/README.md +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -14,12 +14,13 @@ A sub-chart for provisioning Everest DB namespaces. | Key | Type | Default | Description | |-----|------|---------|-------------| -| namespaceOverride | string | `""` | | -| olm.namespace | string | `"everest-olm"` | | -| pg | bool | `true` | | -| psmdb | bool | `true` | | -| pxc | bool | `true` | | -| telemetry | bool | `true` | | +| cleanupOnUninstall | bool | `true` | If set, cleans up the DB resources on uninstall. | +| namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | +| olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed in the cluster. | +| pg | bool | `true` | If set, installs the Percona Postgresql Server operator. | +| psmdb | bool | `true` | If set, installs the Percona Server MongoDB operator. | +| pxc | bool | `true` | If set, installs the Percona XtraDB Cluster operator. | +| telemetry | bool | `true` | If set, enabled sending telemetry information. | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.9.1](https://github.com/norwoodj/helm-docs/releases/v1.9.1) diff --git a/charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml b/charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml deleted file mode 100644 index 91a4f198..00000000 --- a/charts/everest/charts/everest-db-namespace/templates/rolebinding.yaml +++ /dev/null @@ -1 +0,0 @@ -{{- include "everest.operatorRoleBinding" (dict "namespace" .Release.Namespace) }} diff --git a/charts/everest/charts/everest-db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml index 938184b5..d1423609 100644 --- a/charts/everest/charts/everest-db-namespace/values.yaml +++ b/charts/everest/charts/everest-db-namespace/values.yaml @@ -1,9 +1,16 @@ -# Override the install namespace. -# Defaults to .Release.Namespace +# -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" +# -- If set, enabled sending telemetry information. +telemetry: true +# -- If set, installs the Percona Server MongoDB operator. psmdb: true +# -- If set, installs the Percona XtraDB Cluster operator. pxc: true +# -- If set, installs the Percona Postgresql Server operator. pg: true -telemetry: true + olm: + # -- Namespace where OLM is installed in the cluster. namespace: everest-olm +# -- If set, cleans up the DB resources on uninstall. +cleanupOnUninstall: true diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index 0392bf2e..d6b151bc 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -75,3 +75,28 @@ admin: capabilities: - login {{- end}} + +{{- define "olm.certs" }} +{{- $tls := .Values.olm.packageserver.tls }} +{{- $psSvcName := printf "packageserver-service" }} +{{- $psSvcNameWithNS := ( printf "%s.%s" $psSvcName .Values.olm.namespace ) }} +{{- $psFullName := ( printf "%s.svc" $psSvcNameWithNS ) }} +{{- $psAltNames := list $psSvcName $psSvcNameWithNS $psFullName }} +{{- $psCA := genCA $psSvcName 3650 }} +{{- $psCert := genSignedCert $psFullName nil $psAltNames 3650 $psCA }} +{{- if (and $tls.caCert $tls.tlsCert $tls.tlsKey) }} +caCert: {{ $tls.caCert | b64enc }} +tlsCert: {{ $tls.tlsCert | b64enc }} +tlsKey: {{ $tls.tlsKey | b64enc }} +{{- else }} +caCert: {{ $psCA.Cert | b64enc }} +tlsCert: {{ $psCert.Cert | b64enc }} +tlsKey: {{ $psCert.Key | b64enc }} +{{- end }} +commonName: {{ $psSvcName }} +altNames: +{{- range $n := $psAltNames }} +- {{ $n }} +{{- end }} +- localhost +{{- end }} diff --git a/charts/everest/templates/everest-monitoring/rolebinding.yaml b/charts/everest/templates/everest-monitoring/rolebinding.yaml deleted file mode 100644 index 785e2609..00000000 --- a/charts/everest/templates/everest-monitoring/rolebinding.yaml +++ /dev/null @@ -1,2 +0,0 @@ -{{- include "everest.operatorRoleBinding" (dict "namespace" .Values.monitoring.namespace) }} - diff --git a/charts/everest/templates/everest-olm/certs.certmanager.yaml b/charts/everest/templates/everest-olm/certs.certmanager.yaml new file mode 100644 index 00000000..82291150 --- /dev/null +++ b/charts/everest/templates/everest-olm/certs.certmanager.yaml @@ -0,0 +1,50 @@ +{{- if eq .Values.olm.packageserver.tls.type "cert-manager"}} +{{- $tls := fromYaml (include "olm.certs" .) }} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: olm-ca-issuer + namespace: {{ .Values.olm.namespace }} +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: olm-ca-cert + namespace: {{ .Values.olm.namespace }} +spec: + secretName: olm-ca-cert + duration: 87600h # 10 year + renewBefore: 720h # 30 days + isCA: true + commonName: olm-ca + issuerRef: + name: olm-ca-issuer + kind: Issuer +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: olm-cert-issuer + namespace: {{ .Values.olm.namespace }} +spec: + ca: + secretName: olm-ca-cert +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: olm-packageserver-tls + namespace: {{ .Values.olm.namespace }} +spec: + secretName: packageserver-service-cert + commonName: {{ $tls.commonName }} + dnsNames: {{ toYaml $tls.altNames | nindent 4 }} + duration: 8760h # 1 year + issuerRef: + name: olm-cert-issuer + kind: Issuer +--- +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml index 63666c87..075c00e2 100644 --- a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -1,19 +1,17 @@ -{{- $psSvcName := printf "packageserver-service" }} -{{- $psSvcNameWithNS := ( printf "%s.%s" $psSvcName "everest-olm" ) }} -{{- $psFullName := ( printf "%s.svc" $psSvcNameWithNS ) }} -{{- $psAltNames := list $psSvcName $psSvcNameWithNS $psFullName }} -{{- $psCA := genCA $psSvcName 3650 }} -{{- $psCert := genSignedCert $psFullName nil $psAltNames 3650 $psCA }} +{{- $tls := fromYaml (include "olm.certs" .) }} --- -{{- if not (lookup "apiregistration.k8s.io/v1" "APIService" "" "v1.packages.operators.coreos.com" )}} apiVersion: apiregistration.k8s.io/v1 kind: APIService metadata: name: v1.packages.operators.coreos.com annotations: - helm.sh/resource-policy: keep + {{- if eq .Values.olm.packageserver.tls.type "cert-manager" }} + cert-manager.io/inject-ca-from: {{ .Values.olm.namespace }}/olm-packageserver-tls + {{- end }} spec: - caBundle: {{ b64enc $psCA.Cert }} + {{- if ne .Values.olm.packageserver.tls.type "cert-manager" }} + caBundle: {{ $tls.caCert }} + {{- end }} group: packages.operators.coreos.com groupPriorityMinimum: 2000 version: v1 @@ -22,18 +20,16 @@ spec: name: packageserver-service namespace: {{ .Values.olm.namespace }} port: 5443 -{{- end }} --- -{{- if not (lookup "v1" "Secret" .Values.olm.namespace $psSvcName )}} +{{- if ne .Values.olm.packageserver.tls.type "cert-manager" }} apiVersion: v1 data: - tls.crt: {{ b64enc $psCert.Cert }} - tls.key: {{ b64enc $psCert.Key }} + tls.crt: {{ $tls.tlsCert }} + tls.key: {{ $tls.tlsKey }} kind: Secret metadata: name: packageserver-service-cert namespace: {{ .Values.olm.namespace }} - annotations: - helm.sh/resource-policy: keep type: kubernetes.io/tls {{- end }} +--- diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml index 109e9c13..0fae96ca 100644 --- a/charts/everest/templates/everest-operator/deployment.yaml +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -68,22 +68,10 @@ spec: {{- if .Values.operator.enableLeaderElection }} - --leader-elect {{- end }} + - --monitoring-namespace={{ .Values.monitoring.namespace }} + - --system-namespace={{ include "everest.namespace" . }} command: - /manager - env: - - name: SYSTEM_NAMESPACE - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.namespace - - name: DISABLE_TELEMETRY - {{- if .Values.telemetry }} - value: "true" - {{- end }} - - name: MONITORING_NAMESPACE - value: {{ .Values.monitoring.namespace }} - - name: DB_NAMESPACES - value: everest #TODO image: {{ .Values.operator.image }}:{{ .Chart.Version }} imagePullPolicy: IfNotPresent livenessProbe: @@ -120,6 +108,6 @@ spec: schedulerName: default-scheduler securityContext: runAsNonRoot: true - serviceAccount: everest-operator - serviceAccountName: everest-operator + serviceAccount: everest-operator-controller-manager + serviceAccountName: everest-operator-controller-manager terminationGracePeriodSeconds: 10 diff --git a/charts/everest/templates/everest-operator/role.yaml b/charts/everest/templates/everest-operator/leaderelection.role.yaml similarity index 90% rename from charts/everest/templates/everest-operator/role.yaml rename to charts/everest/templates/everest-operator/leaderelection.role.yaml index e6e5c535..d2adf4f9 100644 --- a/charts/everest/templates/everest-operator/role.yaml +++ b/charts/everest/templates/everest-operator/leaderelection.role.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - name: everest-operator + name: everest-operator-leader-election-role namespace: {{ include "everest.namespace" . }} rules: - apiGroups: diff --git a/charts/everest/templates/everest-operator/leaderelection.rolebinding.yaml b/charts/everest/templates/everest-operator/leaderelection.rolebinding.yaml new file mode 100644 index 00000000..58afdc38 --- /dev/null +++ b/charts/everest/templates/everest-operator/leaderelection.rolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: everest-operator-leader-election-rolebinding + namespace: {{ include "everest.namespace" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: everest-operator-leader-election-role +subjects: +- kind: ServiceAccount + name: everest-operator-controller-manager + namespace: {{ include "everest.namespace" .}} diff --git a/charts/everest/templates/everest-operator/clusterrole.yaml b/charts/everest/templates/everest-operator/manager.clusterrole.yaml similarity index 99% rename from charts/everest/templates/everest-operator/clusterrole.yaml rename to charts/everest/templates/everest-operator/manager.clusterrole.yaml index add762d8..1ce6b74b 100644 --- a/charts/everest/templates/everest-operator/clusterrole.yaml +++ b/charts/everest/templates/everest-operator/manager.clusterrole.yaml @@ -1,7 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: - name: everest-operator + name: everest-operator-manager-role rules: - apiGroups: - apiextensions.k8s.io diff --git a/charts/everest/templates/everest-operator/manager.clusterrolebinding.yaml b/charts/everest/templates/everest-operator/manager.clusterrolebinding.yaml new file mode 100644 index 00000000..eb08062d --- /dev/null +++ b/charts/everest/templates/everest-operator/manager.clusterrolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: everest-operator-manager-rolebinding +subjects: +- kind: ServiceAccount + name: everest-operator-controller-manager + namespace: {{ include "everest.namespace" . }} +roleRef: + kind: ClusterRole + name: everest-operator-manager-role + apiGroup: rbac.authorization.k8s.io + diff --git a/charts/everest/templates/everest-operator/metricsreader.clusterrole.yaml b/charts/everest/templates/everest-operator/metricsreader.clusterrole.yaml new file mode 100644 index 00000000..9df763b2 --- /dev/null +++ b/charts/everest/templates/everest-operator/metricsreader.clusterrole.yaml @@ -0,0 +1,10 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + name: everest-operator-metrics-reader +rules: +- nonResourceURLs: + - /metrics + verbs: + - get diff --git a/charts/everest/templates/everest-operator/proxy.clusterrole.yaml b/charts/everest/templates/everest-operator/proxy.clusterrole.yaml new file mode 100644 index 00000000..bac3abf2 --- /dev/null +++ b/charts/everest/templates/everest-operator/proxy.clusterrole.yaml @@ -0,0 +1,17 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: everest-operator-proxy-role +rules: +- apiGroups: + - authentication.k8s.io + resources: + - tokenreviews + verbs: + - create +- apiGroups: + - authorization.k8s.io + resources: + - subjectaccessreviews + verbs: + - create diff --git a/charts/everest/templates/everest-operator/proxy.clusterrolebinding.yaml b/charts/everest/templates/everest-operator/proxy.clusterrolebinding.yaml new file mode 100644 index 00000000..e166595e --- /dev/null +++ b/charts/everest/templates/everest-operator/proxy.clusterrolebinding.yaml @@ -0,0 +1,12 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: everest-operator-proxy-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: everest-operator-proxy-role +subjects: +- kind: ServiceAccount + name: everest-operator-controller-manager + namespace: {{ include "everest.namespace" . }} diff --git a/charts/everest/templates/everest-operator/rolebinding.yaml b/charts/everest/templates/everest-operator/rolebinding.yaml index 279abc84..f9d22a81 100644 --- a/charts/everest/templates/everest-operator/rolebinding.yaml +++ b/charts/everest/templates/everest-operator/rolebinding.yaml @@ -1,5 +1,3 @@ -{{- include "everest.operatorRoleBinding" (dict "namespace" (include "everest.namespace" . )) }} ---- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/charts/everest/templates/everest-operator/serviceaccount.yaml b/charts/everest/templates/everest-operator/serviceaccount.yaml index d30dcd27..9fd91e42 100644 --- a/charts/everest/templates/everest-operator/serviceaccount.yaml +++ b/charts/everest/templates/everest-operator/serviceaccount.yaml @@ -1,5 +1,5 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: everest-operator + name: everest-operator-controller-manager namespace: {{ include "everest.namespace" . }} diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 485870be..90c8e03e 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -1,4 +1,3 @@ -{{- if not (lookup "v1" "Secret" .Release.Namespace "everest-accounts" ) }} apiVersion: v1 kind: Secret metadata: @@ -6,7 +5,5 @@ metadata: namespace: {{ include "everest.namespace" . }} annotations: insecure-password/admin: "true" - helm.sh/resource-policy: keep data: users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} -{{- end }} diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index 1b1a3628..68bb6f8d 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -3,7 +3,5 @@ kind: Secret metadata: name: everest-jwt namespace: {{ include "everest.namespace" . }} - annotations: - helm.sh/resource-policy: keep data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index d9cf8436..8abd5443 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,6 +1,7 @@ # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" + # -- If set, enabled sending telemetry information. telemetry: true @@ -47,6 +48,18 @@ olm: # -- Image to use for the OLM components. image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 + packageserver: + tls: + # -- Type of TLS certificates. Supported values are "helm" and "cert-manager". + # For production setup, it is recommended to use "cert-manager". + type: "cert-manager" + # -- CA certificate for the PackageServer APIService. Overrides the tls.type setting. + caCert: "" + # -- Client certificate for the PackageServer APIService. Overrides the tls.type setting. + tlsCert: "" + # -- Client key for the PackageServer APIService. Overrides the tls.type setting. + tlsKey: "" + monitoring: # -- Namespace where monitoring is installed. Do no change unless you know what you are doing. namespace: everest-monitoring @@ -54,4 +67,6 @@ monitoring: enabled: true everest-db-namespace: + # -- Do not enable. enabled: false + From cd4f67828c8dd54f82bf97175792bd4b4a416233 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 9 Oct 2024 19:28:33 +0530 Subject: [PATCH 23/64] works! Signed-off-by: Mayank Shah --- charts/everest/templates/everest-operator/deployment.yaml | 5 +++++ .../templates/everest-operator/manager.clusterrole.yaml | 6 ++++++ .../everest/templates/everest-server/accounts.secret.yaml | 1 + charts/everest/templates/everest-server/jwt.secret.yaml | 2 ++ charts/everest/values.yaml | 3 +-- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/charts/everest/templates/everest-operator/deployment.yaml b/charts/everest/templates/everest-operator/deployment.yaml index 0fae96ca..a26b13bc 100644 --- a/charts/everest/templates/everest-operator/deployment.yaml +++ b/charts/everest/templates/everest-operator/deployment.yaml @@ -96,6 +96,11 @@ spec: successThreshold: 1 timeoutSeconds: 1 resources: {{ toYaml .Values.operator.resources | nindent 10 }} + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name securityContext: allowPrivilegeEscalation: false capabilities: diff --git a/charts/everest/templates/everest-operator/manager.clusterrole.yaml b/charts/everest/templates/everest-operator/manager.clusterrole.yaml index 1ce6b74b..9fd96374 100644 --- a/charts/everest/templates/everest-operator/manager.clusterrole.yaml +++ b/charts/everest/templates/everest-operator/manager.clusterrole.yaml @@ -27,6 +27,12 @@ rules: - get - list - watch +- apiGroups: + - "" + resources: + - pods + verbs: + - delete - apiGroups: - "" resources: diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 90c8e03e..0d14b892 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -5,5 +5,6 @@ metadata: namespace: {{ include "everest.namespace" . }} annotations: insecure-password/admin: "true" + helm.sh/hook: pre-install data: users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index 68bb6f8d..309ecfc1 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -3,5 +3,7 @@ kind: Secret metadata: name: everest-jwt namespace: {{ include "everest.namespace" . }} + annotations: + helm.sh/hook: pre-install data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 8abd5443..89a52e88 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,7 +1,6 @@ # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" - # -- If set, enabled sending telemetry information. telemetry: true @@ -52,7 +51,7 @@ olm: tls: # -- Type of TLS certificates. Supported values are "helm" and "cert-manager". # For production setup, it is recommended to use "cert-manager". - type: "cert-manager" + type: "helm" # -- CA certificate for the PackageServer APIService. Overrides the tls.type setting. caCert: "" # -- Client certificate for the PackageServer APIService. Overrides the tls.type setting. From e4faddb898a9e5e4d850b112b5d8b1dfec94db46 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 9 Oct 2024 19:28:57 +0530 Subject: [PATCH 24/64] Fix docs Signed-off-by: Mayank Shah --- charts/everest/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index 2b771e06..5482aa2b 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -27,7 +27,7 @@ The following table shows the configurable parameters of the Percona Everest cha | olm.packageserver.tls.caCert | string | `""` | CA certificate for the PackageServer APIService. Overrides the tls.type setting. | | olm.packageserver.tls.tlsCert | string | `""` | Client certificate for the PackageServer APIService. Overrides the tls.type setting. | | olm.packageserver.tls.tlsKey | string | `""` | Client key for the PackageServer APIService. Overrides the tls.type setting. | -| olm.packageserver.tls.type | string | `"cert-manager"` | Type of TLS certificates. Supported values are "helm" and "cert-manager". For production setup, it is recommended to use "cert-manager". | +| olm.packageserver.tls.type | string | `"helm"` | Type of TLS certificates. Supported values are "helm" and "cert-manager". For production setup, it is recommended to use "cert-manager". | | operator.enableLeaderElection | bool | `true` | Enable leader election for the operator. | | operator.healthProbeAddr | string | `":8081"` | Health probe address for the operator. | | operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. | From 675ef474713eaacb1590ac50675de77f7d5bdacd Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 11:07:11 +0530 Subject: [PATCH 25/64] Update readme Signed-off-by: Mayank Shah --- charts/everest/README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index 5482aa2b..cf8aee52 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -8,7 +8,36 @@ Useful links: ## Usage -> WIP +### Deploy Percona Everest + +```sh +helm repo add percona https://percona.github.io/percona-helm-charts/ +helm install everest-core percona/everest --namespace everest-system --create-namespace +``` + +> Note: we currently do not support deploying Everest in a namespace other than `everest-system`. + +This command may take a few minutes to complete. Once done, you can retrieve the admin credentials using the following command: + +```sh +kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' +``` + +### Deploy your database namespace components + +Once Everest is running, we need to create a namespace for your databases and provision the necessary operators. + +```sh +cat < Date: Thu, 10 Oct 2024 11:52:30 +0530 Subject: [PATCH 26/64] Typos Signed-off-by: Mayank Shah --- charts/everest/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index cf8aee52..ad543ad5 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -28,11 +28,11 @@ kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\ Once Everest is running, we need to create a namespace for your databases and provision the necessary operators. ```sh -cat < Date: Thu, 10 Oct 2024 11:58:20 +0530 Subject: [PATCH 27/64] Linting Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 9a0ed0f8..bbbb168b 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -1,6 +1,5 @@ apiVersion: v2 name: everest -displayName: Percona Everest description: A cloud-native database platform version: 0.0.0 appVersion: 0.0.0 From c4678652387b549bf34dec28db93c9a184bbac03 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 12:00:39 +0530 Subject: [PATCH 28/64] Linting Signed-off-by: Mayank Shah --- charts/everest/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 89a52e88..d8b18102 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -68,4 +68,3 @@ monitoring: everest-db-namespace: # -- Do not enable. enabled: false - From 8a0071b7148d0fa8e92d1ad1b918d633d8d2a9c1 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 12:02:49 +0530 Subject: [PATCH 29/64] Fix tmpl Signed-off-by: Mayank Shah --- charts/everest/README.md.gotmpl | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/charts/everest/README.md.gotmpl b/charts/everest/README.md.gotmpl index f97d036b..bf9771af 100644 --- a/charts/everest/README.md.gotmpl +++ b/charts/everest/README.md.gotmpl @@ -8,7 +8,36 @@ Useful links: ## Usage -> WIP +### Deploy Percona Everest + +```sh +helm repo add percona https://percona.github.io/percona-helm-charts/ +helm install everest-core percona/everest --namespace everest-system --create-namespace +``` + +> Note: we currently do not support deploying Everest in a namespace other than `everest-system`. + +This command may take a few minutes to complete. Once done, you can retrieve the admin credentials using the following command: + +```sh +kubectl get secret everest-accounts -n everest-system -o jsonpath='{.data.users\.yaml}' | base64 --decode | yq '.admin.passwordHash' +``` + +### Deploy your database namespace components + +Once Everest is running, we need to create a namespace for your databases and provision the necessary operators. + +```sh +cat < Date: Thu, 10 Oct 2024 12:03:50 +0530 Subject: [PATCH 30/64] Add maintainer Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index bbbb168b..c81d96c6 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -5,6 +5,9 @@ version: 0.0.0 appVersion: 0.0.0 type: application kubeVersion: ">=1.27.0-0" +maintainers: +- name: mayankshah1607 + email: mayank.shah@percona.com dependencies: - name: common version: 0.0.1 From ee24fa9b77736e7982b8c6a228eec776c2a1580b Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 12:06:10 +0530 Subject: [PATCH 31/64] Remove kubeVersion Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index c81d96c6..81093856 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -4,7 +4,6 @@ description: A cloud-native database platform version: 0.0.0 appVersion: 0.0.0 type: application -kubeVersion: ">=1.27.0-0" maintainers: - name: mayankshah1607 email: mayank.shah@percona.com From f3ce5d42665a30bcd300d484538472660f30a340 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 12:10:47 +0530 Subject: [PATCH 32/64] Exclude everest chart Signed-off-by: Mayank Shah --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 221f1d20..a8c06990 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,6 +4,7 @@ on: pull_request: path-ignore: - 'charts/gcp-marketplace/**' + - 'charts/everest/**' jobs: lint-test: From 60c2f272df46309f3ae7dd667b3046494120f624 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 13:19:30 +0530 Subject: [PATCH 33/64] Wire up cleanup job Signed-off-by: Mayank Shah --- charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl | 1 - .../charts/common/templates/_db_resources_cleanup.yaml.tpl | 1 - .../charts/common/templates/_installplan_approver.yaml.tpl | 1 - .../everest/charts/everest-db-namespace/templates/hooks.yaml | 4 ++++ 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl index 79c8e4d0..b0932c57 100644 --- a/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_csv_cleanup.yaml.tpl @@ -52,7 +52,6 @@ metadata: "helm.sh/hook": pre-delete "helm.sh/hook-delete-policy": hook-succeeded spec: - ttlSecondsAfterFinished: 60 template: spec: containers: diff --git a/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl b/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl index 71e15148..ac80700a 100644 --- a/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl +++ b/charts/everest/charts/common/templates/_db_resources_cleanup.yaml.tpl @@ -54,7 +54,6 @@ metadata: "helm.sh/hook": pre-delete "helm.sh/hook-delete-policy": hook-succeeded spec: - ttlSecondsAfterFinished: 60 template: spec: containers: diff --git a/charts/everest/charts/common/templates/_installplan_approver.yaml.tpl b/charts/everest/charts/common/templates/_installplan_approver.yaml.tpl index 5f9ad4c5..e374930e 100644 --- a/charts/everest/charts/common/templates/_installplan_approver.yaml.tpl +++ b/charts/everest/charts/common/templates/_installplan_approver.yaml.tpl @@ -64,7 +64,6 @@ metadata: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-delete-policy": hook-succeeded spec: - ttlSecondsAfterFinished: 60 template: spec: containers: diff --git a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml index b546224a..aab361dc 100644 --- a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml @@ -1,3 +1,7 @@ {{- include "everest.csvCleanup" (dict "namespace" (include "db.namespace" .)) }} --- {{- include "everest.installplanApprover" (dict "namespace" (include "db.namespace" .)) }} +--- +{{ if .Values.cleanupOnUninstall }} +{{- include "everest.dbResourcesCleanup" (dict "namespace" (include "db.namespace" .)) }} +{{- end From fbbac3700687ab5f0e67c43bbbf8c70895600763 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 13:48:05 +0530 Subject: [PATCH 34/64] Fix Signed-off-by: Mayank Shah --- charts/everest/charts/everest-db-namespace/templates/hooks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml index aab361dc..2804ddcf 100644 --- a/charts/everest/charts/everest-db-namespace/templates/hooks.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/hooks.yaml @@ -4,4 +4,4 @@ --- {{ if .Values.cleanupOnUninstall }} {{- include "everest.dbResourcesCleanup" (dict "namespace" (include "db.namespace" .)) }} -{{- end +{{- end }} From 28508db3afcad4734a7c14b717cd7ad7272c1e4e Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 15:49:29 +0530 Subject: [PATCH 35/64] Add flags to make secrets optional Signed-off-by: Mayank Shah --- .../everest/templates/everest-server/accounts.secret.yaml | 2 ++ charts/everest/templates/everest-server/jwt.secret.yaml | 2 ++ charts/everest/values.yaml | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 0d14b892..d0501568 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -1,3 +1,4 @@ +{{- if .Values.server.createAccountsSecret }} apiVersion: v1 kind: Secret metadata: @@ -8,3 +9,4 @@ metadata: helm.sh/hook: pre-install data: users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} +{{- end }} diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index 309ecfc1..db34e482 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -1,3 +1,4 @@ +{{- if .Values.server.createJWTSecret }} apiVersion: v1 kind: Secret metadata: @@ -7,3 +8,4 @@ metadata: helm.sh/hook: pre-install data: id_rsa: {{ genPrivateKey "rsa" | b64enc }} +{{- end }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index d8b18102..23c7ce5d 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -18,6 +18,12 @@ server: # -- RBAC policy for Everest. rbac: | g, admin, role:admin + # -- If disabled, the accounts secret will not be created by the chart, + # and needs to be created manually. Useful when integrating with GitOps tools. + createAccountsSecret: true + # -- If disabled, the JWT key secret will not be produced by the chart, + # and needs to be created manually. Useful when integrating with GitOps tools. + createJWTSecret: true operator: # -- Image to use for the Everest operator container. From 3e434c4bd3bdb4dc0676d4e6dfa98d75090b0a5a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:08:14 +0530 Subject: [PATCH 36/64] Fix CI Signed-off-by: Mayank Shah --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a8c06990..8369a877 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -49,6 +49,8 @@ jobs: if [ -n "$OPERATOR_INSTALL" ]; then for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done fi + ct install --config .github/ct.yaml --excludes-charts=everest + ct install --config .github/ct.yaml --namespace=everest-system charts=everest # We cannot install Everest chart in any namespace other that everest-system ct install --config .github/ct.yaml if [ -n "$OPERATOR_INSTALL" ]; then for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done From 32ec86b047182a11d000bf6c3d8028d306b12c5f Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:10:02 +0530 Subject: [PATCH 37/64] Typo Signed-off-by: Mayank Shah --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8369a877..2a912265 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -49,7 +49,7 @@ jobs: if [ -n "$OPERATOR_INSTALL" ]; then for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done fi - ct install --config .github/ct.yaml --excludes-charts=everest + ct install --config .github/ct.yaml --excluded-charts=everest ct install --config .github/ct.yaml --namespace=everest-system charts=everest # We cannot install Everest chart in any namespace other that everest-system ct install --config .github/ct.yaml if [ -n "$OPERATOR_INSTALL" ]; then From a9c18f543a4b03cee917022747c6b93ed03e39e3 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:13:49 +0530 Subject: [PATCH 38/64] Just exclude for now Signed-off-by: Mayank Shah --- .github/workflows/test.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2a912265..b1b4f4ba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -50,8 +50,6 @@ jobs: for operator in $OPERATOR_INSTALL; do helm install --namespace default $operator charts/$operator/.; done fi ct install --config .github/ct.yaml --excluded-charts=everest - ct install --config .github/ct.yaml --namespace=everest-system charts=everest # We cannot install Everest chart in any namespace other that everest-system - ct install --config .github/ct.yaml if [ -n "$OPERATOR_INSTALL" ]; then for operator in $OPERATOR_INSTALL; do helm uninstall --namespace default $operator; done fi From c23bb11655a3852da0cea5f19472943acea472bd Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:19:20 +0530 Subject: [PATCH 39/64] update codeowners and maintainers Signed-off-by: Mayank Shah --- .github/CODEOWNERS | 1 + charts/everest/Chart.yaml | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cd2aa92a..9e2757fd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,2 +1,3 @@ * @hors @tplavcic @nmarukovich @ptankov @jvpasinatto @eleo007 /charts/pmm/ @percona/pmm-review-be @spron-in +/charts/everest/ @percona/everest-backend diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index 81093856..b3a8f4c3 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -5,16 +5,22 @@ version: 0.0.0 appVersion: 0.0.0 type: application maintainers: -- name: mayankshah1607 - email: mayank.shah@percona.com + - name: mayankshah1607 + email: mayank.shah@percona.com + - name: oksana-grishchenko + email: oksana.grishchenko@percona.com + - name: recharte + email: diogo.recharte@percona.com + - name: michal-kralik + email: michal.kralik@percona.com dependencies: -- name: common - version: 0.0.1 - repository: "file://charts/common" - # This is not really a dependency, but we define it as one so that we're - # able to conditionally disable rendering these manifests along with the core chart manifests. - # The default behaviour of Helm is to always include the sub-chart manfiests unless explicitly disabled. -- name: everest-db-namespace - version: 0.0.1 - repository: "file://charts/everest-db-namespace" - condition: "everest-db-namespace.enabled" + - name: common + version: 0.0.1 + repository: "file://charts/common" + # This is not really a dependency, but we define it as one so that we're + # able to conditionally disable rendering these manifests along with the core chart manifests. + # The default behaviour of Helm is to always include the sub-chart manfiests unless explicitly disabled. + - name: everest-db-namespace + version: 0.0.1 + repository: "file://charts/everest-db-namespace" + condition: "everest-db-namespace.enabled" From a2914761df2c0608b3bd9605b9ef3096e0b93e5c Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:26:30 +0530 Subject: [PATCH 40/64] Add tech preview banner Signed-off-by: Mayank Shah --- charts/everest/README.md.gotmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/everest/README.md.gotmpl b/charts/everest/README.md.gotmpl index bf9771af..22172593 100644 --- a/charts/everest/README.md.gotmpl +++ b/charts/everest/README.md.gotmpl @@ -6,6 +6,10 @@ Useful links: - [Percona Everest Documentation](https://docs.percona.com/everest/index.html) - [Percona Everest GitHub](https://github.com/percona/everest) +> :warning: Note: This chart is currently in technical preview. +Future releases could potentially introduce breaking changes, and we cannot promise a migration path. If you plan on using it in production, +please do so at your own risk. + ## Usage ### Deploy Percona Everest From bd0976592aac1dd5119f601c95c6140bdd83f7c0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:27:38 +0530 Subject: [PATCH 41/64] gen docs Signed-off-by: Mayank Shah --- charts/everest/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/everest/README.md b/charts/everest/README.md index ad543ad5..525efe75 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -6,6 +6,10 @@ Useful links: - [Percona Everest Documentation](https://docs.percona.com/everest/index.html) - [Percona Everest GitHub](https://github.com/percona/everest) +> :warning: Note: This chart is currently in technical preview. +Future releases could potentially introduce breaking changes, and we cannot promise a migration path. If you plan on using it in production, +please do so at your own risk. + ## Usage ### Deploy Percona Everest @@ -62,6 +66,8 @@ The following table shows the configurable parameters of the Percona Everest cha | operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. | | operator.metricsAddr | string | `"127.0.0.1:8080"` | Metrics address for the operator. | | operator.resources | object | `{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"5m","memory":"64Mi"}}` | Resources to allocate for the operator container. | +| server.createAccountsSecret | bool | `true` | If disabled, the accounts secret will not be created by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | +| server.createJWTSecret | bool | `true` | If disabled, the JWT key secret will not be produced by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | | server.image | string | `"perconalab/everest"` | Image to use for the server container. | | server.rbac | string | `"g, admin, role:admin\n"` | RBAC policy for Everest. | | server.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"20Mi"}}` | Resources to allocate for the server container. | From 335036e57de03022dc667b1db0b718da69ca4fc5 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:28:43 +0530 Subject: [PATCH 42/64] Update banner Signed-off-by: Mayank Shah --- charts/everest/README.md | 4 ++-- charts/everest/README.md.gotmpl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index 525efe75..594babec 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -7,8 +7,8 @@ Useful links: - [Percona Everest GitHub](https://github.com/percona/everest) > :warning: Note: This chart is currently in technical preview. -Future releases could potentially introduce breaking changes, and we cannot promise a migration path. If you plan on using it in production, -please do so at your own risk. +Future releases could potentially introduce breaking changes, and we cannot promise a migration path. We do not recommend using this in production environment, +but if you do so, please be aware of the risks. ## Usage diff --git a/charts/everest/README.md.gotmpl b/charts/everest/README.md.gotmpl index 22172593..aaec2297 100644 --- a/charts/everest/README.md.gotmpl +++ b/charts/everest/README.md.gotmpl @@ -7,8 +7,8 @@ Useful links: - [Percona Everest GitHub](https://github.com/percona/everest) > :warning: Note: This chart is currently in technical preview. -Future releases could potentially introduce breaking changes, and we cannot promise a migration path. If you plan on using it in production, -please do so at your own risk. +Future releases could potentially introduce breaking changes, and we cannot promise a migration path. We do not recommend using this in production environment, +but if you do so, please be aware of the risks. ## Usage From c20a9fee0fd741e65d429d63fd303b0196f63c1a Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:30:01 +0530 Subject: [PATCH 43/64] Remove unused options Signed-off-by: Mayank Shah --- charts/everest/README.md | 2 -- charts/everest/values.yaml | 4 ---- 2 files changed, 6 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index 594babec..55b1028b 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -50,11 +50,9 @@ The following table shows the configurable parameters of the Percona Everest cha | Key | Type | Default | Description | |-----|------|---------|-------------| | everest-db-namespace.enabled | bool | `false` | Do not enable. | -| monitoring.enabled | bool | `true` | Enable monitoring for Everest. | | monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.catalogSourceImage | string | `"perconalab/everest-catalog"` | Image to use for Everest CatalogSource. | -| olm.enabled | bool | `true` | Enable OLM for Everest. | | olm.image | string | `"quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6"` | Image to use for the OLM components. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed. Do no change unless you know what you are doing. | | olm.packageserver.tls.caCert | string | `""` | CA certificate for the PackageServer APIService. Overrides the tls.type setting. | diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 23c7ce5d..c01cce29 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -46,8 +46,6 @@ operator: olm: # -- Namespace where OLM is installed. Do no change unless you know what you are doing. namespace: everest-olm - # -- Enable OLM for Everest. - enabled: true # -- Image to use for Everest CatalogSource. catalogSourceImage: perconalab/everest-catalog # -- Image to use for the OLM components. @@ -68,8 +66,6 @@ olm: monitoring: # -- Namespace where monitoring is installed. Do no change unless you know what you are doing. namespace: everest-monitoring - # -- Enable monitoring for Everest. - enabled: true everest-db-namespace: # -- Do not enable. From bfc66e8de176c3b49e39cd9d846bf0fd4bcd6f16 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:39:50 +0530 Subject: [PATCH 44/64] Update docs Signed-off-by: Mayank Shah --- charts/everest/README.md | 14 ++++++++++++++ charts/everest/README.md.gotmpl | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/charts/everest/README.md b/charts/everest/README.md index 55b1028b..efe9603d 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -43,6 +43,20 @@ EOF helm install everest percona/everest-db-namespace --namespace everest ``` +### Uninstalling + +As a first step, you must always clean up your database namespace(s) first, otherwise the deletion could get stuck. +```sh +helm uninstall everest -n everest +kubectl delete ns everest +``` + +Then you can uninstall Everest itself: +```sh +helm uninstall everest-core -n everest-system +kubectl delete ns everest-system +``` + ## Configuration The following table shows the configurable parameters of the Percona Everest chart and their default values. diff --git a/charts/everest/README.md.gotmpl b/charts/everest/README.md.gotmpl index aaec2297..ce683a71 100644 --- a/charts/everest/README.md.gotmpl +++ b/charts/everest/README.md.gotmpl @@ -43,6 +43,20 @@ EOF helm install everest percona/everest-db-namespace --namespace everest ``` +### Uninstalling + +As a first step, you must always clean up your database namespace(s) first, otherwise the deletion could get stuck. +```sh +helm uninstall everest -n everest +kubectl delete ns everest +``` + +Then you can uninstall Everest itself: +```sh +helm uninstall everest-core -n everest-system +kubectl delete ns everest-system +``` + ## Configuration The following table shows the configurable parameters of the Percona Everest chart and their default values. From 2f6478b86c46c6a6bdc2c575da80c3ba271c217d Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:48:33 +0530 Subject: [PATCH 45/64] Add OIDC settings Signed-off-by: Mayank Shah --- .../{rbac.configmaps.yaml => rbac.configmap.yaml} | 0 .../templates/everest-server/settings.configmap.yaml | 11 +++++++++++ charts/everest/values.yaml | 5 +++++ 3 files changed, 16 insertions(+) rename charts/everest/templates/everest-server/{rbac.configmaps.yaml => rbac.configmap.yaml} (100%) create mode 100644 charts/everest/templates/everest-server/settings.configmap.yaml diff --git a/charts/everest/templates/everest-server/rbac.configmaps.yaml b/charts/everest/templates/everest-server/rbac.configmap.yaml similarity index 100% rename from charts/everest/templates/everest-server/rbac.configmaps.yaml rename to charts/everest/templates/everest-server/rbac.configmap.yaml diff --git a/charts/everest/templates/everest-server/settings.configmap.yaml b/charts/everest/templates/everest-server/settings.configmap.yaml new file mode 100644 index 00000000..3b8d04be --- /dev/null +++ b/charts/everest/templates/everest-server/settings.configmap.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: everest-settings + namespace: {{ include "everest.namespace" . }} +data: + {{- if .Values.server.oidc }} + oidc.config: | + {{- toYaml .Values.server.oidc | nindent 4 }} + {{- end }} + diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index c01cce29..f9e0846b 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -24,6 +24,11 @@ server: # -- If disabled, the JWT key secret will not be produced by the chart, # and needs to be created manually. Useful when integrating with GitOps tools. createJWTSecret: true + # -- OIDC configuration for Everest. + oidc: {} + # issuerUrl: "" + # clientId: "" + operator: # -- Image to use for the Everest operator container. From c81edb786f3930ae1b34b80879bb59f3fc01db0f Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 10 Oct 2024 16:48:44 +0530 Subject: [PATCH 46/64] Update readme Signed-off-by: Mayank Shah --- charts/everest/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/everest/README.md b/charts/everest/README.md index efe9603d..fe6fc4ef 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -81,6 +81,7 @@ The following table shows the configurable parameters of the Percona Everest cha | server.createAccountsSecret | bool | `true` | If disabled, the accounts secret will not be created by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | | server.createJWTSecret | bool | `true` | If disabled, the JWT key secret will not be produced by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | | server.image | string | `"perconalab/everest"` | Image to use for the server container. | +| server.oidc | object | `{}` | OIDC configuration for Everest. | | server.rbac | string | `"g, admin, role:admin\n"` | RBAC policy for Everest. | | server.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"20Mi"}}` | Resources to allocate for the server container. | | telemetry | bool | `true` | If set, enabled sending telemetry information. | From 32ecb8121c977e48464d6b3799e5a572b143a039 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Fri, 11 Oct 2024 11:36:41 +0530 Subject: [PATCH 47/64] Use lookup Signed-off-by: Mayank Shah --- charts/everest/README.md | 2 -- .../everest/templates/everest-server/accounts.secret.yaml | 3 ++- charts/everest/templates/everest-server/jwt.secret.yaml | 3 ++- charts/everest/values.yaml | 6 ------ 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index fe6fc4ef..ad776d47 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -78,8 +78,6 @@ The following table shows the configurable parameters of the Percona Everest cha | operator.image | string | `"perconalab/everest-operator"` | Image to use for the Everest operator container. | | operator.metricsAddr | string | `"127.0.0.1:8080"` | Metrics address for the operator. | | operator.resources | object | `{"limits":{"cpu":"500m","memory":"128Mi"},"requests":{"cpu":"5m","memory":"64Mi"}}` | Resources to allocate for the operator container. | -| server.createAccountsSecret | bool | `true` | If disabled, the accounts secret will not be created by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | -| server.createJWTSecret | bool | `true` | If disabled, the JWT key secret will not be produced by the chart, and needs to be created manually. Useful when integrating with GitOps tools. | | server.image | string | `"perconalab/everest"` | Image to use for the server container. | | server.oidc | object | `{}` | OIDC configuration for Everest. | | server.rbac | string | `"g, admin, role:admin\n"` | RBAC policy for Everest. | diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index d0501568..40a27ff9 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -1,4 +1,5 @@ -{{- if .Values.server.createAccountsSecret }} +{{- $secretName := (printf "everest-accounts") -}} +{{- if not (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) }} apiVersion: v1 kind: Secret metadata: diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index db34e482..773a6cf2 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -1,4 +1,5 @@ -{{- if .Values.server.createJWTSecret }} +{{- $secretName := (printf "everest-jwt") -}} +{{- if not (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) }} apiVersion: v1 kind: Secret metadata: diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index f9e0846b..0fceb294 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -18,12 +18,6 @@ server: # -- RBAC policy for Everest. rbac: | g, admin, role:admin - # -- If disabled, the accounts secret will not be created by the chart, - # and needs to be created manually. Useful when integrating with GitOps tools. - createAccountsSecret: true - # -- If disabled, the JWT key secret will not be produced by the chart, - # and needs to be created manually. Useful when integrating with GitOps tools. - createJWTSecret: true # -- OIDC configuration for Everest. oidc: {} # issuerUrl: "" From 5dab2de613511973805267e379a5092b50ac0423 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Sun, 20 Oct 2024 18:06:22 +0530 Subject: [PATCH 48/64] Openshift support Signed-off-by: Mayank Shah --- .../everest-db-namespace/templates/_helpers.tpl | 11 +++++++++++ .../everest-db-namespace/templates/operatorgroup.yaml | 4 ++-- .../templates/pg.subscription.yaml | 4 ++-- .../templates/psmdb.subscription.yaml | 4 ++-- .../templates/pxc.subscription.yaml | 4 ++-- .../everest/charts/everest-db-namespace/values.yaml | 5 +++++ charts/everest/templates/_helpers.tpl | 11 +++++++++++ .../templates/everest-monitoring/subscription.yaml | 2 +- .../everest-olm/catalog-operator.deployment.yaml | 4 +++- .../templates/everest-olm/certs.certmanager.yaml | 10 ++++++---- charts/everest/templates/everest-olm/clusterrole.yaml | 2 ++ .../templates/everest-olm/clusterrolebinding.yaml | 4 +++- .../templates/everest-olm/everest-catalogsource.yaml | 2 +- charts/everest/templates/everest-olm/namespace.yaml | 4 +++- .../everest-olm/olm-operator.deployment.yaml | 4 +++- charts/everest/templates/everest-olm/olmconfig.yaml | 2 ++ .../everest/templates/everest-olm/operatorgroup.yaml | 6 ++++-- .../everest-olm/packageserver.apiservice.yaml | 7 ++++--- .../everest-olm/packageserver.deployment.yaml | 4 +++- .../templates/everest-olm/packageserver.rbac.yaml | 4 +++- .../templates/everest-olm/packageserver.service.yaml | 4 +++- .../everest/templates/everest-olm/serviceaccount.yaml | 5 +++-- charts/everest/values.yaml | 5 +++++ 23 files changed, 84 insertions(+), 28 deletions(-) diff --git a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl index 03690fb3..2b1f01ca 100644 --- a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl +++ b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl @@ -4,3 +4,14 @@ Allows overriding the install namespace in combined charts. {{- define "db.namespace" -}} {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }} {{- end }} + +{{/* +Allow overriding OLM namespacse +*/}} +{{- define "db.olmNamespace"}} +{{- if .Values.global.compatibility.openshift }} +{{- "openshift-marketplace" }} +{{- else }} +{{- .Values.olm.namespace }} +{{- end }} +{{- end }} diff --git a/charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml b/charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml index 91a0f3fc..ce08ab8c 100644 --- a/charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/operatorgroup.yaml @@ -2,9 +2,9 @@ apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: database-operators - namespace: {{ .Release.Namespace }} + namespace: {{ include "db.namespace" . }} spec: targetNamespaces: - - {{ .Release.Namespace }} + - {{ include "db.namespace" . }} upgradeStrategy: Default diff --git a/charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml index 33aeacdb..20a15ab7 100644 --- a/charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/pg.subscription.yaml @@ -3,13 +3,13 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-postgresql-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "db.namespace" . }} spec: channel: stable-v2 installPlanApproval: Manual name: percona-postgresql-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: {{ include "db.olmNamespace" . }} config: env: - name: DISABLE_TELEMETRY diff --git a/charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml index 2b171bdd..41b5539e 100644 --- a/charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/psmdb.subscription.yaml @@ -3,13 +3,13 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-server-mongodb-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "db.namespace" . }} spec: channel: stable-v1 installPlanApproval: Manual name: percona-server-mongodb-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: {{ include "db.olmNamespace" . }} config: env: - name: DISABLE_TELEMETRY diff --git a/charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml b/charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml index 375f74fa..07a86430 100644 --- a/charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml +++ b/charts/everest/charts/everest-db-namespace/templates/pxc.subscription.yaml @@ -3,13 +3,13 @@ apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: percona-xtradb-cluster-operator - namespace: {{ .Release.Namespace }} + namespace: {{ include "db.namespace" . }} spec: channel: stable-v1 installPlanApproval: Manual name: percona-xtradb-cluster-operator source: everest-catalog - sourceNamespace: {{ $.Values.olm.namespace }} + sourceNamespace: {{ include "db.olmNamespace" . }} config: env: - name: DISABLE_TELEMETRY diff --git a/charts/everest/charts/everest-db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml index d1423609..3a7d3f1d 100644 --- a/charts/everest/charts/everest-db-namespace/values.yaml +++ b/charts/everest/charts/everest-db-namespace/values.yaml @@ -1,3 +1,8 @@ +global: + compatibility: + # -- Enable Openshift compatibility. Currently in technical preview. + openshift: false + # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" # -- If set, enabled sending telemetry information. diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index d6b151bc..4f7e96cb 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -12,6 +12,17 @@ Allows overriding the install namespace in combined charts. {{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Allow overriding OLM namespacse +*/}} +{{- define "everest.olmNamespace"}} +{{- if .Values.global.compatibility.openshift }} +{{- "openshift-marketplace" }} +{{- else }} +{{- .Values.olm.namespace }} +{{- end }} +{{- 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). diff --git a/charts/everest/templates/everest-monitoring/subscription.yaml b/charts/everest/templates/everest-monitoring/subscription.yaml index e7d3cc9f..c3e933bc 100644 --- a/charts/everest/templates/everest-monitoring/subscription.yaml +++ b/charts/everest/templates/everest-monitoring/subscription.yaml @@ -9,4 +9,4 @@ spec: installPlanApproval: Manual name: victoriametrics-operator source: everest-catalog - sourceNamespace: everest-olm + sourceNamespace: {{ include "everest.olmNamespace" . }} diff --git a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml index e597268d..312acc9e 100644 --- a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml @@ -1,8 +1,9 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: name: catalog-operator - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} labels: app: catalog-operator spec: @@ -59,3 +60,4 @@ spec: memory: 80Mi nodeSelector: kubernetes.io/os: linux +{{- end }} diff --git a/charts/everest/templates/everest-olm/certs.certmanager.yaml b/charts/everest/templates/everest-olm/certs.certmanager.yaml index 82291150..af39411c 100644 --- a/charts/everest/templates/everest-olm/certs.certmanager.yaml +++ b/charts/everest/templates/everest-olm/certs.certmanager.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.global.compatibility.openshift }} {{- if eq .Values.olm.packageserver.tls.type "cert-manager"}} {{- $tls := fromYaml (include "olm.certs" .) }} --- @@ -5,7 +6,7 @@ apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: olm-ca-issuer - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: selfSigned: {} --- @@ -13,7 +14,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: olm-ca-cert - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: secretName: olm-ca-cert duration: 87600h # 10 year @@ -28,7 +29,7 @@ apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: olm-cert-issuer - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: ca: secretName: olm-ca-cert @@ -37,7 +38,7 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: olm-packageserver-tls - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: secretName: packageserver-service-cert commonName: {{ $tls.commonName }} @@ -48,3 +49,4 @@ spec: kind: Issuer --- {{- end }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrole.yaml b/charts/everest/templates/everest-olm/clusterrole.yaml index 13c7abdb..bfb593ce 100644 --- a/charts/everest/templates/everest-olm/clusterrole.yaml +++ b/charts/everest/templates/everest-olm/clusterrole.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -39,3 +40,4 @@ rules: - apiGroups: ["packages.operators.coreos.com"] resources: ["packagemanifests", "packagemanifests/icon"] verbs: ["get", "list", "watch"] +{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrolebinding.yaml b/charts/everest/templates/everest-olm/clusterrolebinding.yaml index 63ab10d3..88b09ef1 100644 --- a/charts/everest/templates/everest-olm/clusterrolebinding.yaml +++ b/charts/everest/templates/everest-olm/clusterrolebinding.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -8,5 +9,6 @@ roleRef: name: system:controller:operator-lifecycle-manager subjects: - kind: ServiceAccount + namespace: {{ include "everest.olmNamespace" . }} name: olm-operator-serviceaccount - namespace: {{ .Values.olm.namespace }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/everest-catalogsource.yaml b/charts/everest/templates/everest-olm/everest-catalogsource.yaml index acb25b2c..b174715a 100644 --- a/charts/everest/templates/everest-olm/everest-catalogsource.yaml +++ b/charts/everest/templates/everest-olm/everest-catalogsource.yaml @@ -2,7 +2,7 @@ apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: everest-catalog - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: displayName: Everest Catalog grpcPodConfig: diff --git a/charts/everest/templates/everest-olm/namespace.yaml b/charts/everest/templates/everest-olm/namespace.yaml index 0d16e074..76704726 100644 --- a/charts/everest/templates/everest-olm/namespace.yaml +++ b/charts/everest/templates/everest-olm/namespace.yaml @@ -1,4 +1,6 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: v1 kind: Namespace metadata: - name: {{ .Values.olm.namespace }} + name: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml index 736a1ca3..63a58b65 100644 --- a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml @@ -1,8 +1,9 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: name: olm-operator - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} labels: app: olm-operator spec: @@ -64,3 +65,4 @@ spec: memory: 160Mi nodeSelector: kubernetes.io/os: linux +{{- end }} diff --git a/charts/everest/templates/everest-olm/olmconfig.yaml b/charts/everest/templates/everest-olm/olmconfig.yaml index ad881b7b..81c4bbc0 100644 --- a/charts/everest/templates/everest-olm/olmconfig.yaml +++ b/charts/everest/templates/everest-olm/olmconfig.yaml @@ -1,4 +1,6 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: operators.coreos.com/v1 kind: OLMConfig metadata: name: cluster +{{- end }} diff --git a/charts/everest/templates/everest-olm/operatorgroup.yaml b/charts/everest/templates/everest-olm/operatorgroup.yaml index c3c6cbfe..219a48fc 100644 --- a/charts/everest/templates/everest-olm/operatorgroup.yaml +++ b/charts/everest/templates/everest-olm/operatorgroup.yaml @@ -1,8 +1,10 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: olm-operators - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: targetNamespaces: - - everest-olm + - {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml index 075c00e2..aa830c52 100644 --- a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.global.compatibility.openshift }} {{- $tls := fromYaml (include "olm.certs" .) }} --- apiVersion: apiregistration.k8s.io/v1 @@ -18,7 +19,7 @@ spec: versionPriority: 800 service: name: packageserver-service - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} port: 5443 --- {{- if ne .Values.olm.packageserver.tls.type "cert-manager" }} @@ -29,7 +30,7 @@ data: kind: Secret metadata: name: packageserver-service-cert - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} type: kubernetes.io/tls {{- end }} ---- +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.deployment.yaml b/charts/everest/templates/everest-olm/packageserver.deployment.yaml index a7492161..dbacebc4 100644 --- a/charts/everest/templates/everest-olm/packageserver.deployment.yaml +++ b/charts/everest/templates/everest-olm/packageserver.deployment.yaml @@ -1,8 +1,9 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: name: packageserver - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: progressDeadlineSeconds: 600 replicas: 2 @@ -107,3 +108,4 @@ spec: - key: tls.key path: tls.key secretName: packageserver-service-cert +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.rbac.yaml b/charts/everest/templates/everest-olm/packageserver.rbac.yaml index f64ac31b..4e30afaa 100644 --- a/charts/everest/templates/everest-olm/packageserver.rbac.yaml +++ b/charts/everest/templates/everest-olm/packageserver.rbac.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -43,4 +44,5 @@ roleRef: subjects: - kind: ServiceAccount name: olm-operator-serviceaccount - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.service.yaml b/charts/everest/templates/everest-olm/packageserver.service.yaml index dd1b8611..69b1669f 100644 --- a/charts/everest/templates/everest-olm/packageserver.service.yaml +++ b/charts/everest/templates/everest-olm/packageserver.service.yaml @@ -1,8 +1,9 @@ +{{- if not .Values.global.compatibility.openshift }} apiVersion: v1 kind: Service metadata: name: packageserver-service - namespace: {{ .Values.olm.namespace }} + namespace: {{ include "everest.olmNamespace" . }} spec: internalTrafficPolicy: Cluster ports: @@ -13,3 +14,4 @@ spec: selector: app: packageserver type: ClusterIP +{{- end }} diff --git a/charts/everest/templates/everest-olm/serviceaccount.yaml b/charts/everest/templates/everest-olm/serviceaccount.yaml index ecd31ba5..268a020a 100644 --- a/charts/everest/templates/everest-olm/serviceaccount.yaml +++ b/charts/everest/templates/everest-olm/serviceaccount.yaml @@ -1,6 +1,7 @@ +{{- if not .Values.global.compatibility.openshift }} kind: ServiceAccount apiVersion: v1 metadata: name: olm-operator-serviceaccount - namespace: {{ .Values.olm.namespace }} - + namespace: {{ include "everest.olmNamespace" . }} +{{- end }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 0fceb294..a16fbc2b 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,3 +1,8 @@ +global: + compatibility: + # -- Enable Openshift compatibility. Currently in technical preview. + openshift: false + # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" From 4517e64d418a977cf7b485a64afafef8cf161dd7 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Sun, 20 Oct 2024 18:07:40 +0530 Subject: [PATCH 49/64] Docs gen Signed-off-by: Mayank Shah --- charts/everest/README.md | 1 + charts/everest/charts/everest-db-namespace/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/charts/everest/README.md b/charts/everest/README.md index ad776d47..07450cf8 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -64,6 +64,7 @@ The following table shows the configurable parameters of the Percona Everest cha | Key | Type | Default | Description | |-----|------|---------|-------------| | everest-db-namespace.enabled | bool | `false` | Do not enable. | +| global.compatibility.openshift | bool | `false` | Enable Openshift compatibility. Currently in technical preview. | | monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.catalogSourceImage | string | `"perconalab/everest-catalog"` | Image to use for Everest CatalogSource. | diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md index 5e0da18b..6efc71f5 100644 --- a/charts/everest/charts/everest-db-namespace/README.md +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -15,6 +15,7 @@ A sub-chart for provisioning Everest DB namespaces. | Key | Type | Default | Description | |-----|------|---------|-------------| | cleanupOnUninstall | bool | `true` | If set, cleans up the DB resources on uninstall. | +| global.compatibility.openshift | bool | `false` | Enable Openshift compatibility. Currently in technical preview. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed in the cluster. | | pg | bool | `true` | If set, installs the Percona Postgresql Server operator. | From 888aaeaa57a139a86658f33275d250b060c1aff5 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 18:29:05 +0530 Subject: [PATCH 50/64] Fixes Signed-off-by: Mayank Shah --- charts/everest/.helmignore | 2 ++ charts/everest/Makefile | 10 +++++++--- charts/everest/charts/everest-db-namespace/Chart.yaml | 4 ++-- charts/everest/charts/everest-db-namespace/README.md | 2 +- scripts/gen-docs.sh | 9 --------- 5 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 scripts/gen-docs.sh diff --git a/charts/everest/.helmignore b/charts/everest/.helmignore index 0e8a0eb3..3b8e021c 100644 --- a/charts/everest/.helmignore +++ b/charts/everest/.helmignore @@ -21,3 +21,5 @@ .idea/ *.tmproj .vscode/ + +Makefile diff --git a/charts/everest/Makefile b/charts/everest/Makefile index c975e4dd..4320cd41 100644 --- a/charts/everest/Makefile +++ b/charts/everest/Makefile @@ -1,7 +1,9 @@ prepare-chart: - yq eval -i '.version = "${VERSION}"' Chart.yaml - yq eval -i '.appVersion = "${VERSION}"' Chart.yaml - + CHART_FILES="Chart.yaml charts/everest-db-namespace/Chart.yaml" + for chart in $${CHART_FILES}; do \ + yq eval -i '.version = "${VERSION}"' $${chart}; \ + yq eval -i '.appVersion = "${VERSION}"' $${chart}; \ + done release: prepare-chart yq eval -i '.server.image = "percona/everest"' values.yaml @@ -13,3 +15,5 @@ release-dev: prepare-chart yq eval -i '.olm.catalogSourceImage = "perconalab/everest-catalog"' values.yaml yq eval -i '.operator.image = "perconalab/everest-operator"' values.yaml +docs-gen: + docker run --rm -v "$(PWD)/:/helm-docs" -u $(shell id -u) jnorwood/helm-docs:v1.9.1 diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 45f601b2..99bfbb6a 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: everest-db-namespace description: A sub-chart for provisioning Everest DB namespaces. type: application -version: 0.0.1 -appVersion: "0.0.1" +version: 0.0.0 +appVersion: 0.0.0 dependencies: - name: common version: 0.0.1 diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md index 6efc71f5..e296f8ab 100644 --- a/charts/everest/charts/everest-db-namespace/README.md +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -1,6 +1,6 @@ # everest-db-namespace -![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square) +![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square) A sub-chart for provisioning Everest DB namespaces. diff --git a/scripts/gen-docs.sh b/scripts/gen-docs.sh deleted file mode 100644 index 79f0f209..00000000 --- a/scripts/gen-docs.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -## Reference: https://github.com/norwoodj/helm-docs -set -eux - -# Usage: -# sh ./scripts/gen-docs.sh - -echo "Generating docs..." -docker run --rm -v "$1/:/helm-docs" -u $(id -u) jnorwood/helm-docs:v1.9.1 From 1c119fa7ee33fdabc879d708b3749fa35e89c6da Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 18:31:48 +0530 Subject: [PATCH 51/64] Fix makefile Signed-off-by: Mayank Shah --- charts/everest/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/everest/Makefile b/charts/everest/Makefile index 4320cd41..a840a331 100644 --- a/charts/everest/Makefile +++ b/charts/everest/Makefile @@ -1,10 +1,11 @@ prepare-chart: - CHART_FILES="Chart.yaml charts/everest-db-namespace/Chart.yaml" - for chart in $${CHART_FILES}; do \ - yq eval -i '.version = "${VERSION}"' $${chart}; \ - yq eval -i '.appVersion = "${VERSION}"' $${chart}; \ + CHART_FILES="Chart.yaml ./charts/everest-db-namespace/Chart.yaml"; \ + for chart in $$CHART_FILES; do \ + yq eval -i '.version = "${VERSION}"' $$chart; \ + yq eval -i '.appVersion = "${VERSION}"' $$chart; \ done + release: prepare-chart yq eval -i '.server.image = "percona/everest"' values.yaml yq eval -i '.olm.catalogSourceImage = "percona/everest-catalog"' values.yaml From 319d664a5128f56b9447d2f218378a6432ad382d Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 18:34:50 +0530 Subject: [PATCH 52/64] More fixes Signed-off-by: Mayank Shah --- charts/everest/charts/everest-db-namespace/Chart.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 99bfbb6a..143a75e3 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -5,6 +5,6 @@ type: application version: 0.0.0 appVersion: 0.0.0 dependencies: -- name: common - version: 0.0.1 - repository: "file://../common" + - name: common + version: 0.0.1 + repository: "file://../common" From e842bbff96943d6eb7f5b599ab091d5e1b1d4f31 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:34:18 +0530 Subject: [PATCH 53/64] Add kubeVersion Signed-off-by: Mayank Shah --- charts/everest/charts/everest-db-namespace/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index 143a75e3..e00e811d 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -4,6 +4,7 @@ description: A sub-chart for provisioning Everest DB namespaces. type: application version: 0.0.0 appVersion: 0.0.0 +kubeVersion: >= 1.27.0 dependencies: - name: common version: 0.0.1 From 6a382c839331b6bce7e5bb8f5b4e7bbaa5104d4f Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:44:27 +0530 Subject: [PATCH 54/64] Fix Makefile Signed-off-by: Mayank Shah --- charts/everest/Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/charts/everest/Makefile b/charts/everest/Makefile index a840a331..45065173 100644 --- a/charts/everest/Makefile +++ b/charts/everest/Makefile @@ -4,17 +4,16 @@ prepare-chart: yq eval -i '.version = "${VERSION}"' $$chart; \ yq eval -i '.appVersion = "${VERSION}"' $$chart; \ done + yq eval -i '.server.image = "$(IMAGE_PREFIX)/everest"' values.yaml + yq eval -i '.olm.catalogSourceImage = "$(IMAGE_PREFIX)/everest-catalog"' values.yaml + yq eval -i '.operator.image = "$(IMAGE_PREFIX)/everest-operator"' values.yaml + yq eval -i '.dependencies[] | select(.name == "everest-db-namespace") .version = "${VERSION}"' Chart.yaml - +release: IMAGE_PREFIX=percona release: prepare-chart - yq eval -i '.server.image = "percona/everest"' values.yaml - yq eval -i '.olm.catalogSourceImage = "percona/everest-catalog"' values.yaml - yq eval -i '.operator.image = "percona/everest-operator"' values.yaml +release-dev: IMAGE_PREFIX=perconalab release-dev: prepare-chart - yq eval -i '.server.image = "perconalab/everest"' values.yaml - yq eval -i '.olm.catalogSourceImage = "perconalab/everest-catalog"' values.yaml - yq eval -i '.operator.image = "perconalab/everest-operator"' values.yaml docs-gen: docker run --rm -v "$(PWD)/:/helm-docs" -u $(shell id -u) jnorwood/helm-docs:v1.9.1 From 171d7a2570e22d93a2e610637e0e9bc265cd6442 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:44:50 +0530 Subject: [PATCH 55/64] Update deps Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index b3a8f4c3..e38d5267 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -21,6 +21,6 @@ dependencies: # able to conditionally disable rendering these manifests along with the core chart manifests. # The default behaviour of Helm is to always include the sub-chart manfiests unless explicitly disabled. - name: everest-db-namespace - version: 0.0.1 + version: 0.0.0 repository: "file://charts/everest-db-namespace" condition: "everest-db-namespace.enabled" From e09fbdbb71054264851167dd0034928f1a6b44a0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:48:54 +0530 Subject: [PATCH 56/64] Fix Makefile Signed-off-by: Mayank Shah --- charts/everest/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/everest/Makefile b/charts/everest/Makefile index 45065173..23d38c6f 100644 --- a/charts/everest/Makefile +++ b/charts/everest/Makefile @@ -7,7 +7,8 @@ prepare-chart: yq eval -i '.server.image = "$(IMAGE_PREFIX)/everest"' values.yaml yq eval -i '.olm.catalogSourceImage = "$(IMAGE_PREFIX)/everest-catalog"' values.yaml yq eval -i '.operator.image = "$(IMAGE_PREFIX)/everest-operator"' values.yaml - yq eval -i '.dependencies[] | select(.name == "everest-db-namespace") .version = "${VERSION}"' Chart.yaml + yq eval -i '(.dependencies[] | select(.name == "everest-db-namespace")).version = "${VERSION}"' Chart.yaml + release: IMAGE_PREFIX=percona release: prepare-chart From f2b341a8a26dd6c1314e7832c58a0bfeb0934e59 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:50:21 +0530 Subject: [PATCH 57/64] Fix kubeVersion Signed-off-by: Mayank Shah --- charts/everest/Chart.yaml | 1 + charts/everest/charts/everest-db-namespace/Chart.yaml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/everest/Chart.yaml b/charts/everest/Chart.yaml index e38d5267..8ab00d99 100644 --- a/charts/everest/Chart.yaml +++ b/charts/everest/Chart.yaml @@ -4,6 +4,7 @@ description: A cloud-native database platform version: 0.0.0 appVersion: 0.0.0 type: application +kubeVersion: '>= 1.27.0' maintainers: - name: mayankshah1607 email: mayank.shah@percona.com diff --git a/charts/everest/charts/everest-db-namespace/Chart.yaml b/charts/everest/charts/everest-db-namespace/Chart.yaml index e00e811d..143a75e3 100644 --- a/charts/everest/charts/everest-db-namespace/Chart.yaml +++ b/charts/everest/charts/everest-db-namespace/Chart.yaml @@ -4,7 +4,6 @@ description: A sub-chart for provisioning Everest DB namespaces. type: application version: 0.0.0 appVersion: 0.0.0 -kubeVersion: >= 1.27.0 dependencies: - name: common version: 0.0.1 From 323ba4a6a5a65ac2b4cbeea0ebff9a02b3e2e85b Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:52:47 +0530 Subject: [PATCH 58/64] Fix linebreaks Signed-off-by: Mayank Shah --- charts/everest/values.yaml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index a16fbc2b..2624dacb 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -2,13 +2,10 @@ global: compatibility: # -- Enable Openshift compatibility. Currently in technical preview. openshift: false - # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" - # -- If set, enabled sending telemetry information. telemetry: true - server: # -- Image to use for the server container. image: perconalab/everest @@ -25,10 +22,8 @@ server: g, admin, role:admin # -- OIDC configuration for Everest. oidc: {} - # issuerUrl: "" - # clientId: "" - - + # issuerUrl: "" + # clientId: "" operator: # -- Image to use for the Everest operator container. image: perconalab/everest-operator @@ -46,15 +41,13 @@ operator: requests: cpu: 5m memory: 64Mi - olm: # -- Namespace where OLM is installed. Do no change unless you know what you are doing. namespace: everest-olm # -- Image to use for Everest CatalogSource. catalogSourceImage: perconalab/everest-catalog # -- Image to use for the OLM components. - image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 - + image: quay.io/operator-framework/olm@sha256:1b6002156f568d722c29138575733591037c24b4bfabc67946f268ce4752c3e6 packageserver: tls: # -- Type of TLS certificates. Supported values are "helm" and "cert-manager". @@ -66,11 +59,9 @@ olm: tlsCert: "" # -- Client key for the PackageServer APIService. Overrides the tls.type setting. tlsKey: "" - monitoring: # -- Namespace where monitoring is installed. Do no change unless you know what you are doing. namespace: everest-monitoring - everest-db-namespace: # -- Do not enable. enabled: false From 9600af137e4dac427ebfca0487ec6d97a96f6e22 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Mon, 21 Oct 2024 20:53:52 +0530 Subject: [PATCH 59/64] Update deps Signed-off-by: Mayank Shah --- charts/everest/Chart.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/everest/Chart.lock b/charts/everest/Chart.lock index 77e1ff8c..a0a0101d 100644 --- a/charts/everest/Chart.lock +++ b/charts/everest/Chart.lock @@ -4,6 +4,6 @@ dependencies: version: 0.0.1 - name: everest-db-namespace repository: file://charts/everest-db-namespace - version: 0.0.1 -digest: sha256:ba5282ada65ac76797ff6e6e9d9a1b989102196a74934e6dd07522e94e47c178 -generated: "2024-10-09T14:20:24.150243+05:30" + version: 0.0.0 +digest: sha256:c41bc5832c4bf3829a3ceabb7b3fcd2461035cc66986aa0acea8e7b366a6e036 +generated: "2024-10-21T20:53:46.621274+05:30" From 080a1b7117f617818d63a3e61958c38c9f7d23f0 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Wed, 23 Oct 2024 16:25:57 +0530 Subject: [PATCH 60/64] Fix secrets Signed-off-by: Mayank Shah --- .../templates/everest-server/accounts.secret.yaml | 10 +++++++--- .../everest/templates/everest-server/jwt.secret.yaml | 11 +++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 40a27ff9..48eb2e82 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -1,5 +1,5 @@ {{- $secretName := (printf "everest-accounts") -}} -{{- if not (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) }} +{{- $secret := (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) -}} apiVersion: v1 kind: Secret metadata: @@ -7,7 +7,11 @@ metadata: namespace: {{ include "everest.namespace" . }} annotations: insecure-password/admin: "true" - helm.sh/hook: pre-install data: + {{- if not $secret }} users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} -{{- end }} + {{- else }} + {{- range $key, $value := $secret.data }} + {{ $key }}: {{ $value }} + {{- end }} + {{- end }} diff --git a/charts/everest/templates/everest-server/jwt.secret.yaml b/charts/everest/templates/everest-server/jwt.secret.yaml index 773a6cf2..519dc6ad 100644 --- a/charts/everest/templates/everest-server/jwt.secret.yaml +++ b/charts/everest/templates/everest-server/jwt.secret.yaml @@ -1,12 +1,15 @@ {{- $secretName := (printf "everest-jwt") -}} -{{- if not (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) }} +{{- $secret := (lookup "v1" "Secret" (include "everest.namespace" .) $secretName ) -}} apiVersion: v1 kind: Secret metadata: name: everest-jwt namespace: {{ include "everest.namespace" . }} - annotations: - helm.sh/hook: pre-install data: + {{- if not $secret }} id_rsa: {{ genPrivateKey "rsa" | b64enc }} -{{- end }} + {{- else }} + {{- range $key, $value := $secret.data }} + {{ $key }}: {{ $value }} + {{- end }} + {{- end }} From a747a3cb9ee4ffc1602da66760889673f3fd9a43 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Thu, 24 Oct 2024 15:10:08 +0530 Subject: [PATCH 61/64] Include Everest for tests Signed-off-by: Mayank Shah --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b1b4f4ba..98ab3948 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -4,7 +4,6 @@ on: pull_request: path-ignore: - 'charts/gcp-marketplace/**' - - 'charts/everest/**' jobs: lint-test: From 06c7f7a07f3aafde1a3ee3a6f22199ed64dcf194 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Fri, 25 Oct 2024 10:55:46 +0530 Subject: [PATCH 62/64] Remove openshift support Signed-off-by: Mayank Shah --- charts/everest/README.md | 1 - charts/everest/charts/everest-db-namespace/README.md | 1 - .../charts/everest-db-namespace/templates/_helpers.tpl | 4 ---- charts/everest/charts/everest-db-namespace/values.yaml | 5 ----- charts/everest/templates/_helpers.tpl | 6 +----- .../templates/everest-olm/catalog-operator.deployment.yaml | 2 -- charts/everest/templates/everest-olm/certs.certmanager.yaml | 2 -- charts/everest/templates/everest-olm/clusterrole.yaml | 2 -- .../everest/templates/everest-olm/clusterrolebinding.yaml | 2 -- charts/everest/templates/everest-olm/namespace.yaml | 2 -- .../templates/everest-olm/olm-operator.deployment.yaml | 2 -- charts/everest/templates/everest-olm/olmconfig.yaml | 2 -- charts/everest/templates/everest-olm/operatorgroup.yaml | 2 -- .../templates/everest-olm/packageserver.apiservice.yaml | 2 -- .../templates/everest-olm/packageserver.deployment.yaml | 2 -- .../everest/templates/everest-olm/packageserver.rbac.yaml | 2 -- .../templates/everest-olm/packageserver.service.yaml | 2 -- charts/everest/templates/everest-olm/serviceaccount.yaml | 2 -- charts/everest/values.yaml | 4 ---- 19 files changed, 1 insertion(+), 46 deletions(-) diff --git a/charts/everest/README.md b/charts/everest/README.md index 07450cf8..ad776d47 100644 --- a/charts/everest/README.md +++ b/charts/everest/README.md @@ -64,7 +64,6 @@ The following table shows the configurable parameters of the Percona Everest cha | Key | Type | Default | Description | |-----|------|---------|-------------| | everest-db-namespace.enabled | bool | `false` | Do not enable. | -| global.compatibility.openshift | bool | `false` | Enable Openshift compatibility. Currently in technical preview. | | monitoring.namespace | string | `"everest-monitoring"` | Namespace where monitoring is installed. Do no change unless you know what you are doing. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.catalogSourceImage | string | `"perconalab/everest-catalog"` | Image to use for Everest CatalogSource. | diff --git a/charts/everest/charts/everest-db-namespace/README.md b/charts/everest/charts/everest-db-namespace/README.md index e296f8ab..f3261bf9 100644 --- a/charts/everest/charts/everest-db-namespace/README.md +++ b/charts/everest/charts/everest-db-namespace/README.md @@ -15,7 +15,6 @@ A sub-chart for provisioning Everest DB namespaces. | Key | Type | Default | Description | |-----|------|---------|-------------| | cleanupOnUninstall | bool | `true` | If set, cleans up the DB resources on uninstall. | -| global.compatibility.openshift | bool | `false` | Enable Openshift compatibility. Currently in technical preview. | | namespaceOverride | string | `""` | Namespace override. Defaults to the value of .Release.Namespace. | | olm.namespace | string | `"everest-olm"` | Namespace where OLM is installed in the cluster. | | pg | bool | `true` | If set, installs the Percona Postgresql Server operator. | diff --git a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl index 2b1f01ca..c355a5f5 100644 --- a/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl +++ b/charts/everest/charts/everest-db-namespace/templates/_helpers.tpl @@ -9,9 +9,5 @@ Allows overriding the install namespace in combined charts. Allow overriding OLM namespacse */}} {{- define "db.olmNamespace"}} -{{- if .Values.global.compatibility.openshift }} -{{- "openshift-marketplace" }} -{{- else }} {{- .Values.olm.namespace }} {{- end }} -{{- end }} diff --git a/charts/everest/charts/everest-db-namespace/values.yaml b/charts/everest/charts/everest-db-namespace/values.yaml index 3a7d3f1d..d1423609 100644 --- a/charts/everest/charts/everest-db-namespace/values.yaml +++ b/charts/everest/charts/everest-db-namespace/values.yaml @@ -1,8 +1,3 @@ -global: - compatibility: - # -- Enable Openshift compatibility. Currently in technical preview. - openshift: false - # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" # -- If set, enabled sending telemetry information. diff --git a/charts/everest/templates/_helpers.tpl b/charts/everest/templates/_helpers.tpl index 4f7e96cb..1cf6b2a7 100644 --- a/charts/everest/templates/_helpers.tpl +++ b/charts/everest/templates/_helpers.tpl @@ -13,15 +13,11 @@ Allows overriding the install namespace in combined charts. {{- end }} {{/* -Allow overriding OLM namespacse +Allow overriding OLM namespace */}} {{- define "everest.olmNamespace"}} -{{- if .Values.global.compatibility.openshift }} -{{- "openshift-marketplace" }} -{{- else }} {{- .Values.olm.namespace }} {{- end }} -{{- end }} {{/* Create a default fully qualified app name. diff --git a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml index 312acc9e..de84975b 100644 --- a/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/catalog-operator.deployment.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: @@ -60,4 +59,3 @@ spec: memory: 80Mi nodeSelector: kubernetes.io/os: linux -{{- end }} diff --git a/charts/everest/templates/everest-olm/certs.certmanager.yaml b/charts/everest/templates/everest-olm/certs.certmanager.yaml index af39411c..d979b73c 100644 --- a/charts/everest/templates/everest-olm/certs.certmanager.yaml +++ b/charts/everest/templates/everest-olm/certs.certmanager.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} {{- if eq .Values.olm.packageserver.tls.type "cert-manager"}} {{- $tls := fromYaml (include "olm.certs" .) }} --- @@ -49,4 +48,3 @@ spec: kind: Issuer --- {{- end }} -{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrole.yaml b/charts/everest/templates/everest-olm/clusterrole.yaml index bfb593ce..13c7abdb 100644 --- a/charts/everest/templates/everest-olm/clusterrole.yaml +++ b/charts/everest/templates/everest-olm/clusterrole.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -40,4 +39,3 @@ rules: - apiGroups: ["packages.operators.coreos.com"] resources: ["packagemanifests", "packagemanifests/icon"] verbs: ["get", "list", "watch"] -{{- end }} diff --git a/charts/everest/templates/everest-olm/clusterrolebinding.yaml b/charts/everest/templates/everest-olm/clusterrolebinding.yaml index 88b09ef1..782afb89 100644 --- a/charts/everest/templates/everest-olm/clusterrolebinding.yaml +++ b/charts/everest/templates/everest-olm/clusterrolebinding.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -11,4 +10,3 @@ subjects: - kind: ServiceAccount namespace: {{ include "everest.olmNamespace" . }} name: olm-operator-serviceaccount -{{- end }} diff --git a/charts/everest/templates/everest-olm/namespace.yaml b/charts/everest/templates/everest-olm/namespace.yaml index 76704726..a7101de6 100644 --- a/charts/everest/templates/everest-olm/namespace.yaml +++ b/charts/everest/templates/everest-olm/namespace.yaml @@ -1,6 +1,4 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: v1 kind: Namespace metadata: name: {{ include "everest.olmNamespace" . }} -{{- end }} diff --git a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml index 63a58b65..51e80976 100644 --- a/charts/everest/templates/everest-olm/olm-operator.deployment.yaml +++ b/charts/everest/templates/everest-olm/olm-operator.deployment.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: @@ -65,4 +64,3 @@ spec: memory: 160Mi nodeSelector: kubernetes.io/os: linux -{{- end }} diff --git a/charts/everest/templates/everest-olm/olmconfig.yaml b/charts/everest/templates/everest-olm/olmconfig.yaml index 81c4bbc0..ad881b7b 100644 --- a/charts/everest/templates/everest-olm/olmconfig.yaml +++ b/charts/everest/templates/everest-olm/olmconfig.yaml @@ -1,6 +1,4 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: operators.coreos.com/v1 kind: OLMConfig metadata: name: cluster -{{- end }} diff --git a/charts/everest/templates/everest-olm/operatorgroup.yaml b/charts/everest/templates/everest-olm/operatorgroup.yaml index 219a48fc..3ec436ee 100644 --- a/charts/everest/templates/everest-olm/operatorgroup.yaml +++ b/charts/everest/templates/everest-olm/operatorgroup.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: @@ -7,4 +6,3 @@ metadata: spec: targetNamespaces: - {{ include "everest.olmNamespace" . }} -{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml index aa830c52..713667b3 100644 --- a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} {{- $tls := fromYaml (include "olm.certs" .) }} --- apiVersion: apiregistration.k8s.io/v1 @@ -33,4 +32,3 @@ metadata: namespace: {{ include "everest.olmNamespace" . }} type: kubernetes.io/tls {{- end }} -{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.deployment.yaml b/charts/everest/templates/everest-olm/packageserver.deployment.yaml index dbacebc4..72bd3594 100644 --- a/charts/everest/templates/everest-olm/packageserver.deployment.yaml +++ b/charts/everest/templates/everest-olm/packageserver.deployment.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: apps/v1 kind: Deployment metadata: @@ -108,4 +107,3 @@ spec: - key: tls.key path: tls.key secretName: packageserver-service-cert -{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.rbac.yaml b/charts/everest/templates/everest-olm/packageserver.rbac.yaml index 4e30afaa..bd23a1ec 100644 --- a/charts/everest/templates/everest-olm/packageserver.rbac.yaml +++ b/charts/everest/templates/everest-olm/packageserver.rbac.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -45,4 +44,3 @@ subjects: - kind: ServiceAccount name: olm-operator-serviceaccount namespace: {{ include "everest.olmNamespace" . }} -{{- end }} diff --git a/charts/everest/templates/everest-olm/packageserver.service.yaml b/charts/everest/templates/everest-olm/packageserver.service.yaml index 69b1669f..669f9b8b 100644 --- a/charts/everest/templates/everest-olm/packageserver.service.yaml +++ b/charts/everest/templates/everest-olm/packageserver.service.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.global.compatibility.openshift }} apiVersion: v1 kind: Service metadata: @@ -14,4 +13,3 @@ spec: selector: app: packageserver type: ClusterIP -{{- end }} diff --git a/charts/everest/templates/everest-olm/serviceaccount.yaml b/charts/everest/templates/everest-olm/serviceaccount.yaml index 268a020a..90d16ead 100644 --- a/charts/everest/templates/everest-olm/serviceaccount.yaml +++ b/charts/everest/templates/everest-olm/serviceaccount.yaml @@ -1,7 +1,5 @@ -{{- if not .Values.global.compatibility.openshift }} kind: ServiceAccount apiVersion: v1 metadata: name: olm-operator-serviceaccount namespace: {{ include "everest.olmNamespace" . }} -{{- end }} diff --git a/charts/everest/values.yaml b/charts/everest/values.yaml index 2624dacb..93143821 100644 --- a/charts/everest/values.yaml +++ b/charts/everest/values.yaml @@ -1,7 +1,3 @@ -global: - compatibility: - # -- Enable Openshift compatibility. Currently in technical preview. - openshift: false # -- Namespace override. Defaults to the value of .Release.Namespace. namespaceOverride: "" # -- If set, enabled sending telemetry information. From cc6b653be367f654dd6d8c23073472cc98f094c2 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Fri, 25 Oct 2024 11:31:14 +0530 Subject: [PATCH 63/64] Fix OLM certs being overwritten Signed-off-by: Mayank Shah --- .../everest-olm/packageserver.apiservice.yaml | 14 +++++++++++++- .../templates/everest-server/accounts.secret.yaml | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml index 713667b3..bbdca1a3 100644 --- a/charts/everest/templates/everest-olm/packageserver.apiservice.yaml +++ b/charts/everest/templates/everest-olm/packageserver.apiservice.yaml @@ -1,4 +1,6 @@ {{- $tls := fromYaml (include "olm.certs" .) }} +{{- $apiService := (lookup "apiregistration.k8s.io/v1" "APIService" "" "v1.packages.operators.coreos.com") -}} +{{- $secret := (lookup "v1" "Secret" (include "everest.olmNamespace" .) "packageserver-service-cert") -}} --- apiVersion: apiregistration.k8s.io/v1 kind: APIService @@ -6,12 +8,16 @@ metadata: name: v1.packages.operators.coreos.com annotations: {{- if eq .Values.olm.packageserver.tls.type "cert-manager" }} - cert-manager.io/inject-ca-from: {{ .Values.olm.namespace }}/olm-packageserver-tls + cert-manager.io/inject-ca-from: {{ (include "everest.olmNamespace" .) }}/olm-packageserver-tls {{- end }} spec: {{- if ne .Values.olm.packageserver.tls.type "cert-manager" }} + {{- if $apiService }} + caBundle: {{ $apiService.spec.caBundle }} + {{- else }} caBundle: {{ $tls.caCert }} {{- end }} + {{- end }} group: packages.operators.coreos.com groupPriorityMinimum: 2000 version: v1 @@ -24,8 +30,14 @@ spec: {{- if ne .Values.olm.packageserver.tls.type "cert-manager" }} apiVersion: v1 data: + {{- if $secret }} + {{- range $key, $value := $secret.data }} + {{ $key }}: {{ $value }} + {{- end }} + {{- else }} tls.crt: {{ $tls.tlsCert }} tls.key: {{ $tls.tlsKey }} + {{- end }} kind: Secret metadata: name: packageserver-service-cert diff --git a/charts/everest/templates/everest-server/accounts.secret.yaml b/charts/everest/templates/everest-server/accounts.secret.yaml index 48eb2e82..93a4cb1e 100644 --- a/charts/everest/templates/everest-server/accounts.secret.yaml +++ b/charts/everest/templates/everest-server/accounts.secret.yaml @@ -6,7 +6,13 @@ metadata: name: everest-accounts namespace: {{ include "everest.namespace" . }} annotations: + {{- if not $secret }} insecure-password/admin: "true" + {{- else }} + {{- range $key, $value := $secret.metadata.annotations }} + {{ $key }}: "{{ $value }}" + {{- end }} + {{- end }} data: {{- if not $secret }} users.yaml: {{ tpl (.Files.Get "everest-admin.yaml.tpl") . | b64enc }} From f72498580f48980539e6a975177ba20794e4cfd3 Mon Sep 17 00:00:00 2001 From: Mayank Shah Date: Fri, 25 Oct 2024 13:14:16 +0530 Subject: [PATCH 64/64] Update .github/CODEOWNERS Co-authored-by: Diogo Recharte --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9e2757fd..a5a3f7cb 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,3 @@ * @hors @tplavcic @nmarukovich @ptankov @jvpasinatto @eleo007 /charts/pmm/ @percona/pmm-review-be @spron-in -/charts/everest/ @percona/everest-backend +/charts/everest/ @percona/everest-backend-devs