Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into update_k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Jul 8, 2020
2 parents ef254f4 + 72165f6 commit 56d92bb
Show file tree
Hide file tree
Showing 18 changed files with 268 additions and 195 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: docker.io/weaveworks/wksctl-build:update-build-image-cb52a6ea
- image: docker.io/weaveworks/wksctl-build:go-1.14.1-431fabe9
environment:
GOPATH: /go/
SRCDIR: /src/github.com/weaveworks/wksctl
Expand Down Expand Up @@ -97,8 +97,8 @@ jobs:
machine:
docker_layer_caching: true
environment:
GOURL: https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz
GOCHECKSUM: 512103d7ad296467814a6e3f635631bd35574cab3369a97a323c9a585ccaa569
GOURL: https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
GOCHECKSUM: aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067
GOROOT: /home/circleci/goroot
GOPATH: /home/circleci/go
SRCDIR: /home/circleci/src/github.com/weaveworks/wksctl
Expand All @@ -121,8 +121,8 @@ jobs:
machine:
docker_layer_caching: true
environment:
GOURL: https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz
GOCHECKSUM: 512103d7ad296467814a6e3f635631bd35574cab3369a97a323c9a585ccaa569
GOURL: https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
GOCHECKSUM: aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067
GOROOT: /home/circleci/goroot
GOPATH: /home/circleci/go
SRCDIR: /home/circleci/src/github.com/weaveworks/wksctl
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM weaveworks/build-golang:1.13.5-stretch
FROM weaveworks/build-golang:1.14.4-stretch

RUN apt-get update && \
apt-get install -y \
Expand Down
25 changes: 25 additions & 0 deletions environments/local-rpm-repo/Dockerfile
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"]
62 changes: 62 additions & 0 deletions environments/local-rpm-repo/README.md
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.
6 changes: 6 additions & 0 deletions environments/local-rpm-repo/docker-ce.repo
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
8 changes: 8 additions & 0 deletions environments/local-rpm-repo/kubernetes.repo
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*
18 changes: 18 additions & 0 deletions environments/local-rpm-repo/nginx.conf
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
}
}
}
8 changes: 6 additions & 2 deletions pkg/addons/assets/assets_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

package assets

import "net/http"
import (
"net/http"

"github.com/weaveworks/wksctl/pkg/utilities/fixeddate"
)

// Assets is the content of the addons directory.
var Assets http.FileSystem = http.Dir("../../../addons")
var Assets http.FileSystem = fixeddate.Dir("../../../addons")
118 changes: 59 additions & 59 deletions pkg/addons/assets/assets_vfsdata.go

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pkg/apis/wksprovider/controller/manifests/manifests_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

package manifests

import "net/http"
import (
"net/http"

"github.com/weaveworks/wksctl/pkg/utilities/fixeddate"
)

// Manifests contains wksctl's manifests.
var Manifests http.FileSystem = http.Dir("yaml")
var Manifests http.FileSystem = fixeddate.Dir("yaml")
Loading

0 comments on commit 56d92bb

Please sign in to comment.