Central API MVP
Right now, this repository implements issue 374.
It contains a script (gen.py) to mirror all crossplane openstack provider cluster-scoped resources to namespaced resources in an SCS API group.
Also, these instructions are striving to implement namespaces as isolation mechanism to implement a multi-tenant system backed by a single Kubernetes cluster.
crossplane-contrib/x-generation might be used as soon as the required feature for namespace mapping is implemented.
Quick Start
- Setup testing Kubernetes cluster
- Install crossplane
- Select fitting configuration package (containing provider definitions, XRD's and composites) and install it
export VERSION=...export XPKG=... # openstack / kubernetescrossplane xpkg install configuration registry.scs.community/central-api/$XPKG:$VERSION
- Setup provider config (wearing CSP hat)
apiVersion: v1kind: Namespacemetadata:name: tenant-name---apiVersion: openstack.upbound.io/v1beta1kind: ProviderConfigmetadata:name: tenant-namespec:credentials:secretRef:namespace: crossplane-systemname: tenant-name-clouds-yamlkey: clouds.jsonsource: Secret---apiVersion: v1kind: Secretmetadata:name: tenant-name-clouds-yamlnamespace: crossplane-systemstringData:clouds.json: |{"auth_url": "https://api.gx-scs.sovereignit.cloud:5000","application_credential_id": "...","application_credential_secret": "...","tenant_name": "tenant-name"}
- Setup RBAC for tenants (wearing CSP hat)
apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata:name: tenantrules:- apiGroups:- api.scs.communityresources:- '*'verbs:- '*'---apiVersion: v1kind: ServiceAccountmetadata:name: tenantnamespace: tenant-name---apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:name: scs-bindnamespace: tenant-nameroleRef:apiGroup: rbac.authorization.k8s.iokind: ClusterRolename: tenantsubjects:- kind: ServiceAccountname: tenantnamespace: tenant-name
- Create resource (wearing tenant hat,
kubectl --as system:serviceaccount:tenant-name:tenant -n tenant-name)apiVersion: api.scs.community/v1alpha1kind: KeypairV2metadata:name: adminnamespace: tenant-namespec:name: admin-keypairpublicKey: |-ssh-rsa ...---apiVersion: api.scs.community/v1alpha1kind: InstanceV2metadata:name: testing-vmnamespace: tenant-namespec:name: testing-vmkeyPair: admin-keyPairimageName: 'Debian 12'flavorName: 'SCS-1V:1:20' - Observe creation of resources
Right now, it would be expected to hand out the ServiceAccount token to the actual tenant; When AuthN is done via OIDC (or other means), the ServiceAccount tenant-name/tenant may be dropped and RoleBinding tenant-name/scs-bind may point to an actual user/group.