Revert "Replace traefik with nginx"

This reverts commit 9a17033095.
This commit is contained in:
galal-hussein 2020-03-11 01:45:23 +02:00
parent 876a7f33a8
commit 3f927d8006
10 changed files with 52 additions and 72 deletions

View File

@ -1,15 +0,0 @@
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: nginx-ingress
namespace: kube-system
spec:
chart: https://%{KUBERNETES_API}%/static/charts/nginx-ingress-1.33.0.tgz
set:
rbac.create: "true"
controller.service.enableHttps: "true"
controller.metrics.enabled: "true"
controller.publishService.enabled: "true"
controller.image.repository: "k3sio/nginx-ingress-controller"
defaultBackend.image.repository: "k3sio/k8s-defaultbackend"

12
manifests/traefik.yaml Normal file
View File

@ -0,0 +1,12 @@
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: traefik
namespace: kube-system
spec:
chart: https://%{KUBERNETES_API}%/static/charts/traefik-1.81.0.tgz
set:
rbac.enabled: "true"
ssl.enabled: "true"
metrics.prometheus.enabled: "true"
kubernetes.ingressEndpoint.useDefaultPublishedService: "true"

View File

@ -194,7 +194,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
},
cli.StringSliceFlag{
Name: "disable",
Usage: "(components) Do not deploy packaged components and delete any deployed components (valid items: coredns, servicelb, nginx, local-storage, metrics-server)",
Usage: "(components) Do not deploy packaged components and delete any deployed components (valid items: coredns, servicelb, traefik, local-storage, metrics-server)",
},
cli.BoolFlag{
Name: "disable-scheduler",

View File

@ -115,9 +115,6 @@ func (w *watcher) listFilesIn(base string, force bool) error {
var errs []error
for _, path := range keys {
if w.skipNginx(path) {
continue
}
if shouldDisableService(base, path, w.disables) {
if err := w.delete(path); err != nil {
errs = append(errs, errors2.Wrapf(err, "failed to delete %s", path))
@ -340,14 +337,3 @@ func shouldDisableService(base, fileName string, disables map[string]bool) bool
}
return false
}
func (w *watcher) skipNginx(path string) bool {
name := name(path)
if name == "nginx" {
addon, err := w.addonCache.Get(ns, "traefik")
if err == nil && addon != nil {
return true
}
}
return false
}

View File

@ -10,8 +10,8 @@
// manifests/metrics-server/metrics-server-deployment.yaml
// manifests/metrics-server/metrics-server-service.yaml
// manifests/metrics-server/resource-reader.yaml
// manifests/nginx.yaml
// manifests/rolebindings.yaml
// manifests/traefik.yaml
package deploy
import (
@ -288,26 +288,6 @@ func metricsServerResourceReaderYaml() (*asset, error) {
return a, nil
}
var _nginxYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\xcf\x4d\x4b\xfb\x40\x10\xc7\xf1\x7b\x5e\xc5\x10\xe8\x31\x9b\x7f\xe9\xe5\xcf\xde\xac\x14\x2a\x82\x88\x55\xaf\x32\xd9\x8c\xc9\x90\x7d\x08\x3b\x93\x62\x15\xdf\xbb\xf4\x01\xa4\x42\xae\xc3\xe7\xf7\x5d\x16\x47\x7e\xa5\x2c\x9c\xa2\x85\x9e\x7c\x30\x0e\x55\x3d\x19\x4e\xf5\x7e\x59\x0c\x1c\x5b\x0b\x5b\xf2\xe1\xb6\xc7\xac\x45\x20\xc5\x16\x15\x6d\x01\x10\x31\x90\x85\xd8\x71\xfc\xa8\x38\x76\x99\x44\x2e\x57\x19\xd1\x91\x85\x61\x6a\xa8\x92\x83\x28\x85\x42\x46\x72\xc7\x91\x3b\x66\x2c\xf4\xaa\xa3\xd8\xba\x5e\x7c\xdd\xbf\xac\x37\x4f\x0f\x9b\xe7\xcd\xee\xed\xe6\xf1\xee\x7b\x51\x8b\xa2\xb2\xab\x4f\x50\xea\xab\x7c\xb5\x34\xab\x95\xf9\x67\xb4\xfb\x2c\x00\x84\xf4\x58\x04\xc8\x0d\x3a\xe3\x32\xa1\x92\x85\x52\xf3\x44\xe5\xe9\xee\x52\xd4\x9c\xbc\xa7\x6c\x84\xf2\x9e\x1d\x19\x8a\xd8\x78\xda\x9e\x5e\x9f\xa1\x81\x34\xb3\x93\x0b\x6d\xe7\xd8\x38\x35\x9e\xa5\xdf\x5d\x85\x67\x35\x07\xec\xc8\x64\x1a\x93\xb0\xa6\x7c\xb0\x50\x0e\x2b\xe1\xf4\xe7\x7f\xbf\x8b\x73\xa1\xa5\x77\x9c\xbc\xae\xd1\x0d\x14\xdb\xf9\xca\xf0\x5f\xaa\x8b\x6d\xce\xb6\x2c\x8a\x9f\x00\x00\x00\xff\xff\xf5\x25\x4a\xad\xda\x01\x00\x00")
func nginxYamlBytes() ([]byte, error) {
return bindataRead(
_nginxYaml,
"nginx.yaml",
)
}
func nginxYaml() (*asset, error) {
bytes, err := nginxYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "nginx.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _rolebindingsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x92\x31\x6f\xe3\x30\x0c\x85\x77\xfd\x0a\x21\xbb\x72\x38\xdc\x72\xf0\xd8\x0e\xdd\x03\xb4\x3b\x6d\xb3\x09\x6b\x59\x14\x48\x2a\x41\xfb\xeb\x0b\xa7\x6e\x82\xa4\x76\x90\xb4\xdd\x24\x41\x7c\x1f\x1f\xf9\x20\xd3\x13\x8a\x12\xa7\xca\x4b\x0d\xcd\x12\x8a\x6d\x58\xe8\x0d\x8c\x38\x2d\xbb\xff\xba\x24\xfe\xb3\xfd\xeb\x3a\x4a\x6d\xe5\xef\x63\x51\x43\x59\x71\xc4\x3b\x4a\x2d\xa5\xb5\xeb\xd1\xa0\x05\x83\xca\x79\x9f\xa0\xc7\xca\x77\xa5\xc6\x00\x99\x14\x65\x8b\x12\x86\x6b\x44\x0b\xd0\xf6\x94\x9c\x70\xc4\x15\x3e\x0f\xbf\x21\xd3\x83\x70\xc9\x17\xc8\xce\xfb\x2f\xe0\x03\x47\x5f\xd5\xb0\xaf\x0e\xfa\x99\x46\x86\x96\xfa\x05\x1b\xd3\xca\x85\x9b\x20\x8f\x8a\x32\xe3\xc2\xb9\x10\x82\xfb\xfe\xb4\x26\xc6\xf4\xd9\xfe\x3f\x0d\x0d\x27\x13\x8e\x11\xc5\x49\x89\x78\xd2\xb8\x0e\x15\xc1\x2f\x16\xce\x7b\x41\xe5\x22\x0d\x8e\x6f\x89\x5b\x54\xe7\xfd\x16\xa5\x1e\x9f\xd6\x68\x57\xd6\x42\x8f\x9a\xa1\x39\x17\x88\xa4\xb6\x3f\xec\xc0\x9a\xcd\x84\x56\x42\xdb\xb1\x74\x94\xd6\xa3\xdf\x29\xf1\x8f\x3f\x99\x23\x35\x74\x33\x61\x42\x10\x53\x9b\x99\x92\xe9\xfe\x96\xb9\x9d\xd3\x1c\xfc\x1f\xb5\x7f\xb8\xb4\xf9\x88\xcf\xec\xee\xf7\xb3\x7d\x0a\x38\x06\x7b\xf0\x78\x1d\xe3\x2c\xdc\x97\x01\xef\x01\x00\x00\xff\xff\x46\xd3\x6d\x9d\x0f\x04\x00\x00")
func rolebindingsYamlBytes() ([]byte, error) {
@ -328,6 +308,26 @@ func rolebindingsYaml() (*asset, error) {
return a, nil
}
var _traefikYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8f\xcd\x6a\xc3\x30\x10\x84\xef\x7e\x8a\x25\x90\x63\xe4\xe6\x56\x74\xeb\x8f\xa1\xa5\x50\x42\xd3\xf6\x5a\xd6\xf2\x24\x16\x91\x64\xa1\x5d\x05\xda\xd2\x77\x2f\x0e\x3e\xe6\xb8\x3b\x1f\x1f\x33\x9c\xfd\x27\x8a\xf8\x29\x59\x1a\x11\xa2\x71\xac\x1a\x60\xfc\xd4\x9e\xb7\xcd\xc9\xa7\xc1\xd2\x13\x42\x7c\x18\xb9\x68\x13\xa1\x3c\xb0\xb2\x6d\x88\x12\x47\x58\xd2\xc2\x38\xf8\xd3\x72\x4b\x66\x07\x4b\xa7\xda\x63\x23\xdf\xa2\x88\x8d\x64\xb8\x19\x77\xb3\xc0\xd2\xa8\x9a\xc5\xb6\xed\xfa\xf7\xe5\xe3\xbe\x7b\x7b\xed\xde\xbb\xfd\xd7\xdd\xee\xf9\x6f\xdd\x8a\xb2\x7a\xd7\x5e\x40\x69\x17\xf1\x66\x6b\x6e\xb7\xe6\xc6\xe8\xf1\xa7\x21\x12\xe8\xec\x22\x2a\x3d\x3b\x83\xc4\x7d\xc0\x60\x69\xa5\xa5\x62\x75\x09\x44\xc2\xd5\x7f\x84\x16\xef\xc4\xe4\x32\x45\xe8\x88\x2a\x57\xb1\xb9\x79\x49\x50\x88\xf1\xe9\x58\x20\xd2\xa5\x21\x4f\x3e\xa9\xa9\x82\x47\x1c\xb8\x06\xdd\xd5\x3e\x78\x19\x31\xec\x51\xce\x7e\x1e\xbc\x18\xfe\x03\x00\x00\xff\xff\xb5\x07\xd7\x40\x4d\x01\x00\x00")
func traefikYamlBytes() ([]byte, error) {
return bindataRead(
_traefikYaml,
"traefik.yaml",
)
}
func traefikYaml() (*asset, error) {
bytes, err := traefikYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "traefik.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
@ -390,8 +390,8 @@ var _bindata = map[string]func() (*asset, error){
"metrics-server/metrics-server-deployment.yaml": metricsServerMetricsServerDeploymentYaml,
"metrics-server/metrics-server-service.yaml": metricsServerMetricsServerServiceYaml,
"metrics-server/resource-reader.yaml": metricsServerResourceReaderYaml,
"nginx.yaml": nginxYaml,
"rolebindings.yaml": rolebindingsYaml,
"traefik.yaml": traefikYaml,
}
// AssetDir returns the file names below a certain
@ -447,8 +447,8 @@ var _bintree = &bintree{nil, map[string]*bintree{
"metrics-server-service.yaml": &bintree{metricsServerMetricsServerServiceYaml, map[string]*bintree{}},
"resource-reader.yaml": &bintree{metricsServerResourceReaderYaml, map[string]*bintree{}},
}},
"nginx.yaml": &bintree{nginxYaml, map[string]*bintree{}},
"rolebindings.yaml": &bintree{rolebindingsYaml, map[string]*bintree{}},
"traefik.yaml": &bintree{traefikYaml, map[string]*bintree{}},
}}
// RestoreAsset restores an asset under the given directory

View File

@ -33,9 +33,7 @@ import (
"k8s.io/apimachinery/pkg/util/net"
)
const (
MasterRoleLabelKey = "node-role.kubernetes.io/master"
)
const MasterRoleLabelKey = "node-role.kubernetes.io/master"
func resolveDataDir(dataDir string) (string, error) {
dataDir, err := datadir.Resolve(dataDir)

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,5 @@
docker.io/coredns/coredns:1.6.3
docker.io/k3sio/k8s-defaultbackend:1.5
docker.io/k3sio/nginx-ingress-controller:0.30.0
docker.io/library/traefik:1.7.19
docker.io/rancher/klipper-helm:v0.2.3
docker.io/rancher/klipper-lb:v0.1.2
docker.io/rancher/local-path-provisioner:v0.0.11

View File

@ -5,7 +5,7 @@ cd $(dirname $0)/..
. ./scripts/version.sh
ROOT_VERSION=v0.3.0
NGINX_VERSION=1.33.0
TRAEFIK_VERSION=1.81.0
CHARTS_DIR=build/static/charts
mkdir -p ${CHARTS_DIR}
@ -17,7 +17,7 @@ for target in iptables iptables-save iptables-restore ip6tables ip6tables-save i
done
mkdir -p bin/aux && rm bin/mount && ln -sf ../busybox bin/aux/mount
NGINX_FILE=nginx-ingress-${NGINX_VERSION}.tgz
curl -sfL https://kubernetes-charts.storage.googleapis.com/${NGINX_FILE} -o ${CHARTS_DIR}/${NGINX_FILE}
TRAEFIK_FILE=traefik-${TRAEFIK_VERSION}.tgz
curl -sfL https://kubernetes-charts.storage.googleapis.com/${TRAEFIK_FILE} -o ${CHARTS_DIR}/${TRAEFIK_FILE}
cp scripts/wg-add.sh bin/aux/

View File

@ -7,4 +7,4 @@ cd $(dirname $0)/..
images=$(cat scripts/airgap/image-list.txt)
xargs -n1 docker pull <<< "${images}"
docker save ${images} -o dist/artifacts/k3s-airgap-images-${ARCH}.tar
docker save ${images} -o dist/artifacts/k3s-airgap-images-${ARCH}.tar