daggerok / idea-cloud-code-plugin-skaffold

Skaffold with IDEA Cloud Code plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello World with Cloud Code Build Status

Architecture Diagram

"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".


Table of Contents

Cloud Code

  1. IDEA Getting Started
  2. Visual Studio Code Getting Started
  3. What's in the box
  4. Using Cloud Code
  5. Using the Command Line

IDEA Getting Started

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 get Hello, World! http response
  • tear down everything with skaffold delete command

NOTE: if you wanna use k3d / k3s, you will need some help:

  1. 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
  1. 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

Visual Studio Code Getting Started

This sample was written to demonstrate how to use the Cloud Code extension for Visual Studio code.


Using the Command Line

As an alternative to using the Cloud Code extension, the application can be deployed to a cluster using standard command line tools

Skaffold

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

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)

About

Skaffold with IDEA Cloud Code plugin


Languages

Language:Java 72.5%Language:Dockerfile 27.5%