Merge "Add example sub-cluster" into v2

This commit is contained in:
Zuul 2021-03-26 14:14:49 +00:00 committed by Gerrit Code Review
commit 138f3c0dc0
14 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,2 @@
resources:
- ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra-networking

View File

@ -0,0 +1,2 @@
resources:
- ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra

View File

@ -0,0 +1,2 @@
resources:
- ../../../../../type/multi-tenant/sub-clusters/wordpress/initinfra/replacements

View File

@ -0,0 +1,2 @@
resources:
- ../../../../../type/multi-tenant/sub-clusters/wordpress/workload

View File

@ -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

View File

@ -1,2 +1,5 @@
resources:
- ../../airship-core/phases
- ../sub-clusters/wordpress/phases
patchesStrategicMerge:
- cluster_map_patch.yaml

View File

@ -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.

View File

@ -0,0 +1,2 @@
resources:
- ../../../../sub-cluster/initinfra-networking

View File

@ -0,0 +1,2 @@
resources:
- ../../../../sub-cluster/initinfra

View File

@ -0,0 +1,2 @@
resources:
- ../../../../../sub-cluster/initinfra/replacements

View File

@ -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

View File

@ -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

View File

@ -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: {}

View File

@ -0,0 +1,3 @@
resources:
- ../../../../sub-cluster/workload
- helmrelease.yaml