Skip to content

Commit d8a29e3

Browse files
authored
Merge pull request #22 from kerberos-io/feature/turn-on-off-ingress-add-workflows
Add possibility to turn on/off ingress
2 parents 99b6f71 + 14c6737 commit d8a29e3

File tree

7 files changed

+113
-22
lines changed

7 files changed

+113
-22
lines changed

.github/workflows/kind-cloud.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy on Kind
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
kind: [v0.21.0, v0.22.0, v0.23.0, v0.24.0]
13+
steps:
14+
- name: Create k8s Kind Cluster
15+
uses: helm/kind-action@v1
16+
with:
17+
version: ${{ matrix.kind }}
18+
- name: Print Kubernetes Version
19+
run: |
20+
kubectl version
21+
- name: Test Kubernetes Cluster
22+
run: |
23+
kubectl get no
24+
kubectl get pods -A -o wide
25+
kubectl get sc
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
- name: Install Prometheus operator
29+
id: install-prometheus-operator
30+
run: |
31+
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.48.1/bundle.yaml
32+
echo "Sleeping for 30 seconds, give time for the operator to create the CRDs" && sleep 30
33+
kubectl get crd
34+
kubectl get po -A -o wide
35+
- name: Install Kerberos Hub helm chart
36+
id: install-kerberos-hub
37+
run: |
38+
kubectl create namespace kerberos-hub
39+
helm install hub ./charts/hub --values charts/hub/values.yaml -n kerberos-hub --create-namespace
40+
echo "Sleeping for 300 seconds, give time for the helm chart to create the pods" && sleep 300
41+
kubectl get pods -A -o wide
42+
kubectl get pods -A -o wide | grep hub-frontend | awk '{print $3}' | grep -q '1/1' && echo "hub-frontend pod is running with status 1/1" || (echo "kerberos-hub pod is not running with status 1/1" && exit 1)

.github/workflows/microk8s.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy on Microk8s
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
13+
name: MicroK8s
14+
steps:
15+
- uses: balchua/[email protected]
16+
with:
17+
channel: "1.30/stable"
18+
addons: '["dns", "dashboard", "hostpath-storage", "nvidia"]'
19+
- name: Set permissions
20+
run: |
21+
sudo chown -f -R $USER $HOME/.kube $HOME/.config
22+
- name: Test MicroK8s
23+
id: list-pods
24+
run: |
25+
kubectl get no
26+
kubectl get pods -A -o wide
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
- name: Install Prometheus operator
30+
id: install-prometheus-operator
31+
run: |
32+
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.48.1/bundle.yaml
33+
echo "Sleeping for 30 seconds, give time for the operator to create the CRDs" && sleep 30
34+
kubectl get crd
35+
kubectl get po -A -o wide
36+
- name: Install Kerberos Hub helm chart
37+
id: install-kerberos-hub
38+
run: |
39+
kubectl create namespace kerberos-hub
40+
helm install hub ./charts/hub --values charts/hub/values.yaml -n kerberos-hub --create-namespace
41+
echo "Sleeping for 300 seconds, give time for the helm chart to create the pods" && sleep 300
42+
kubectl get pods -A -o wide
43+
kubectl get pods -A -o wide | grep hub-frontend | awk '{print $3}' | grep -q '1/1' && echo "hub-frontend pod is running with status 1/1" || (echo "kerberos-hub pod is not running with status 1/1" && exit 1)

charts/hub/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.73.0
19+
version: 0.74.0
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

