kubernetes specific version

This commit is contained in:
Torma Kristóf 2019-10-02 18:51:46 +02:00
parent c5ebac1e41
commit ce6818781a
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
5 changed files with 1 additions and 310 deletions

View File

@ -1,8 +0,0 @@
#!/usr/bin/env bash
kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.7.3/manifests/metallb.yaml
curl -sL https://run.solo.io/gloo/install | sh
export PATH=$HOME/.gloo/bin:$PATH
glooctl install ingress

View File

@ -43,7 +43,7 @@ then
chmod 666 /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubelet kubeadm kubectl kubernetes-cni
apt-get install -y kubelet=1.15.4-00 kubeadm=1.15.4-00 kubectl kubernetes-cni
fi
#Disabling swap for Kubernetes

View File

@ -1,5 +0,0 @@
git clone https://github.com/kubernetes-incubator/metrics-server.git
sed -i '34i\ command:\' metrics-server/deploy/1.8+/metrics-server-deployment.yaml
sed -i '35i\ - /metrics-server\' metrics-server/deploy/1.8+/metrics-server-deployment.yaml
sed -i '36i\ - --kubelet-insecure-tls\' metrics-server/deploy/1.8+/metrics-server-deployment.yaml
kubectl create -f metrics-server/deploy/1.8+/

View File

@ -1,242 +0,0 @@
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kafka-controller-deployer
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kafka-controller-deployer
subjects:
- kind: ServiceAccount
name: controller-acct
namespace: kubeless
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: kafka
namespace: kubeless
spec:
serviceName: broker
template:
metadata:
labels:
kubeless: kafka
spec:
containers:
- env:
- name: KAFKA_ADVERTISED_HOST_NAME
value: broker.kubeless
- name: KAFKA_ADVERTISED_PORT
value: "9092"
- name: KAFKA_PORT
value: "9092"
- name: KAFKA_DELETE_TOPIC_ENABLE
value: "true"
- name: KAFKA_ZOOKEEPER_CONNECT
value: zookeeper.kubeless:2181
- name: ALLOW_PLAINTEXT_LISTENER
value: "yes"
image: bitnami/kafka:1.1.0-r0
imagePullPolicy: IfNotPresent
livenessProbe:
initialDelaySeconds: 30
tcpSocket:
port: 9092
name: broker
ports:
- containerPort: 9092
volumeMounts:
- mountPath: /bitnami/kafka/data
name: datadir
initContainers:
- command:
- sh
- -c
- chmod -R g+rwX /bitnami
image: busybox
imagePullPolicy: IfNotPresent
name: volume-permissions
volumeMounts:
- mountPath: /bitnami/kafka/data
name: datadir
volumeClaimTemplates:
- metadata:
name: datadir
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: kafka
namespace: kubeless
spec:
ports:
- port: 9092
selector:
kubeless: kafka
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: zoo
namespace: kubeless
spec:
serviceName: zoo
template:
metadata:
labels:
kubeless: zookeeper
spec:
containers:
- env:
- name: ZOO_SERVERS
value: server.1=zoo-0.zoo:2888:3888:participant
- name: ALLOW_ANONYMOUS_LOGIN
value: "yes"
image: bitnami/zookeeper:3.4.10-r12
imagePullPolicy: IfNotPresent
name: zookeeper
ports:
- containerPort: 2181
name: client
- containerPort: 2888
name: peer
- containerPort: 3888
name: leader-election
volumeMounts:
- mountPath: /bitnami/zookeeper
name: zookeeper
initContainers:
- command:
- sh
- -c
- chmod -R g+rwX /bitnami
image: busybox
imagePullPolicy: IfNotPresent
name: volume-permissions
volumeMounts:
- mountPath: /bitnami/zookeeper
name: zookeeper
volumeClaimTemplates:
- metadata:
name: zookeeper
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Service
metadata:
name: zoo
namespace: kubeless
spec:
clusterIP: None
ports:
- name: peer
port: 9092
- name: leader-election
port: 3888
selector:
kubeless: zookeeper
---
apiVersion: v1
kind: Service
metadata:
name: zookeeper
namespace: kubeless
spec:
ports:
- name: client
port: 2181
selector:
kubeless: zookeeper
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
labels:
kubeless: kafka-trigger-controller
name: kafka-trigger-controller
namespace: kubeless
spec:
selector:
matchLabels:
kubeless: kafka-trigger-controller
template:
metadata:
labels:
kubeless: kafka-trigger-controller
spec:
containers:
- env:
- name: KUBELESS_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: KUBELESS_CONFIG
value: kubeless-config
image: bitnami/kafka-trigger-controller:v1.0.1
imagePullPolicy: IfNotPresent
name: kafka-trigger-controller
serviceAccountName: controller-acct
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: kafka-controller-deployer
rules:
- apiGroups:
- ""
resources:
- services
- configmaps
verbs:
- get
- list
- apiGroups:
- kubeless.io
resources:
- functions
- kafkatriggers
verbs:
- get
- list
- watch
- update
- delete
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: kafkatriggers.kubeless.io
spec:
group: kubeless.io
names:
kind: KafkaTrigger
plural: kafkatriggers
singular: kafkatrigger
scope: Namespaced
version: v1beta1
---
apiVersion: v1
kind: Service
metadata:
name: broker
namespace: kubeless
spec:
type: NodePort
ports:
- port: 9092
nodePort: 30092
selector:
kubeless: kafka

