I've been working with Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
multipass launch --name rancher --cpus 2 --mem 4G --disk 10G | |
multipass exec rancher -- bash -c 'curl https://releases.rancher.com/install-docker/19.03.sh | sh' | |
multipass exec rancher -- sudo usermod -aG docker ubuntu | |
multipass shell rancher | |
docker volume create --name rancher-var-lib --driver local | |
docker run -d --rm -p 80:80 -p 443:443 -v rancher-var-lib:/var/lib/rancher/ rancher/rancher:stable | |
exit | |
$ multipass ls | |
Name State IPv4 Image | |
rancher Running 192.168.64.45 Ubuntu 18.04 LTS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-alpine | |
# Configuration variables. | |
ENV JIRA_HOME /var/atlassian/jira | |
ENV JIRA_INSTALL /opt/atlassian/jira | |
ENV JIRA_VERSION 7.11.2 | |
RUN addgroup -S jira | |
RUN adduser -S jira -G jira |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cluster_name: infra-rancher-cluster | |
ignore_docker_version: true | |
ssh_key_path: ~/.ssh/id_rsa | |
network: | |
plugin: flannel | |
system_images: | |
kubernetes: rancher/hyperkube:v1.13.5-rancher1 | |
nodes: | |
- address: csky05 | |
internal_address: <redacted> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
echo -e "Iterating...\n" | |
nodes=$(kubectl get node --no-headers -o custom-columns=NAME:.metadata.name) | |
for node in $nodes; do | |
echo "Node: $node" | |
kubectl describe node "$node" | sed '1,/Non-terminated Pods/d' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias util='kubectl get nodes --no-headers | awk '\''{print $1}'\'' | xargs -I {} sh -c '\''echo {} ; kubectl describe node {} | grep Allocated -A 5 | grep -ve Event -ve Allocated -ve percent -ve -- ; echo '\''' | |
util |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: Is it possible to create a custom role, where a non-admin user which has only view rights to run “oc rsh” command to only a certain pod or in a project to all pods? | |
A: you can define a custom role which allows only rsh permission (pods/exec): | |
create a yaml file like this: my-custom-role.yaml | |
``` | |
apiVersion: authorization.openshift.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: rsh-pod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: utils | |
name: utils | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: kafka-topics | |
namespace: aceme-confluent-dev # change it | |
labels: | |
app.kubernetes.io/component: kafka-topics | |
spec: | |
ports: | |
- port: 8082 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export TF_VAR_rancher_access_key=token-xyz123 | |
export TF_VAR_rancher_secret_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
export TF_VAR_AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxx | |
export TF_VAR_AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxx | |
export TF_VAR_AWS_DEFAULT_REGION=eu-central-1 | |
export AWS_DEFAULT_REGION=eu-central-1 | |
export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |