Kubernetes Yaml Generator UI , yaml builder for kubernetes

10/18/2018

Is there any tool , online or self hosted , that takes all the values in UI as input and generate the full declarative yaml for the following kubernetes objects:

  • Deployment, with init containers and imagepullsecrets and other options
  • Service
  • ConfigMap
  • Secret
  • Daemonset
  • StatefulSet
  • Namespaces and quotas
  • RBAC resources

Edit:

I have been using kubectl create and kubectl run , but they dont spupport all the possible configuration options , and you still need to rememer all the options it supports , in UI one would be able to select from the give options for each resource.

-- Ijaz Ahmad Khan
kubernetes

3 Answers

10/18/2018

Found yipee.io that supports all the options and resources:

# Generated 2018-10-18T11:07:27.621Z by Yipee.io
# Application: nginx
# Last Modified: 2018-10-18T11:07:27.621Z

apiVersion: v1
kind: Service
metadata:
  namespace: webprod
  name: nginx
spec:
  selector:
    app: nginx
  ports:
  - port: 80
    targetPort: 8080
    name: nginx-hhpt
    protocol: TCP
    nodePort: 30003
  type: NodePort

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
  namespace: webprod
  annotations:
    yipee.io.lastModelUpdate: '2018-10-18T11:07:27.595Z'
spec:
  selector:
    matchLabels:
      name: nginx
      component: nginx
      app: nginx
  rollbackTo:
    revision: 0
  template:
    spec:
      imagePullSecrets:
      - name: imagsecret
      containers:
      - volumeMounts:
        - mountPath: /data
          name: nginx-vol
        name: nginx
        ports:
        - containerPort: 80
          protocol: TCP
          name: http
        imagePullPolicy: IfNotPresent
        image: docker.io/nginx:latest
      volumes:
      - name: nginx-vol
        hostPath:
          path: /data
          type: Directory
      serviceAccountName: test
    metadata:
      labels:
        name: nginx
        component: nginx
        app: nginx
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 2
  replicas: 1
  revisionHistoryLimit: 3
-- Ijaz Ahmad Khan
Source: StackOverflow

10/18/2018

The closest is kubectl create .... and kubectl run ...... Run them with -o yaml --dry-run > output.yaml. This won't create the resource, but will write the resource description to output.yaml file.

-- Praveen Sripati
Source: StackOverflow

3/11/2019

I have tried to address the same issue using a Java client based on the most popular Kubernetes Java Client:

<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>kubernetes-client</artifactId>
    <version>4.1.3</version>
</dependency>

It allows you to set the most exotic options... but the API is not very fluent (or I have not found yet the way to use it fluently) so the code becomes quite verbose... Building a UI is a challenge, because of the extreme complexity of the model.

yipee.io sounds promising though, but I didn't understand how to get a trial version.

-- Pierluigi Vernetto
Source: StackOverflow