Converts your k8s YAML to a cdk8s Api Object.

Related tags

kubernetes cdk8s
Overview

kube2cdk8s

Converts your k8s YAML to a cdk8s Api Object.

Uses Pulumi's kube2pulumi as a base.

Dependencies

1. pulumi cli
2. pulumi kubernetes provider
$ curl -fsSL https://get.pulumi.com | sh
$ pulumi plugin install resource kubernetes v2.4.2

Usage

$ go test
$ go build
$ printf 'apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-service-account
  namespace: my-namespace' > temp.yaml
$ ./kube2cdk8s typescript -f temp.yaml
new k8s.KubeServiceAccount(this, "my-service-account", {
    metadata: {
        name: "my-service-account",
        namespace: "my-namespace",
    },
});
printf '---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment
  namespace: my-namespace
spec:
  selector:
    matchLabels:
      app: my-deployment
  replicas: 3
  template:
    metadata:
      labels:
        app: my-deployment
    spec:
      containers:
      - name: my-deployment
        image: my-image
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-deployment-2
  namespace: my-namespace-2
spec:
  selector:
    matchLabels:
      app: my-deployment-2
  replicas: 4
  template:
    metadata:
      labels:
        app: my-deployment-2
    spec:
      containers:
      - name: my-deployment-2
        image: my-image-2
        imagePullPolicy: Always
        ports:
        - containerPort: 8080' > temp.yaml
$ ./kube2cdk8s typescript -m true -f temp.yaml
new k8s.KubeDeployment(this, "my-deployment", {
    metadata: {
        name: "my-deployment",
        namespace: "my-namespace",
    },
    spec: {
        selector: {
            matchLabels: {
                app: "my-deployment",
            },
        },
        replicas: 3,
        template: {
            metadata: {
                labels: {
                    app: "my-deployment",
                },
            },
            spec: {
                containers: [{
                    name: "my-deployment",
                    image: "my-image",
                    imagePullPolicy: "Always",
                    ports: [{
                        containerPort: 8080,
                    }],
                }],
            },
        },
    },
});

new k8s.KubeDeployment(this, "my-deployment-2", {
    metadata: {
        name: "my-deployment-2",
        namespace: "my-namespace-2",
    },
    spec: {
        selector: {
            matchLabels: {
                app: "my-deployment-2",
            },
        },
        replicas: 4,
        template: {
            metadata: {
                labels: {
                    app: "my-deployment-2",
                },
            },
            spec: {
                containers: [{
                    name: "my-deployment-2",
                    image: "my-image-2",
                    imagePullPolicy: "Always",
                    ports: [{
                        containerPort: 8080,
                    }],
                }],
            },
        },
    },
});
Issues
Releases(v1.2.4)
Owner
smallcase
smallcase
kubectl plugin for signing Kubernetes manifest YAML files with sigstore

k8s-manifest-sigstore kubectl plugin for signing Kubernetes manifest YAML files with sigstore ⚠️ Still under developement, not ready for production us

sigstore 16 Sep 16, 2021
Kubernetes Operator for MySQL NDB Cluster.

MySQL NDB Operator The MySQL NDB Operator is a Kubernetes operator for managing a MySQL NDB Cluster setup inside a Kubernetes Cluster. This is in prev

MySQL 6 Sep 6, 2021
Converts your k8s YAML to a cdk8s Api Object.

kube2cdk8s Converts your k8s YAML to a cdk8s Api Object. Uses Pulumi's kube2pulumi as a base. Dependencies 1. pulumi cli 2. pulumi kubernetes provider

smallcase 6 Sep 12, 2021
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Opstree Container Kit 88 Sep 17, 2021
How you can use Go to replace YAML files with Kubernetes.

YamYams A small project that is free to use. ?? I wanted to offer a starting point for anyone interested in replacing YAML with Go. You can read more

Kris Nóva 958 Sep 20, 2021
The DataStax Kubernetes Operator for Apache Cassandra

Cass Operator The DataStax Kubernetes Operator for Apache Cassandra®. This repository replaces the old datastax/cass-operator for use-cases in the k8s

K8ssandra 45 Sep 19, 2021
Simplified network and services for edge applications

English | 简体中文 EdgeMesh Introduction EdgeMesh is a part of KubeEdge, and provides a simple network solution for the inter-communications between servi

KubeEdge 56 Sep 19, 2021
🐶 Kubernetes CLI To Manage Your Clusters In Style!

K9s - Kubernetes CLI To Manage Your Clusters In Style! K9s provides a terminal UI to interact with your Kubernetes clusters. The aim of this project i

Fernand Galiana 13.5k Sep 20, 2021
Create diagrams from the Kubernetes API with go-diagrams.

Kubernetes diagrams k8s-diagrams creates diagrams from your kubernetes clusters. You just have to provide a namespace (or not), and you get a picture

Pierre Erraud 81 Aug 3, 2021
k8s-image-swapper Mirror images into your own registry and swap image references automatically.

k8s-image-swapper Mirror images into your own registry and swap image references automatically. k8s-image-swapper is a mutating webhook for Kubernetes

Enrico Stahn 253 Sep 23, 2021
Production-Grade Container Scheduling and Management

Kubernetes (K8s) Kubernetes, also known as K8s, is an open source system for managing containerized applications across multiple hosts. It provides ba

Kubernetes 81.1k Sep 22, 2021
👀 A Kubernetes cluster resource sanitizer

Popeye - A Kubernetes Cluster Sanitizer Popeye is a utility that scans live Kubernetes cluster and reports potential issues with deployed resources an

Fernand Galiana 3.1k Sep 15, 2021
A helm v3 plugin to adopt existing k8s resources into a new generated helm chart

helm-adopt Overview helm-adopt is a helm plugin to adopt existing k8s resources into a new generated helm chart, the idea behind the plugin was inspir

Hamza ZOUHAIR 5 Sep 7, 2021
Access your Kubernetes Deployment over the Internet

Kubexpose: Access your Kubernetes Deployment over the Internet Kubexpose makes it easy to access a Kubernetes Deployment over a public URL. It's a Kub

Abhishek Gupta 12 Sep 21, 2021
A curated list of awesome Kubernetes tools and resources.

Awesome Kubernetes Resources A curated list of awesome Kubernetes tools and resources. Inspired by awesome list and donnemartin/awesome-aws. The Fiery

Tom Huang 881 Sep 22, 2021
Kubernetes IN Docker - local clusters for testing Kubernetes

kind is a tool for running local Kubernetes clusters using Docker container "nodes".

Kubernetes SIGs 8.5k Sep 24, 2021
A toolbox for debugging docker container and kubernetes with web UI.

A toolbox for debugging Docker container and Kubernetes with visual web UI. You can start the debugging journey on any docker container host! You can

CloudNativer 7 May 18, 2021
NATS on Kubernetes ☸️

Running NATS on K8S In this repository you can find several examples of how to deploy NATS, NATS Streaming and other tools from the NATS ecosystem on

NATS - The Cloud Native Messaging System 179 Sep 26, 2021
quick debug program running in the k8s pod

quick-debug English | 中文 What Problem To Solve As the k8s becomes more and more popular, most projects are deployed in k8s, and so is the development

Alan Wang 9 Sep 10, 2021