Cka command snippets
Jump to navigation
Jump to search
Little command snippets
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: configurator
namespace: configurator
spec:
selector:
matchLabels:
name: configurator
template:
metadata:
labels:
name: configurator
spec:
containers:
- name: configurator
image: bash
command: ['bash', '-c', 'echo aba997ac-1c89-4d64 | tee /configurator/config && sleep 1d']
volumeMounts:
- name: my-mount
mountPath: /configurator
volumes:
- name: my-mount
hostPath:
path: /configurator
kubectl expose deploy/asia --port=80
kubectl create ingress world --class=nginx \
--annotation nginx.ingress.kubernetes.io/rewrite-target=/ \
--rule="world.universe.mine/europe*=europe:80" \
--rule="world.universe.mine/asia*=asia:80"
alias k=kubectl
source /etc/bash_completion
source <(kubectl completion bash)
complete -F __start_kubectl k
controlplane $ k get pod
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: np
namespace: space2
spec:
podSelector: {}
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: space1
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: np
namespace: space1
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: space2
- ports:
- port: 53
protocol: TCP
- port: 53
protocol: UDP