Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created April 10, 2021 17:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vfarcic/a9adab72ac83f3082f3bab3230cbbc31 to your computer and use it in GitHub Desktop.
Save vfarcic/a9adab72ac83f3082f3bab3230cbbc31 to your computer and use it in GitHub Desktop.
####################################################################
# Cloud-Native Apps With Open Application Model (OAM) And Kubevela #
# https://youtu.be/2CBu6sOTtwk #
####################################################################
# Referenced videos:
# - K3d - How to run Kubernetes cluster locally using Rancher k3s: https://youtu.be/mCesuGk-Fks
# - Kustomize - How to Simplify Kubernetes Configuration Management: https://youtu.be/Twtbg6LFnAg
# - Crossplane - GitOps-based Infrastructure as Code through Kubernetes API: https://youtu.be/n8KjVmuHm7A
# - What Is GitOps And Why Do We Want It?: https://youtu.be/qwyRJlmG5ew
#########
# Setup #
#########
# Install KubeVela CLI from https://kubevela.io/docs/install#4-optional-get-kubevela-cli
git clone https://github.com/vfarcic/kubevela-demo.git
cd kubevela-demo
# Please watch https://youtu.be/mCesuGk-Fks if you are not familiar with k3d
# Feel free to use any other Kubernetes platform
k3d cluster create --config k3d.yaml
# If not using k3d, replace `localhost` with the base host accessible through Ingress
export BASE_HOST=localhost
cat dt-simple.yaml \
| sed -e "s@localhost@$BASE_HOST@g" \
| tee dt-simple.yaml
helm repo add kubevela \
https://kubevelacharts.oss-cn-hangzhou.aliyuncs.com/core
helm repo update
helm upgrade --install \
kubevela kubevela/vela-core \
--namespace vela-system \
--create-namespace \
--wait
#############################
# Defining OAM applications #
#############################
cat dt-simple.yaml
kubectl apply \
--filename dt-simple.yaml
kubectl get all,ingresses
echo http://$BASE_HOST
# Open it
kubectl get crds | grep oam
kubectl delete \
--filename dt-simple.yaml
##################################
# Defining custom OAM components #
##################################
vela components
kubectl get componentdefinitions -A
cat components.yaml
# https://cuelang.org/
kubectl apply --filename components.yaml
##############################
# Defining custom OAM traits #
##############################
cat traits.yaml
kubectl apply --filename traits.yaml
#######################################
# Deploying a custom OAM applications #
#######################################
cat dt-full.yaml
kubectl apply --filename dt-full.yaml
kubectl get all,ingresses
###########
# Destroy #
###########
k3d cluster delete kubevela-demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment