Fork me on GitHub Remix on Glitch

Kubernetes yaml editor

Simple utility page to write kubernetes descriptor files with ease.

Add optional sections by checking the boxes Here you can edit the descriptors freely, but note that changes will be lost if you switch back to the editor.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: 
edit YAML
show editor
copy to clipboard
copy to clipboard + kubeclt apply
upload to https://myclip.glitch.me/{{clip}}
curl https://myclip.glitch.me/{{clip}} | kubectl apply -f -
save deployment to
{{values.name}}-deployment.yaml

save service to {{values.name}}-service.yaml
save config map to {{values.name}}-external-config.yaml
save kustomization to kustomization.yaml
save ingress to {{values.name}}-ingress.yaml

save values to local storage
clear local storage

Load sample templates:

complete
nginx
node http
postgresql
netshoot

Namespace

Specify the namespace for the deployment

  namespace: 
spec:
  replicas: 
  selector:
    matchLabels:
      app: {{values.name}}
  template:
    metadata:
      labels:
        app: {{values.name}}
    spec:
      containers:
      - name: {{values.name}}
        image: 
probes
        livenessProbe:
          httpGet:
            path: /
            port: 
          initialDelaySeconds: 10
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /
            port: 
          initialDelaySeconds: 10
          periodSeconds: 10
          
ports
        ports:
        - containerPort: 
cmd / args

Change the initial start command of the container.
The provided command will start the container with a bash shell (useful for debugging purposes)

        command: []
        args: []
env vars

Define environment variables for the container

You can add/remove variables using the +/- buttons

from configmap

Creates environment variables from key/values on a

from secret
        env: 
        - name: 
          value: 
        envFrom:
        - configMapRef:
            name: {{values.volume1}}
        - secretRef:
            name: {{values.volume1}}
resources

Define the minimum and maximum expected resources to be used by the application

Use the +/- buttons to toggle between predefined values

  • cpu: 100m, 200m, 500m, 1000m
  • memory: 128Mb, 256Mb, 512Mb 1024Mb

        resources:
          requests:
            memory: ""
            cpu: ""
          limits:
            memory: ""
            cpu: ""
volume mount

Mount external information as volumes, secrets or configmap elements.

secret mount
emptyDir mount
subpath
        volumeMounts:
          - name: 
            mountPath: 
            subPath: 
          - name: 
            mountPath: 
            subPath: 
          - name: 
            mountPath: 
            
Service Account Name

Specify the service account name for the pod.

      serviceAccountName: 
image Pull Secrets
      imagePullSecrets:
      - name: 
      volumes:
      - name: {{values.volume1}}
        configMap:
          name: {{values.name}}-external-config
      - name: {{values.secret1}}
        secret:
          secretName: {{values.name}}-secret
      - name: {{values.empty1}}
        emptyDir: {}
config map

Define a configmap with a file as content, then mount it as volume on a container pod

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{values.name}}-external-config
data:
  : |
service

Expose the applications running on the pods through an stable location address. You can toggle between

  • ClusterIP
  • NodePort
  • LoadBalancer

---
apiVersion: v1
kind: Service
metadata:
  name: {{values.name}}
spec:
  selector:
    app: {{values.name}}
  type: 
  ports:
  - name: http
    protocol: TCP
    port: 
    targetPort: 
      
ingress

Ingress object configures the external load balancer with http routes to services running on the cluster

---          
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{values.name}}
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: 
        pathType: Prefix
        backend:
          service:
            name: {{values.name}}
            port:
              number: {{values.port}}
kustomize

Kustomize is an utility to reduce boilerplate when creating kubernetes descriptors. It's also included with kubectl so you can run: kubectl apply -k .

---
resources:
- {{values.name}}-deployment.yaml
- {{values.name}}-service.yaml

configMapGenerator:
- name: {{values.name}}-external-config
  files:
  - {{values.file1}}={{values.file1}}

images:
- name: {{values.image}}
  digest: sha256: