-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,267 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/oauth2-proxy*.yaml | ||
/test-*.yaml | ||
/values*.yaml |
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,64 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved. | ||
# Use of this source code is governed by a GPL-3-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Prehibit errors | ||
set -e -o pipefail | ||
# Verbose | ||
set -x | ||
|
||
########################################################### | ||
# Configuration # | ||
########################################################### | ||
|
||
# Configure default environment variables | ||
HELM_CHART_DEFAULT="https://charts.bitnami.com/bitnami" | ||
NAMESPACE_DEFAULT="vine" | ||
|
||
# Set environment variables | ||
HELM_CHART="${HELM_CHART:-$HELM_CHART_DEFAULT}" | ||
NAMESPACE="${NAMESPACE:-$NAMESPACE_DEFAULT}" | ||
|
||
########################################################### | ||
# Check Environment Variables # | ||
########################################################### | ||
|
||
export DOMAIN_NAME="$( | ||
kubectl -n kiss get configmap kiss-config -o yaml | | ||
yq -r '.data.domain_name' | ||
)" | ||
|
||
########################################################### | ||
# Configure Helm Channel # | ||
########################################################### | ||
|
||
echo "- Configuring Helm channel ... " | ||
|
||
helm repo add "${NAMESPACE}-keycloak" "${HELM_CHART}" | ||
|
||
########################################################### | ||
# Install Dex # | ||
########################################################### | ||
|
||
echo "- Installing Operator ... " | ||
|
||
helm upgrade --install "keycloak" \ | ||
"${NAMESPACE}-keycloak/keycloak" \ | ||
--create-namespace \ | ||
--namespace "${NAMESPACE}" \ | ||
--set ingress.annotations."cert-manager\.io/cluster-issuer"="${DOMAIN_NAME}" \ | ||
--set ingress.hostname="auth.${DOMAIN_NAME}" \ | ||
--set ingress.ingressClassName="${DOMAIN_NAME}" \ | ||
--values "./values.yaml" | ||
|
||
########################################################### | ||
# Install Stunnel # | ||
########################################################### | ||
|
||
echo "- Installing Stunnel ... " | ||
|
||
kubectl apply -f "stunnel.yaml" | ||
|
||
# Finished! | ||
echo "Installed!" |
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,127 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: keycloak-ldap-cert | ||
namespace: vine | ||
type: Opaque | ||
stringData: | ||
# TODO(user): specify the endpoint and client certificates | ||
connect: ldap.google.com:636 | ||
# ldap-client.crt: "" | ||
# ldap-client.key: "" | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: keycloak-stunnel | ||
namespace: vine | ||
labels: | ||
name: keycloak-stunnel | ||
serviceType: internal | ||
spec: | ||
replicas: 1 | ||
strategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
name: keycloak-stunnel | ||
template: | ||
metadata: | ||
labels: | ||
name: keycloak-stunnel | ||
serviceType: internal | ||
spec: | ||
affinity: | ||
nodeAffinity: | ||
# KISS normal control plane nodes should be preferred | ||
preferredDuringSchedulingIgnoredDuringExecution: | ||
- weight: 1 | ||
preference: | ||
matchExpressions: | ||
- key: node-role.kubernetes.io/kiss-ephemeral-control-plane | ||
operator: DoesNotExist | ||
# KISS compute nodes should be preferred | ||
- weight: 2 | ||
preference: | ||
matchExpressions: | ||
- key: node-role.kubernetes.io/kiss | ||
operator: In | ||
values: | ||
- Compute | ||
# KISS gateway nodes should be more preferred | ||
- weight: 4 | ||
preference: | ||
matchExpressions: | ||
- key: node-role.kubernetes.io/kiss | ||
operator: In | ||
values: | ||
- Gateway | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: node-role.kubernetes.io/kiss | ||
operator: In | ||
values: | ||
- ControlPlane | ||
- Compute | ||
- Gateway | ||
securityContext: | ||
seccompProfile: | ||
type: RuntimeDefault | ||
containers: | ||
- name: stunnel | ||
image: docker.io/dweomer/stunnel:latest | ||
imagePullPolicy: Always | ||
env: | ||
- name: STUNNEL_ACCEPT | ||
value: "389" | ||
- name: STUNNEL_CLIENT | ||
value: "yes" | ||
- name: STUNNEL_CONNECT | ||
valueFrom: | ||
secretKeyRef: | ||
name: keycloak-ldap-cert | ||
key: connect | ||
- name: STUNNEL_SERVICE | ||
value: ldap | ||
ports: | ||
- name: ldap | ||
protocol: TCP | ||
containerPort: 389 | ||
resources: | ||
requests: | ||
cpu: 30m | ||
memory: 20Mi | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
volumeMounts: | ||
- name: cert | ||
mountPath: /etc/stunnel/stunnel.pem | ||
subPath: ldap-client.crt | ||
readOnly: true | ||
- name: cert | ||
mountPath: /etc/stunnel/stunnel.key | ||
subPath: ldap-client.key | ||
readOnly: true | ||
volumes: | ||
- name: cert | ||
secret: | ||
secretName: keycloak-ldap-cert | ||
defaultMode: 420 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: keycloak-stunnel | ||
namespace: vine | ||
spec: | ||
selector: | ||
name: keycloak-stunnel | ||
ports: | ||
- name: ldap | ||
port: 389 | ||
protocol: TCP | ||
targetPort: 389 |
Oops, something went wrong.