diff --git a/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml b/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml new file mode 100644 index 00000000..ce3ac2f3 --- /dev/null +++ b/config/crd/bases/capsule.clastix.io_capsuleconfigurations.yaml @@ -0,0 +1,65 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.5.0 + creationTimestamp: null + name: capsuleconfigurations.capsule.clastix.io +spec: + group: capsule.clastix.io + names: + kind: CapsuleConfiguration + listKind: CapsuleConfigurationList + plural: capsuleconfigurations + singular: capsuleconfiguration + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: CapsuleConfiguration is the Schema for the Capsule configuration 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: CapsuleConfigurationSpec defines the Capsule configuration nolint:maligned + properties: + allowIngressHostnameCollision: + default: true + description: Allow the collision of Ingress resource hostnames across all the Tenants. + type: boolean + allowTenantIngressHostnamesCollision: + description: "When defining the exact match for allowed Ingress hostnames at Tenant level, a collision is not allowed. Toggling this, Capsule will not check if a hostname collision is in place, allowing the creation of two or more Tenant resources although sharing the same allowed hostname(s). \n The JSON path of the resource is: /spec/ingressHostnames/allowed" + type: boolean + forceTenantPrefix: + default: false + description: Enforces the Tenant owner, during Namespace creation, to name it using the selected Tenant name as prefix, separated by a dash. This is useful to avoid Namespace name collision in a public CaaS environment. + type: boolean + protectedNamespaceRegex: + description: Disallow creation of namespaces, whose name matches this regexp + type: string + userGroups: + default: + - capsule.clastix.io + description: Names of the groups for Capsule users. + items: + type: string + type: array + type: object + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 4ba94c12..b1c9e516 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -3,6 +3,7 @@ # It should be run by config/default resources: - bases/capsule.clastix.io_tenants.yaml +- bases/capsule.clastix.io_capsuleconfigurations.yaml # +kubebuilder:scaffold:crdkustomizeresource # the following config is for teaching kustomize how to do kustomization for CRDs. diff --git a/config/manager/configuration.yaml b/config/manager/configuration.yaml new file mode 100644 index 00000000..7500e83c --- /dev/null +++ b/config/manager/configuration.yaml @@ -0,0 +1,10 @@ +apiVersion: capsule.clastix.io/v1alpha1 +kind: CapsuleConfiguration +metadata: + name: default +spec: + userGroups: ["capsule.clastix.io"] + forceTenantPrefix: false + protectedNamespaceRegex: "" + allowTenantIngressHostnamesCollision: false + allowIngressHostnameCollision: false diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 5f059a3a..39dcd4b7 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,4 +1,5 @@ resources: +- configuration.yaml - manager.yaml - metrics_service.yaml apiVersion: kustomize.config.k8s.io/v1beta1 diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 0ff6002e..dd3edde4 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -29,6 +29,7 @@ spec: - --enable-leader-election - --zap-encoder=console - --zap-log-level=debug + - --configuration-name=capsule-default env: - name: NAMESPACE valueFrom: diff --git a/config/samples/capsule_v1alpha1_capsuleconfiguration.yaml b/config/samples/capsule_v1alpha1_capsuleconfiguration.yaml new file mode 100644 index 00000000..abd5a719 --- /dev/null +++ b/config/samples/capsule_v1alpha1_capsuleconfiguration.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: capsule.clastix.io/v1alpha1 +kind: CapsuleConfiguration +metadata: + name: default +spec: + userGroups: ["capsule.clastix.io"] + forceTenantPrefix: false + protectedNamespaceRegex: "" + allowTenantIngressHostnamesCollision: false + allowIngressHostnameCollision: false diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index b6cf0e17..8db784c7 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,3 +1,4 @@ ## This file is auto-generated, do not modify ## resources: +- capsule_v1alpha1_capsuleconfiguration.yaml - capsule_v1alpha1_tenant.yaml