diff --git a/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra-networking/kustomization.yaml b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra-networking/kustomization.yaml new file mode 100644 index 000000000..b9ea258a3 --- /dev/null +++ b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra-networking/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra-networking diff --git a/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/kustomization.yaml b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/kustomization.yaml new file mode 100644 index 000000000..66e3486d6 --- /dev/null +++ b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra diff --git a/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml new file mode 100644 index 000000000..90005df95 --- /dev/null +++ b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra/replacements diff --git a/manifests/site/virtual-network-cloud/sub-clusters/wordpress/workload/kustomization.yaml b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/workload/kustomization.yaml new file mode 100644 index 000000000..532e9725a --- /dev/null +++ b/manifests/site/virtual-network-cloud/sub-clusters/wordpress/workload/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../type/multi-tenant/sub-clusters/wordpress/workload diff --git a/manifests/type/multi-tenant/phases/cluster_map_patch.yaml b/manifests/type/multi-tenant/phases/cluster_map_patch.yaml new file mode 100644 index 000000000..e4f7c5b20 --- /dev/null +++ b/manifests/type/multi-tenant/phases/cluster_map_patch.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: airshipit.org/v1alpha1 +kind: ClusterMap +metadata: + labels: + airshipit.org/deploy-k8s: "false" + name: main-map +map: + # NOTE: Add sub-clusters to the multi-tenant phase map here. + wordpress: + parent: target-cluster + kubeconfigSources: + - type: "clusterAPI" + clusterAPI: + clusterNamespacedName: + name: wordpress + namespace: wordpress + # NOTE: This context does not exist unless added on disk manually. This + # entry is here for backup. + - type: "filesystem" + filesystem: + path: ~/.airship/kubeconfig + contextName: wordpress diff --git a/manifests/type/multi-tenant/phases/kustomization.yaml b/manifests/type/multi-tenant/phases/kustomization.yaml index cd28b466e..5c1765c62 100644 --- a/manifests/type/multi-tenant/phases/kustomization.yaml +++ b/manifests/type/multi-tenant/phases/kustomization.yaml @@ -1,2 +1,5 @@ resources: - ../../airship-core/phases + - ../sub-clusters/wordpress/phases +patchesStrategicMerge: + - cluster_map_patch.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/README.md b/manifests/type/multi-tenant/sub-clusters/wordpress/README.md new file mode 100644 index 000000000..700d061a3 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/README.md @@ -0,0 +1,7 @@ +# Wordpress Sub-Cluster + +The Wordpress sub-cluster demonstrates how operators can use Airship's +SIP & ViNO operators to provide Kubernetes multi-tenancy with sub-clusters. + +This wordpress deployment is merely a demo and should not be used in a +production environment. diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra-networking/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra-networking/kustomization.yaml new file mode 100644 index 000000000..1e9c202c2 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra-networking/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../sub-cluster/initinfra-networking diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/kustomization.yaml new file mode 100644 index 000000000..076007571 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../sub-cluster/initinfra diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml new file mode 100644 index 000000000..b0166526e --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/initinfra/replacements/kustomization.yaml @@ -0,0 +1,2 @@ +resources: + - ../../../../../sub-cluster/initinfra/replacements diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/phases/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/phases/kustomization.yaml new file mode 100644 index 000000000..ffd3d7945 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/phases/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + sub-cluster: wordpress + +nameSuffix: "-wordpress" + +resources: + - ../../../../sub-cluster/phases + +patchesStrategicMerge: + - phases_patch.yaml diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/phases/phases_patch.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/phases/phases_patch.yaml new file mode 100644 index 000000000..4fdf8e8e2 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/phases/phases_patch.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: airshipit.org/v1alpha1 +kind: Phase +metadata: + name: initinfra + clusterName: wordpress +config: + documentEntryPoint: sub-clusters/wordpress/initinfra +--- +apiVersion: airshipit.org/v1alpha1 +kind: Phase +metadata: + name: initinfra-networking + clusterName: wordpress +config: + documentEntryPoint: sub-clusters/wordpress/initinfra-networking +--- +apiVersion: airshipit.org/v1alpha1 +kind: Phase +metadata: + name: workload + clusterName: wordpress +config: + documentEntryPoint: sub-clusters/wordpress/workload diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/workload/helmrelease.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/helmrelease.yaml new file mode 100644 index 000000000..60681e532 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/helmrelease.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta1 +kind: HelmRepository +metadata: + name: wordpress-helm-repo + namespace: wordpress +spec: + interval: 5m + url: https://kubernetes-charts.banzaicloud.com +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: wordpress-helm-release + namespace: wordpress +spec: + releaseName: wordpress + targetNamespace: wordpress + interval: 5m + chart: + spec: + chart: wordpress + sourceRef: + kind: HelmRepository + name: wordpress-helm-repo + namespace: wordpress + values: {} diff --git a/manifests/type/multi-tenant/sub-clusters/wordpress/workload/kustomization.yaml b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/kustomization.yaml new file mode 100644 index 000000000..098896996 --- /dev/null +++ b/manifests/type/multi-tenant/sub-clusters/wordpress/workload/kustomization.yaml @@ -0,0 +1,3 @@ +resources: + - ../../../../sub-cluster/workload + - helmrelease.yaml