Kubernetes yaml editorSimple 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: {{values.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: |
|
Specify the namespace for the deployment |
namespace: {{values.namespace}}
|
||
spec: replicas: {{values.replicas}} selector: matchLabels: app: {{values.name}} template: metadata: labels: app: {{values.name}} spec: |
|||
containers:
- name: {{values.name}}
image: {{values.image}}
|
|||
|
livenessProbe: httpGet: path: / port: {{values.port}} initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: httpGet: path: / port: {{values.port}} initialDelaySeconds: 10 periodSeconds: 10 |
||
|
ports:
- containerPort: {{values.port}}
|
||
Change the initial start command of the container. |
command: [{{values.cmd}}] args: [{{values.args}}] |
||
Define environment variables for the container You can add/remove variables using the +/- buttons Creates environment variables from key/values on a |
env: - name: {{env.name}} value: {{env.value}} envFrom: - configMapRef: name: {{values.volume1}} - secretRef: name: {{values.volume1}} |
||
Define the minimum and maximum expected resources to be used by the application Use the +/- buttons to toggle between predefined values
|
resources: requests: memory: "{{values.request.ram}}" cpu: "{{values.request.cpu}}" limits: memory: "{{values.limit.ram}}" cpu: "{{values.limit.cpu}}" |
||
Mount external information as volumes, secrets or configmap elements. |
volumeMounts: - name: {{values.volume1}} mountPath: {{values.path1}} subPath: {{values.file1}} - name: {{values.secret1}} mountPath: {{values.secretpath1}} subPath: {{values.secretfile1}} - name: {{values.empty1}} mountPath: {{values.emptypath1}} |
||
Specify the service account name for the pod. |
serviceAccountName: {{values.serviceAccountName}}
|
||
|
imagePullSecrets:
- name: {{values.imagePullSecrets}}
|
||
volumes: - name: {{values.volume1}} configMap: name: {{values.name}}-external-config - name: {{values.secret1}} secret: secretName: {{values.name}}-secret - name: {{values.empty1}} emptyDir: {} |
|||
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: {{values.file1}}: | {{computedConfig}} |
||
Expose the applications running on the pods through an stable location address. You can toggle between
|
--- apiVersion: v1 kind: Service metadata: name: {{values.name}} spec: selector: app: {{values.name}} type: {{values.serviceType}} ports: - name: http protocol: TCP port: {{values.port}} targetPort: {{values.targetPort}} |
||
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: {{values.ingressPath}}
pathType: Prefix
backend:
service:
name: {{values.name}}
port:
number: {{values.port}}
|
||
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:{{values.digest}}
|