Skip to content

Commit

Permalink
Merge pull request #247 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
Install CoreDNS by default
  • Loading branch information
AkihiroSuda authored Nov 8, 2021
2 parents 95143ee + 9aa990d commit e79ef8c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 38 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
### Version definitions
# use ./hack/show-latest-commits.sh to get the latest commits

# 2021-10-25T08:02:26Z
ARG ROOTLESSKIT_COMMIT=877719759621b2e35b5bd8317accc667eff9126b
# 2021-10-22T21:39:38Z
ARG CONTAINERD_COMMIT=45c5298700a81b4b50b73b2125d6f082998bfec7
# 2021-10-21T16:19:28Z
ARG CRIO_COMMIT=fd336b513f4bd3d758dff84ce8f8d41483b304bf
# 2021-11-08T06:45:24Z
ARG ROOTLESSKIT_COMMIT=9c9440ee0de17810a850f12a94eea6eee279f956
# 2021-11-04T22:26:49Z
ARG CONTAINERD_COMMIT=d418660889b94ec51e5b12e1b593f92fb4bba560
# 2021-11-04T12:08:33Z
ARG CRIO_COMMIT=394333403c4e5597ee20247f0f2762b7a9c78a4d

ARG KUBE_NODE_COMMIT=v1.23.0-alpha.3
ARG KUBE_NODE_COMMIT=v1.23.0-alpha.4

# Version definitions (cont.)
ARG SLIRP4NETNS_RELEASE=v1.1.12
ARG CONMON_RELEASE=2.0.30
ARG CRUN_RELEASE=1.2
ARG CRUN_RELEASE=1.3
ARG FUSE_OVERLAYFS_RELEASE=v1.7.1
ARG CONTAINERD_FUSE_OVERLAYFS_RELEASE=1.0.3
ARG KUBE_MASTER_RELEASE=v1.23.0-alpha.3
ARG KUBE_MASTER_RELEASE=v1.23.0-alpha.4
# Kube's build script requires KUBE_GIT_VERSION to be set to a semver string
ARG KUBE_GIT_VERSION=v1.23.0-usernetes
ARG CNI_PLUGINS_RELEASE=v1.0.1
ARG FLANNEL_CNI_PLUGIN_RELEASE=v1.0.0
ARG FLANNEL_RELEASE=v0.14.1
ARG FLANNEL_RELEASE=v0.15.0
ARG ETCD_RELEASE=v3.5.1
ARG CFSSL_RELEASE=1.6.1