View File

@ -1,54 +0,0 @@
possible solution: ssh into kafka pod and check out 10broker-config.yml
broker nodeport not well implemented
node1:
change broker service to NodePort
reinstall kafka
add kafka-0 ip + kafka-0.broker.kubeless.svc.cluster.local to hosts -> not helping
node4:
install kafkacat
sudo apt-get install kafkacat
command:
echo 'Hello World!' | kafkacat -P -b node1:30092 -t test-topic
reply:
% ERROR: Local: Host resolution failure: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Failed to resolve 'kafka-0.broker.kubeless.svc.cluster.local:9092': Name or service not known
% Delivery failed for message: Local: Message timed out
command:
kafkacat -L -b node1:30092 -t test-topic
rep:
Metadata for test-topic (from broker -1: node1:30092/bootstrap):
1 brokers:
broker 1001 at kafka-0.broker.kubeless.svc.cluster.local:9092
1 topics:
topic "test-topic" with 1 partitions:
partition 0, leader 1001, replicas: 1001, isrs: 1001
command: echo 'Hello World!' | kafkacat -d broker -P -b node1:30092 -t test-topic
%7|1554849553.120|BRKMAIN|rdkafka#producer-1| [thrd::0/internal]: :0/internal: Enter main broker thread
%7|1554849553.120|STATE|rdkafka#producer-1| [thrd::0/internal]: :0/internal: Broker changed state INIT -> UP
%7|1554849553.120|BROKER|rdkafka#producer-1| [thrd:app]: node1:30092/bootstrap: Added new broker with NodeId -1
%7|1554849553.120|BRKMAIN|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Enter main broker thread
%7|1554849553.120|CONNECT|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: broker in state INIT connecting
%7|1554849553.121|CONNECT|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Connecting to ipv4#10.10.1.1:30092 (plaintext) with socket 7
%7|1554849553.121|STATE|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Broker changed state INIT -> CONNECT
%7|1554849553.121|CONNECT|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Connected to ipv4#10.10.1.1:30092
%7|1554849553.121|CONNECTED|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Connected (#1)
%7|1554849553.121|FEATURE|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Updated enabled protocol features +ApiVersion to ApiVersion
%7|1554849553.121|STATE|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Broker changed state CONNECT -> APIVERSION_QUERY
%7|1554849553.122|FEATURE|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Updated enabled protocol features to MsgVer1,ApiVersion,BrokerBalancedConsumer,ThrottleTime,Sasl,SaslHandshake,BrokerGroupCoordinator,LZ4,OffsetTime,MsgVer2
%7|1554849553.122|STATE|rdkafka#producer-1| [thrd:node1:30092/bootstrap]: node1:30092/bootstrap: Broker changed state APIVERSION_QUERY -> UP
%7|1554849553.122|BROKER|rdkafka#producer-1| [thrd:main]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Added new broker with NodeId 1001
%7|1554849553.122|CLUSTERID|rdkafka#producer-1| [thrd:main]: node1:30092/bootstrap: ClusterId update "" -> "MtPhSSSqQaCeGu-7DPmVVw"
%7|1554849553.122|BRKMAIN|rdkafka#producer-1| [thrd:kafka-0.broker.kubeless.svc.cluster.local:9092/1001]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Enter main broker thread
%7|1554849553.123|CONNECT|rdkafka#producer-1| [thrd:kafka-0.broker.kubeless.svc.cluster.local:9092/1001]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: broker in state INIT connecting
%7|1554849553.123|BROKERFAIL|rdkafka#producer-1| [thrd:kafka-0.broker.kubeless.svc.cluster.local:9092/1001]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: failed: err: Local: Host resolution failure: (errno: Bad address)
%7|1554849553.123|STATE|rdkafka#producer-1| [thrd:kafka-0.broker.kubeless.svc.cluster.local:9092/1001]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Broker changed state INIT -> DOWN
%7|1554849553.123|TOPBRK|rdkafka#producer-1| [thrd:kafka-0.broker.kubeless.svc.cluster.local:9092/1001]: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Topic test-topic [0]: joining broker (rktp 0x7f80ec001860)
% ERROR: Local: Host resolution failure: kafka-0.broker.kubeless.svc.cluster.local:9092/1001: Failed to resolve 'kafka-0.broker.kubeless.svc.cluster.local:9092': Name or service not known