Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit e43f0db

Browse files
Elliott Davisdims
authored andcommitted
Added local up hack scripts from kubernetes/kubernetes
Ported local up hack scripts to work with the single hyperkube commands.
1 parent 5a9cf78 commit e43f0db

File tree

12 files changed

+3821
-1
lines changed

12 files changed

+3821
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,4 @@ zz_generated.openapi.go
137137

138138
# binaries
139139
/bin
140+
hyperkube

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BINARY_NAME=hyperkube
33

44
all: build
55
build:
6-
go build -mod vendor -o hyperkube cmd/hyperkube/main.go
6+
go build -mod vendor -o hyperkube -tags="dockerless,providerless" -ldflags="-s -w" cmd/hyperkube/main.go
77
clean:
88
GO111MODULE=off go clean
99
rm -f $(BINARY_NAME)

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Hyperkube
2+
3+
Hyperkube is a single binary that contains subcommands for starting:
4+
* kube-apiserver
5+
* kube-controller-manager
6+
* kube-proxy
7+
* kube-scheduler
8+
* kubectl
9+
* kubelet
10+
11+
## Usage
12+
13+
`hyperkube kube-apiserver ${KUBE_API_SERVER_FLAGS}`
14+
15+
# Building
16+
17+
`make`
18+
19+
# Running Locally
20+
21+
`hack/local-up-cluster.sh`
22+
23+
*** Note, this script expects containerd and etcd to be running.
24+
To install etcd locally, use the `hack/install-etcd.sh` command.
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# Warning: This is a file generated from the base underscore template file: coredns.yaml.base
2+
3+
apiVersion: v1
4+
kind: ServiceAccount
5+
metadata:
6+
name: coredns
7+
namespace: kube-system
8+
labels:
9+
kubernetes.io/cluster-service: "true"
10+
addonmanager.kubernetes.io/mode: Reconcile
11+
---
12+
apiVersion: rbac.authorization.k8s.io/v1
13+
kind: ClusterRole
14+
metadata:
15+
labels:
16+
kubernetes.io/bootstrapping: rbac-defaults
17+
addonmanager.kubernetes.io/mode: Reconcile
18+
name: system:coredns
19+
rules:
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- endpoints
24+
- services
25+
- pods
26+
- namespaces
27+
verbs:
28+
- list
29+
- watch
30+
- apiGroups:
31+
- ""
32+
resources:
33+
- nodes
34+
verbs:
35+
- get
36+
---
37+
apiVersion: rbac.authorization.k8s.io/v1
38+
kind: ClusterRoleBinding
39+
metadata:
40+
annotations:
41+
rbac.authorization.kubernetes.io/autoupdate: "true"
42+
labels:
43+
kubernetes.io/bootstrapping: rbac-defaults
44+
addonmanager.kubernetes.io/mode: EnsureExists
45+
name: system:coredns
46+
roleRef:
47+
apiGroup: rbac.authorization.k8s.io
48+
kind: ClusterRole
49+
name: system:coredns
50+
subjects:
51+
- kind: ServiceAccount
52+
name: coredns
53+
namespace: kube-system
54+
---
55+
apiVersion: v1
56+
kind: ConfigMap
57+
metadata:
58+
name: coredns
59+
namespace: kube-system
60+
labels:
61+
addonmanager.kubernetes.io/mode: EnsureExists
62+
data:
63+
Corefile: |
64+
.:53 {
65+
errors
66+
health {
67+
lameduck 5s
68+
}
69+
ready
70+
kubernetes dns_domain in-addr.arpa ip6.arpa {
71+
pods insecure
72+
fallthrough in-addr.arpa ip6.arpa
73+
ttl 30
74+
}
75+
prometheus :9153
76+
forward . /etc/resolv.conf {
77+
max_concurrent 1000
78+
}
79+
cache 30
80+
loop
81+
reload
82+
loadbalance
83+
}
84+
---
85+
apiVersion: apps/v1
86+
kind: Deployment
87+
metadata:
88+
name: coredns
89+
namespace: kube-system
90+
labels:
91+
k8s-app: kube-dns
92+
kubernetes.io/cluster-service: "true"
93+
addonmanager.kubernetes.io/mode: Reconcile
94+
kubernetes.io/name: "CoreDNS"
95+
spec:
96+
# replicas: not specified here:
97+
# 1. In order to make Addon Manager do not reconcile this replicas parameter.
98+
# 2. Default is 1.
99+
# 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
100+
strategy:
101+
type: RollingUpdate
102+
rollingUpdate:
103+
maxUnavailable: 1
104+
selector:
105+
matchLabels:
106+
k8s-app: kube-dns
107+
template:
108+
metadata:
109+
labels:
110+
k8s-app: kube-dns
111+
spec:
112+
securityContext:
113+
seccompProfile:
114+
type: RuntimeDefault
115+
priorityClassName: system-cluster-critical
116+
serviceAccountName: coredns
117+
affinity:
118+
podAntiAffinity:
119+
preferredDuringSchedulingIgnoredDuringExecution:
120+
- weight: 100
121+
podAffinityTerm:
122+
labelSelector:
123+
matchExpressions:
124+
- key: k8s-app
125+
operator: In
126+
values: ["kube-dns"]
127+
topologyKey: kubernetes.io/hostname
128+
tolerations:
129+
- key: "CriticalAddonsOnly"
130+
operator: "Exists"
131+
nodeSelector:
132+
kubernetes.io/os: linux
133+
containers:
134+
- name: coredns
135+
image: k8s.gcr.io/coredns/coredns:v1.8.0
136+
imagePullPolicy: IfNotPresent
137+
resources:
138+
limits:
139+
memory: 'dns_memory_limit'
140+
requests:
141+
cpu: 100m
142+
memory: 70Mi
143+
args: [ "-conf", "/etc/coredns/Corefile" ]
144+
volumeMounts:
145+
- name: config-volume
146+
mountPath: /etc/coredns
147+
readOnly: true
148+
ports:
149+
- containerPort: 53
150+
name: dns
151+
protocol: UDP
152+
- containerPort: 53
153+
name: dns-tcp
154+
protocol: TCP
155+
- containerPort: 9153
156+
name: metrics
157+
protocol: TCP
158+
livenessProbe:
159+
httpGet:
160+
path: /health
161+
port: 8080
162+
scheme: HTTP
163+
initialDelaySeconds: 60
164+
timeoutSeconds: 5
165+
successThreshold: 1
166+
failureThreshold: 5
167+
readinessProbe:
168+
httpGet:
169+
path: /ready
170+
port: 8181
171+
scheme: HTTP
172+
securityContext:
173+
allowPrivilegeEscalation: false
174+
capabilities:
175+
add:
176+
- NET_BIND_SERVICE
177+
drop:
178+
- all
179+
readOnlyRootFilesystem: true
180+
dnsPolicy: Default
181+
volumes:
182+
- name: config-volume
183+
configMap:
184+
name: coredns
185+
items:
186+
- key: Corefile
187+
path: Corefile
188+
---
189+
apiVersion: v1
190+
kind: Service
191+
metadata:
192+
name: kube-dns
193+
namespace: kube-system
194+
annotations:
195+
prometheus.io/port: "9153"
196+
prometheus.io/scrape: "true"
197+
labels:
198+
k8s-app: kube-dns
199+
kubernetes.io/cluster-service: "true"
200+
addonmanager.kubernetes.io/mode: Reconcile
201+
kubernetes.io/name: "CoreDNS"
202+
spec:
203+
selector:
204+
k8s-app: kube-dns
205+
clusterIP: 'dns_server'
206+
ports:
207+
- name: dns
208+
port: 53
209+
protocol: UDP
210+
- name: dns-tcp
211+
port: 53
212+
protocol: TCP
213+
- name: metrics
214+
port: 9153
215+
protocol: TCP

hack/install-etcd.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2014 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script is convenience to download and install etcd in third_party.
18+
# Mostly just used by CI.
19+
# Usage: `hack/install-etcd.sh`.
20+
21+
set -o errexit
22+
set -o nounset
23+
set -o pipefail
24+
25+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
26+
source "${KUBE_ROOT}/hack/lib/init.sh"
27+
28+
kube::etcd::install

0 commit comments

Comments
 (0)