Expand Down Expand Up @@ -202,6 +202,6 @@ COPY --chown=user:user . /home/user/usernetes
COPY --from=bin-main --chown=user:user / /home/user/usernetes/bin
RUN ln -sf /home/user/usernetes/boot/docker-unsudo.sh /usr/local/bin/unsudo
VOLUME /home/user/.local
HEALTHCHECK --interval=15s --timeout=10s --start-period=60s --retries=5 \
HEALTHCHECK --interval=30s --timeout=10s --start-period=90s --retries=5 \
CMD ["unsudo", "systemctl", "--user", "is-system-running"]
ENTRYPOINT ["/docker-entrypoint.sh", "unsudo", "/home/user/usernetes/boot/docker-2ndboot.sh"]
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ Usernetes aims to provide a reference distribution of Kubernetes that can be ins
- [Requirements](#requirements)
- [cgroup v2](#cgroup-v2)
- [Enable cpu controller](#enable-cpu-controller)
- [Distribution-specific hint](#distribution-specific-hint)
- [Debian GNU/Linux](#debian-gnulinux)
- [Arch Linux](#arch-linux)
- [openSUSE](#opensuse)
- [Fedora, RHEL/CentOS](#fedora-rhelcentos)
- [Quick start](#quick-start)
- [Download](#download)
- [Install](#install)
Expand Down Expand Up @@ -227,22 +222,13 @@ Enqueued auxiliary job 540 u7s-kube-proxy.service/start.
● localhost
State: running
...
[INFO] Installation complete.
[INFO] Hint: `sudo loginctl enable-linger` to start user services automatically on the system start up.
[INFO] Hint: To enable addons including CoreDNS, run: kubectl apply -f /home/exampleuser/gopath/src/github.com/rootless-containers/usernetes/manifests/*.yaml
[INFO] Hint: KUBECONFIG=/home/exampleuser/.config/usernetes/master/admin-localhost.kubeconfig
[INFO] Hint: export KUBECONFIG=/home/exampleuser/.config/usernetes/master/admin-localhost.kubeconfig
```

To enable CoreDNS:
```console
$ export KUBECONFIG="$HOME/.config/usernetes/master/admin-localhost.kubeconfig"
$ kubectl apply -f manifests/*.yaml
serviceaccount/coredns created
clusterrole.rbac.authorization.k8s.io/system:coredns created
clusterrolebinding.rbac.authorization.k8s.io/system:coredns created
configmap/coredns created
deployment.apps/coredns created
service/kube-dns created
```
CoreDNS is automatically enabled since November 2021.
Older releases of Usernetes had required installing CoreDNS from [`manifests/coredns.yaml`](./manifests/coredns.yaml).

To use CRI-O:
```console
Expand Down Expand Up @@ -294,7 +280,6 @@ Wait until `docker ps` shows "healty" as the status of `usernetes-node` containe
```console
$ docker cp usernetes-node:/home/user/.config/usernetes/master/admin-localhost.kubeconfig docker.kubeconfig
$ export KUBECONFIG=./docker.kubeconfig
$ kubectl apply -f manifests/*.yaml
$ kubectl run -it --rm --image busybox foo
/ #
```
Expand All @@ -304,7 +289,6 @@ $ kubectl run -it --rm --image busybox foo
```console
$ make up
$ export KUBECONFIG=$HOME/.config/usernetes/docker-compose.kubeconfig
$ kubectl apply -f manifests/*.yaml
```

Flannel VXLAN `10.5.0.0/16` is configured by default.
Expand Down
3 changes: 0 additions & 3 deletions hack/smoketest-common.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ function util::wait_for_pod() {
}

function smoketest_dns() {
INFO "Installing CoreDNS"
kubectl apply -f manifests/coredns.yaml

INFO "Creating StatefulSet \"dnstest\" and headless Service \"dnstest\""
kubectl apply -f - <<EOF
apiVersion: v1
Expand Down
28 changes: 25 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,30 @@ systemctl --user -T enable $start
time systemctl --user -T start $start
systemctl --user --all --no-pager list-units 'u7s-*'
set +x

KUBECONFIG=
if systemctl --user -q is-active u7s-master.target; then
PATH="${base}/bin:$PATH"
KUBECONFIG="${config_dir}/usernetes/master/admin-localhost.kubeconfig"
export PATH KUBECONFIG
INFO "Installing CoreDNS"
set -x
# sleep for waiting the node to be available
sleep 3
kubectl get nodes -o wide
kubectl apply -f ${base}/manifests/coredns.yaml
set +x
INFO "Waiting for CoreDNS pods to be available"
set -x
# sleep for waiting the pod object to be created
sleep 3
kubectl -n kube-system wait --for=condition=ready pod -l k8s-app=kube-dns
kubectl get pods -A -o wide
set +x
fi

INFO "Installation complete."
INFO 'Hint: `sudo loginctl enable-linger` to start user services automatically on the system start up.'
INFO "Hint: To enable addons including CoreDNS, run: kubectl apply -f ${base}/manifests/*.yaml"
if [[ -f ${config_dir}/usernetes/master/admin-localhost.kubeconfig ]]; then
INFO "Hint: export KUBECONFIG=${config_dir}/usernetes/master/admin-localhost.kubeconfig"
if [[ -n "${KUBECONFIG}" ]]; then
INFO "Hint: export KUBECONFIG=${KUBECONFIG}"
fi
2 changes: 1 addition & 1 deletion manifests/coredns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ spec:
- key: "CriticalAddonsOnly"
operator: "Exists"
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
containers:
- name: coredns
image: coredns/coredns:1.8.6
Expand Down

0 comments on commit e79ef8c

Please sign in to comment.