Skip to content
Snippets Groups Projects
Commit bcbb43f5 authored by Eric Cano's avatar Eric Cano
Browse files

Added kubernetes DNS, log PV and various fixes.

parent 5a296700
Branches
Tags
No related merge requests found
apiVersion: v1
kind: Service
metadata:
name: kube-dns
namespace: kube-system
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "KubeDNS"
spec:
selector:
k8s-app: kube-dns
clusterIP: <%= @dns_clusterip -%>
ports:
- name: dns
port: 53
protocol: UDP
- name: dns-tcp
port: 53
protocol: TCP
apiVersion: v1
kind: Namespace
metadata:
name: kube-system
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-dns-v20
namespace: kube-system
labels:
k8s-app: kube-dns
version: v20
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
k8s-app: kube-dns
version: v20
template:
metadata:
labels:
k8s-app: kube-dns
version: v20
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: kubedns
image: gcr.io/google_containers/kubedns-amd64:1.8
resources:
# TODO: Set memory limits when we've profiled the container for large
# clusters, then set request = limit to keep this container in
# guaranteed class. Currently, this container falls into the
# "burstable" category so the kubelet doesn't backoff from restarting it.
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
args:
# command = "/kube-dns"
- --domain=<%= @dns_domainname -%>
- --dns-port=10053
- --kube-master-url=http://<%= @my_ipaddress -%>:8080
ports:
- containerPort: 10053
name: dns-local
protocol: UDP
- containerPort: 10053
name: dns-tcp-local
protocol: TCP
- name: dnsmasq
image: gcr.io/google_containers/kube-dnsmasq-amd64:1.4
args:
- --cache-size=1000
- --no-resolv
- --server=/<%= @dns_domainname -%>/127.0.0.1#10053
- --server=<%= @upper_level_dns -%>
ports:
- containerPort: 53
name: dns
protocol: UDP
- containerPort: 53
name: dns-tcp
protocol: TCP
dnsPolicy: Default # Don't use cluster DNS.
#!/bin/bash
echo "Setting up DNS..."
dns_clusterip='10.254.199.254'
dns_domainname=`hostname -d`
my_ipaddress=`hostname -i`
upper_level_dns=`perl -e 'while (<>) { if ($_=~ /nameserver (.*)/) { print $1."\n"; exit }}' < /etc/resolv.conf`
dnspoddir=$(mktemp -d)
cp dns-svc.yaml pod-dns.yaml ${dnspoddir}
perl -p -i -e 's/<%= \@dns_clusterip -%>/'"${dns_clusterip}"'/' ${dnspoddir}/dns-svc.yaml
perl -p -i -e 's/<%= \@dns_domainname -%>/'"${dns_domainname}"'/' ${dnspoddir}/pod-dns.yaml
perl -p -i -e 's/<%= \@my_ipaddress -%>/'"${my_ipaddress}"'/' ${dnspoddir}/pod-dns.yaml
perl -p -i -e 's/<%= \@upper_level_dns -%>/'"${upper_level_dns}"'/' ${dnspoddir}/pod-dns.yaml
kubectl create -f ${dnspoddir}/kube-system_ns.yaml
kubectl create -f ${dnspoddir}/dns-svc.yaml
kubectl create -f ${dnspoddir}/pod-dns.yaml
echo "DONE"
apiVersion: v1
kind: PersistentVolume
metadata:
name: log
labels:
type: logs
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Recycle
hostPath:
path: /shared/logs
......@@ -20,7 +20,7 @@ yum-config-manager --add-repo=./castor.repo
################################################################################
### Make sure necessary packages are installed.
echo Installing mhvtl and tape utils...
yum install -y kmod-mhvtl mhvtl-utils lsscsi mt-st mtx sg3_utils
yum install -y kmod-mhvtl mhvtl-utils lsscsi mt-st mtx sg3_utils jq
################################################################################
### puppet:///modules/hg_cta/00-cta-tape.rules
......@@ -67,4 +67,8 @@ sleep 2
echo Generating kubernetes persistent volumes
bash -x ./generate_librarydevice_PV.sh
################################################################################
### puppet:///modules/hg_cta/generate_PV.sh
echo Generating the log persistent volume
sudo kubectl create -f ./log_PV.yaml
sudo kubectl get persistentvolumes -l type=logs
......@@ -70,7 +70,7 @@ if [ ! -z "${buildtree}" ]; then
# Create temporary directory for modified pod files
poddir=$(mktemp -d)
cp pod-* ${poddir}
sed -i ${poddir}/pod-* -e "s/\(^\s\+image:\).*/\1 buildtree-runner/"
sed -i ${poddir}/pod-* -e "s/\(^\s\+image\):.*/\1: buildtree-runner\n\1PullPolicy: Never/"
if [ ! -z "${error}" ]; then
echo -e "ERROR:\n${error}"
......
......@@ -54,6 +54,7 @@ BuildRequires: libuuid-devel >= 2.17
BuildRequires: json-c-devel >= 0.11
BuildRequires: libattr-devel >= 2.4.44
BuildRequires: oracle-instantclient12.1-devel
BuildRequires: valgrind
%endif
# only build debug info if you're building the whole code
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment