submarine-cloud-v2
, i.e. submarine-operator, implements the operator for Submarine application. The operator provides a new option for users to deploy the Submarine service to their Kubernetes clusters. The submarine-operator can fix some errors automatically. However, if the Submarine service is deployed with Helm, the errors need to be fixed by human operators.
# Install dependencies go mod vendor # Run the cluster minikube start --vm-driver=docker --kubernetes-version v1.15.11
# Step1: Build & Run "submarine-operator" make ./submarine-operator # Step2: Deploy a Submarine kubectl apply -f helm-charts/submarine-operator/crds/crd.yaml kubectl create ns submarine-user-test kubectl apply -n submarine-user-test -f artifacts/examples/example-submarine.yaml # Step3: Exposing Service # Method1 -- use minikube ip minikube ip # you'll get the IP address of minikube, ex: 192.168.49.2 # Method2 -- use port-forwarding kubectl port-forward --address 0.0.0.0 -n submarine-user-test service/traefik 32080:80 # Step4: View Workbench # http://{minikube ip}:32080 (from Method 1), ex: http://192.168.49.2:32080 # or http://127.0.0.1:32080 (from Method 2). # Step5: Delete Submarine # By deleting the submarine custom resource, the operator will do the following things: # (1) Remove all relevant Helm chart releases # (2) Remove all resources in the namespace "submariner-user-test" # (3) Remove all non-namespaced resources (Ex: PersistentVolume) created by client-go API # (4) **Note:** The namespace "submarine-user-test" will not be deleted kubectl delete submarine example-submarine -n submarine-user-test # Step6: Stop the operator # Press ctrl+c to stop the operator
# Step1: Deploye submarine-operator helm install submarine-operator ./helm-charts/submarine-operator/ # Step2: Deploy a submarine kubectl create ns submarine-user-test kubectl apply -n submarine-user-test -f artifacts/examples/example-submarine.yaml # Step3: Inspect the logs of submarine-operator kubectl logs -f $(kubectl get pods --output=name | grep submarine-operator) # Step4: Exposing Service # Method1 -- use minikube ip minikube ip # you'll get the IP address of minikube, ex: 192.168.49.2 # Method2 -- use port-forwarding kubectl port-forward --address 0.0.0.0 -n submarine-user-test service/traefik 32080:80 # Step5: View Workbench # http://{minikube ip}:32080 (from Method 1), ex: http://192.168.49.2:32080 # or http://127.0.0.1:32080 (from Method 2). # Step6: Delete Submarine # By deleting the submarine custom resource, the operator will do the following things: # (1) Remove all relevant Helm chart releases # (2) Remove all resources in the namespace "submariner-user-test" # (3) Remove all non-namespaced resources (Ex: PersistentVolume) created by client-go API # (4) **Note:** The namespace "submarine-user-test" will not be deleted kubectl delete submarine example-submarine -n submarine-user-test # Step7: Delete the submarine-operator helm delete submarine-operator
Please check out the Developer Guide.