Created
July 25, 2023 12:04
-
-
Save kirederik/6ebec38478fbdbcec9e76f3d015be5b9 to your computer and use it in GitHub Desktop.
multicluster-kratix-minikube.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minikube start -p kind-platform --ports=31337:31337 | |
minikube start -p kind-worker | |
export PLATFORM="kind-platform" | |
export WORKER="kind-worker" | |
kubectl --context $PLATFORM apply --filename distribution/kratix.yaml | |
# if running minio locally | |
kubectl --context $PLATFORM apply --filename config/samples/minio-install.yaml | |
# register the bucket | |
cat << EOF | kubectl --context $PLATFORM apply -f - | |
apiVersion: platform.kratix.io/v1alpha1 | |
kind: BucketStateStore | |
metadata: | |
name: minio-store | |
spec: | |
# change endpoint if using an external bucket like S3 | |
endpoint: minio.kratix-platform-system.svc.cluster.local | |
insecure: true | |
bucketName: kratix | |
secretRef: | |
name: minio-credentials | |
namespace: default | |
EOF | |
# install flux | |
kubectl --context $WORKER \ | |
apply \ | |
--filename https://github.com/fluxcd/flux2/releases/download/v2.0.0-rc.3/install.yaml | |
# Configure Flux on the worker cluster | |
# change the config options below if using an external bucket like S3 | |
cat <<EOF | kubectl --context $WORKER apply -f - | |
--- | |
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: minio-credentials | |
namespace: flux-system | |
type: Opaque | |
stringData: | |
accesskey: minioadmin | |
secretkey: minioadmin | |
--- | |
apiVersion: source.toolkit.fluxcd.io/v1beta1 | |
kind: Bucket | |
metadata: | |
name: kratix-bucket | |
namespace: flux-system | |
spec: | |
interval: 10s | |
provider: generic | |
bucketName: kratix | |
endpoint: host.docker.internal:31337 | |
insecure: true | |
secretRef: | |
name: minio-credentials | |
EOF | |
# create the kustomizations; no changes are needed here | |
cat <<EOF | kubectl --context $WORKER apply --filename - | |
--- | |
apiVersion: kustomize.toolkit.fluxcd.io/v1 | |
kind: Kustomization | |
metadata: | |
name: kratix-workload-crds | |
namespace: flux-system | |
spec: | |
interval: 8s | |
prune: true | |
sourceRef: | |
kind: Bucket | |
name: kratix-bucket | |
path: ./worker-cluster/crds | |
--- | |
apiVersion: kustomize.toolkit.fluxcd.io/v1 | |
kind: Kustomization | |
metadata: | |
name: kratix-workload-resources | |
namespace: flux-system | |
spec: | |
interval: 3s | |
prune: true | |
dependsOn: | |
- name: kratix-workload-crds | |
sourceRef: | |
kind: Bucket | |
name: kratix-bucket | |
path: ./worker-cluster/resources | |
EOF | |
# register the worker cluster with the platform | |
cat <<EOF | kubectl --context $PLATFORM apply --filename - | |
apiVersion: platform.kratix.io/v1alpha1 | |
kind: Cluster | |
metadata: | |
name: worker-cluster | |
labels: | |
environment: dev | |
spec: | |
stateStoreRef: | |
name: minio-store | |
kind: BucketStateStore | |
EOF |
aclevername
commented
Jul 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment