This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update_k8s
- Loading branch information
Showing
18 changed files
with
268 additions
and
195 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM centos:7 | ||
RUN yum install -y epel-release && \ | ||
yum install -y \ | ||
createrepo \ | ||
nginx \ | ||
&& \ | ||
yum clean all | ||
|
||
RUN mkdir -p /var/www/html/repos/{base,centosplus,extras,updates} | ||
COPY docker-ce.repo /etc/yum.repos.d/docker-ce.repo | ||
COPY kubernetes.repo /etc/yum.repos.d/kubernetes.repo | ||
RUN yum --downloadonly --downloaddir /var/www/html/repos install -y --disableexcludes=kubernetes \ | ||
device-mapper-persistent-data \ | ||
docker-ce-19.03.8 \ | ||
kubeadm-1.16.11 \ | ||
kubectl-1.16.11 \ | ||
kubelet-1.16.11 \ | ||
lvm2 \ | ||
yum-utils \ | ||
yum-versionlock | ||
RUN createrepo /var/www/html/repos | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
EXPOSE 80 | ||
CMD ["nginx"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# local-docker-registry | ||
|
||
## Instructions | ||
|
||
1. Create the Docker image for the local YUM repository: | ||
|
||
```console | ||
$ export IMAGE_TAG="$(cd ../.. ; ./tools/image-tag)" | ||
$ docker build -t "docker.io/weaveworks/local-yum-repo:${IMAGE_TAG}" . | ||
[...] | ||
Successfully tagged docker.io/weaveworks/local-yum-repo:${IMAGE_TAG} | ||
``` | ||
|
||
2. Run it: | ||
|
||
```console | ||
docker run -d -p 8080:80 --restart always --name yumrepo docker.io/weaveworks/local-yum-repo:${IMAGE_TAG} | ||
``` | ||
|
||
3. Use it: | ||
|
||
```console | ||
$ curl localhost:8080 | ||
<html> | ||
<head><title>Index of /</title></head> | ||
<body bgcolor="white"> | ||
<h1>Index of /</h1><hr><pre><a href="../">../</a> | ||
<a href="base/">base/</a> 13-May-2019 10:04 - | ||
[...] | ||
<a href="yum-plugin-versionlock-1.1.31-50.el7.noarch.rpm">yum-plugin-versionlock-1.1.31-50.el7.noarch.rpm</a> 12-Nov-2018 15:27 36584 | ||
</pre><hr></body> | ||
</html> | ||
``` | ||
|
||
4. Create a repository configuration file pointing to your local YUM repository: | ||
|
||
```ini | ||
[local] | ||
name=Local | ||
baseurl=http://localhost:8080 | ||
enabled=1 | ||
gpgcheck=0 | ||
``` | ||
|
||
5. Configure it in your `cluster.yaml`: | ||
|
||
```yaml | ||
apiVersion: "cluster.weave.works/v1alpha3" | ||
kind: "BareMetalCluster" | ||
spec: | ||
os: | ||
files: | ||
- source: | ||
configmap: repo | ||
key: local.repo | ||
destination: /etc/yum.repos.d/local.repo | ||
``` | ||
|
||
## Future work | ||
|
||
The exact list of packages to install should be driven by the "plan" for nodes. | ||
Currently, it is hardcoded in the `Dockerfile` file. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[docker-ce-stable] | ||
name=Docker CE Stable - $basearch | ||
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable | ||
enabled=1 | ||
gpgcheck=1 | ||
gpgkey=https://download.docker.com/linux/centos/gpg |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[kubernetes] | ||
name=Kubernetes | ||
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | ||
enabled=1 | ||
gpgcheck=1 | ||
repo_gpgcheck=1 | ||
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg | ||
exclude=kube* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
worker_processes 1; | ||
daemon off; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
root /var/www/html/repos; | ||
location / { | ||
index index.php index.html index.htm; | ||
autoindex on; #enable listing of directory index | ||
} | ||
} | ||
} |
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.