-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
salt, ui: deploy UI using *Ingress*es
The Kubernetes API, SaltAPI, Prometheus and the actual UI are now exposed using the `nginx-control-plane` *Ingress* controller, and as such accessible through the control-plane network IP of the 'bootstrap' node, port 8443. Note: this also updates Cypress to a (for now) unreleased version, because the current released version doesn't support self-signed TLS certificates when using an IP-based host as a test target (which is the case in our setup). This was reported upstream in cypress-io/cypress#771 and fixed in cypress-io/cypress#4947. The information as to how to install an unreleased version of Cypress I got from cypress-io/cypress#4525. Fixes: #1602 See: #1602 Fixes: #1797 See: #1797 Fixes: #1799 See: #1799 Fixes: #1800 See: #1800 See: cypress-io/cypress#4947 See: cypress-io/cypress#771 See: cypress-io/cypress#4525
- Loading branch information
Showing
16 changed files
with
176 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!kubernetes kubeconfig=/etc/kubernetes/admin.conf&context=kubernetes-admin@kubernetes | ||
|
||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: kubernetes-api | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
spec: | ||
type: ExternalName | ||
externalName: kubernetes.default.svc.cluster.local | ||
ports: | ||
- name: https | ||
port: 443 | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: salt-api | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
spec: | ||
type: ExternalName | ||
externalName: salt-master.kube-system.svc.cluster.local | ||
ports: | ||
- name: https | ||
port: 4507 | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: prometheus-api | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
spec: | ||
type: ExternalName | ||
externalName: prometheus-operator-prometheus.metalk8s-monitoring.svc.cluster.local | ||
ports: | ||
- name: http | ||
port: 9090 |
File renamed without changes.
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,78 @@ | ||
#!kubernetes kubeconfig=/etc/kubernetes/admin.conf&context=kubernetes-admin@kubernetes | ||
|
||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: metalk8s-ui-proxies-https | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: '/$2' | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" | ||
kubernetes.io/ingress.class: "nginx-control-plane" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /api/kubernetes(/|$)(.*) | ||
backend: | ||
serviceName: kubernetes-api | ||
servicePort: 443 | ||
- path: /api/salt(/|$)(.*) | ||
backend: | ||
serviceName: salt-api | ||
servicePort: 4507 | ||
--- | ||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: metalk8s-ui-proxies-http | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
annotations: | ||
nginx.ingress.kubernetes.io/rewrite-target: '/$2' | ||
nginx.ingress.kubernetes.io/use-regex: "true" | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTP" | ||
kubernetes.io/ingress.class: "nginx-control-plane" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /api/prometheus(/|$)(.*) | ||
backend: | ||
serviceName: prometheus-api | ||
servicePort: 9090 | ||
--- | ||
apiVersion: networking.k8s.io/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: metalk8s-ui | ||
namespace: metalk8s-ui | ||
labels: | ||
app: metalk8s-ui | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/name: metalk8s-ui | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s | ||
annotations: | ||
nginx.ingress.kubernetes.io/backend-protocol: "HTTP" | ||
kubernetes.io/ingress.class: "nginx-control-plane" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: / | ||
backend: | ||
serviceName: metalk8s-ui | ||
servicePort: 80 |
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,5 @@ | ||
include: | ||
- .namespace | ||
- .dependencies | ||
- .ui | ||
- .ingress |
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,10 @@ | ||
#!kubernetes kubeconfig=/etc/kubernetes/admin.conf&context=kubernetes-admin@kubernetes | ||
|
||
kind: Namespace | ||
apiVersion: v1 | ||
metadata: | ||
name: metalk8s-ui | ||
labels: | ||
app.kubernetes.io/managed-by: salt | ||
app.kubernetes.io/part-of: metalk8s | ||
heritage: metalk8s |
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 was deleted.
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
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
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# On single node WORKLOAD_IP = eth0 | ||
WORKLOAD_IP=$(ip a show eth0 | grep -Po "inet \K[\d.]+") | ||
UI_NODEPORT=$(sudo kubectl --kubeconfig=/etc/kubernetes/admin.conf get svc metalk8s-ui -n metalk8s-ui -o jsonpath='{.spec.ports[0].nodePort}') | ||
# On single node CONTROL_PLANE_IP = eth0 | ||
CONTROL_PLANE_IP=$(ip a show eth0 | grep -Po "inet \K[\d.]+") | ||
|
||
npm install --no-save --quiet --no-package-lock cypress@3.2.0 cypress-cucumber-preprocessor@1.12.0 | ||
CYPRESS_INSTALL_BINARY="https://cdn.cypress.io/beta/binary/3.5.0/linux-x64/circle-develop-053b6bd993f8016171f1f7b8148840d2c0d37716-158387/cypress.zip" | ||
export CYPRESS_INSTALL_BINARY | ||
CYPRESS_INSTALL_PACKAGE="https://cdn.cypress.io/beta/npm/3.5.0/circle-develop-053b6bd993f8016171f1f7b8148840d2c0d37716-158400/cypress.tgz" | ||
|
||
npm run test:e2e -- -e target_url="http://${WORKLOAD_IP}:${UI_NODEPORT}" | ||
npm install --no-save --quiet --no-package-lock "${CYPRESS_INSTALL_PACKAGE}" cypress-cucumber-preprocessor@1.12.0 | ||
|
||
npm run test:e2e -- -e target_url="https://${CONTROL_PLANE_IP}:8443" |
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