charts/hub/templates/kerberos-hub/hub-api.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
protocol: TCP
1717
selector:
1818
app: hub-api
19+
{{ if ne .Values.ingress "" }}
1920
---
2021
{{ if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
2122
apiVersion: networking.k8s.io/v1
@@ -92,6 +93,7 @@ spec:
9293
servicePort: 8081
9394
{{- end }}
9495
{{ end }}
96+
{{- end }}
9597
---
9698
apiVersion: apps/v1
9799
kind: Deployment

charts/hub/templates/kerberos-hub/hub-frontend-demo.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
name: http
1313
selector:
1414
app: hub-frontend-demo
15+
{{ if ne .Values.ingress "" }}
1516
---
1617
{{ if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
1718
apiVersion: networking.k8s.io/v1
@@ -55,6 +56,7 @@ spec:
5556
serviceName: hub-frontend-demo-svc
5657
servicePort: 80
5758
{{ end }}
59+
{{ end }}
5860
---
5961
apiVersion: apps/v1
6062
kind: Deployment

charts/hub/templates/kerberos-hub/hub-frontend.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
name: http
1313
selector:
1414
app: hub-frontend
15+
{{ if ne .Values.ingress "" }}
1516
---
1617
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
1718
apiVersion: networking.k8s.io/v1
@@ -103,6 +104,7 @@ spec:
103104
servicePort: 80
104105
{{- end }}
105106
{{- end }}
107+
{{- end }}
106108
{{- if eq .Values.kerberoshub.oauth2Proxy.enabled true }}
107109
---
108110
apiVersion: networking.k8s.io/v1

charts/hub/values.yaml

+21-21
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ queueName: "kcloud-event-queue" # This is the topic to which all events are send
6262
# RabbitMQ can be installed in the same cluster using a helm chart, or you can
6363
# use a service on cloud provider like AWS, GCP, Azure, etc.
6464
rabbitmq:
65-
host: "<rabbitmq.rabbitmq:5672>" # can be internal dns name or external
65+
host: "rabbitmq.rabbitmq:5672" # can be internal dns name or external
6666
#host: "amqps://b-xxx-xxx-xxx-xxx-xxx.mq.eu-central-1.amazonaws.com:5671"
67-
username: "<yourusername>"
68-
password: "<yourpassword>"
67+
username: "yourusername"
68+
password: "yourpassword"
6969
exchange: ""
7070
# If you already have a Kafka cluster you might use this instead of RabbitMQ.
7171
kafka:
72-
broker: "<kafka1.yourdomain.com:9094>" # can be internal dns name or external
73-
username: "<yourusername>"
74-
password: "<yourpassword>"
72+
broker: "kafka1.yourdomain.com:9094" # can be internal dns name or external
73+
username: "yourusername"
74+
password: "yourpassword"
7575
mechanism: "PLAIN"
7676
security: "SASL_PLAINTEXT"
7777
# For allowing WEBRTC a STUN and TURN server is required.
@@ -166,35 +166,35 @@ kerberoshub:
166166
#legacyUrl: "api.legacy.yourdomain.com"
167167

168168
# MFA issuer name
169-
mfaIssuer: "<yourdomain.com>"
169+
mfaIssuer: "yourdomain.com"
170170
# Admin API's are made available for automation of Kerberos Hub.
171171
# To access those API's (e.g. creation of owner users), an API key needs to be provided.
172-
apiKey: "<a-random-admin-api-key>"
172+
apiKey: "a-random-admin-api-key"
173173
## Certificates
174174
tls:
175175
- hosts:
176-
- "<api.yourdomain.com>"
176+
- "api.yourdomain.com"
177177
secretName: kerberoshub-api
178178
#- hosts:
179179
# - "api.legacy.yourdomain.com"
180180
# secretName: kerberoshub-api-legacy
181181
- hosts:
182-
- "<admin.api.yourdomain.com>"
182+
- "admin.api.yourdomain.com"
183183
secretName: kerberoshub-admin
184184
language: "english"
185185
fallbackLanguage: "english"
186186
# Legacy (reseller) it is possible to link to AWS S3 and IAM (however Kerberos Vault is now the recommended option).
187187
# This is primarily used for creation of subscriptions, and not needed if you are using mainly Kerberos Vault.
188188
aws:
189-
region: "<xxx>"
190-
bucket: "<xxx>"
191-
accessKey: "<xxx>"
192-
secretKey: "<xxx>"
189+
region: "xxx"
190+
bucket: "xxx"
191+
accessKey: "xxx"
192+
secretKey: "xxx"
193193
stripe: # We use stripe for billing, so it's possible to resell Kerberos Hub if agreed.
194-
privateKey: "<xxx>"
194+
privateKey: "xxx"
195195
slack: # Slack is used in the api, to send logs to a specific Slack channel.
196196
enabled: "true"
197-
hook: "<yourslackhook>" # https://hooks.slack.com/services/T08Q2Q9V5/xxKT/JALxxAk26bHtuqTfZ
197+
hook: "yourslackhook" # https://hooks.slack.com/services/T08Q2Q9V5/xxKT/JALxxAk26bHtuqTfZ
198198
username: "Kerberos Hub" # The slack username
199199
elasticsearch: # Logs of the kerberos hub will be send to an elastic search cluster.
200200
enabled: "false"
@@ -331,11 +331,11 @@ kerberoshub:
331331
oauth2Proxy:
332332
enabled: false
333333
github:
334-
clientId: "<github-client-id>"
335-
clientSecret: "<github-client-secret>"
336-
cookieSecret: "<generate-a-random-cookie-secret>"
337-
organization: "<github-organization>"
338-
team: "<github-team>"
334+
clientId: "github-client-id"
335+
clientSecret: "github-client-secret"
336+
cookieSecret: "generate-a-random-cookie-secret"
337+
organization: "github-organization"
338+
team: "github-team"
339339
cleanup:
340340
repository: kerberos/hub-cleanup
341341
pullPolicy: IfNotPresent

0 commit comments

Comments
 (0)