Skel Skaffold Integration
Generate Project Skaffold Support
A skaffold.yaml file will be created in the root of any app or service pack project you create using skel, no extra action is required.
In addition, deployments/kubernetes/minivms/${app.name}-deployment.yaml and deployments/kubernetes/msxlite/${app.name}-deployment.yaml will be created.
If your project has already been generated, you can use the skel generate-kubernetes command inside the project folder to add the skaffold support files.
Configure Kubernetes
- Connect to your msx-lite instance (the kubernetes host, not the installer), and retrieve your kubernetes configuration:
kubectl config view --raw --minify
- Apply this configuration as either the default kubernetes configuration, or as a custom configuration referred to by the
KUBECONFIGenvironment variable:
mkdir -p $HOME/.kube
cat > $HOME/.kube/config <<EOF
<config contents from instance go here>
EOF
- Update the server URL in the kubeconfig file you just saved to refer to the lab IP address:
# server: https://127.0.0.1:6443
server: https://10.81.85.174:6443
- If using a non-default config file, ensure
KUBECONFIGis set in your bash profile to point to the new file:
export KUBECONFIG=$HOME/.kube/rtp-4-msx-lite-35/config
Setup Skaffold Support in GoLand
To set up skaffold in GoLand:
-
Install Skaffold: Follow the instructions at https://skaffold.dev/docs/install/ to install Skaffold 2.x or higher on your system.
-
Install the Skaffold plugin for GoLand: In GoLand, go to
Goland | Settings | Plugins..., search for "Cloud Code", and click the Install button -
You may need to restart GoLand
Create an MSX-Lite Run Configuration
-
When you open your generated project in GoLand you should now see a popup saying "Kubernetes with Cloud Code. Skaffold configuration detected" since there will be a skaffold.yaml in the root
-
Via the
Add Configurationlink therein, or via the light blueAdd Configurationbutton top right, or viaRun | Edit Configurations | +add a run config -
Select the config type: "Cloud Code: Kubernetes"
-
Give the configuration a name
-
On the run tab,
Environment Variablesspecify:SKAFFOLD_PROFILE=msxlitethis tells skaffold to use the msxlite deployment found in the msxlite subdir
-
Give the path to the
skaffold.yamlfile on the "Build | Deploy" tab (it should default correctly) -
You probably want "All Modules and Dependencies" selected
-
Now you can run that config to deploy using skaffold