"Hello World" is a simple Kubernetes application that contains a single Deployment and a corresponding Service. The Deployment contains a Spring-based web server that simply prints "Hello World".
- IDEA Getting Started
- Visual Studio Code Getting Started
- What's in the box
- Using Cloud Code
- Using the Command Line
Required: Docker for Mac or Windows
- Enable Kubernetes cluster in Docker
- Uninstall
Google App Engine
IDEA plugin - Install
Cloud Code
IDEA plugin - Restart IDEA
- Create new
Cloud Code: Kubernetes
project:Java: Hello World
- run
skaffold run --tail
command - test if its working with
http :/
command: should getHello, World!
http response - tear down everything with
skaffold delete
command
NOTE: if you wanna use k3d / k3s, you will need some help:
- k8s (k3s)
cluster
with k3d (Docker required)
brew reinstall k3d
k3d create --api-port 6551 --publish 80:80 --workers 2
export KUBECONFIG="$(k3d get-kubeconfig --name='k3s-default')"
# do some k8s stuff...
k3d stop
k3d delete
rm -rf ~/.config/k3d/k3s-default/kubeconfig.yaml
- and k8s
ingress
resource:
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: idea-cloud-code-plugin-skaffold-ingress
spec:
rules:
- http:
paths:
- backend:
serviceName: idea-cloud-code-plugin-skaffold-service
servicePort: 80
This sample was written to demonstrate how to use the Cloud Code extension for Visual Studio code.
As an alternative to using the Cloud Code extension, the application can be deployed to a cluster using standard command line tools
Skaffold is a command line tool that can be used to build, push, and deploy your container images
skaffold run --default-repo=gcr.io/your-project-id-here/cloudcode
kubectl is the official Kubernetes command line tool. It can be used to deploy Kubernetes manifests to your cluster, but images must be build seperately using another tool (for example, using the Docker CLI)