-
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.
Merge branch 'master' into cert-manager.io-v1
- Loading branch information
Showing
15 changed files
with
191 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local kube = import 'lib/kube.libjsonnet'; | ||
local inv = kap.inventory(); | ||
local params = inv.parameters.keycloak; | ||
|
||
local prometheus_namespace = | ||
if std.objectHas(inv.parameters, 'rancher_monitoring') then | ||
inv.parameters.rancher_monitoring.namespace | ||
else | ||
'syn-synsights'; | ||
local prometheus_name = 'prometheus'; | ||
|
||
local keycloak_namespace = params.namespace; | ||
local keycloak_name = params.release_name; | ||
|
||
local name = prometheus_name + '-' + prometheus_namespace + '-to-' + keycloak_name; | ||
|
||
local netpol = | ||
kube.NetworkPolicy(name) { | ||
metadata+: { | ||
namespace: keycloak_namespace, | ||
}, | ||
spec+: { | ||
ingress: [ | ||
{ | ||
from: [ | ||
{ | ||
namespaceSelector: { | ||
matchLabels: { | ||
name: prometheus_namespace, | ||
}, | ||
}, | ||
podSelector: { | ||
matchLabels: { | ||
app: prometheus_name, | ||
}, | ||
}, | ||
}, | ||
], | ||
ports: [ | ||
{ | ||
port: 9990, | ||
protocol: 'TCP', | ||
}, | ||
], | ||
}, | ||
], | ||
podSelector: { | ||
matchLabels: { | ||
'app.kubernetes.io/instance': keycloak_name, | ||
'app.kubernetes.io/name': keycloak_name, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
{ | ||
'40_netpol': netpol, | ||
} |
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,41 @@ | ||
= Installing on OpenShift 4 | ||
|
||
This guide describes how to install this component on OpenShift 4. | ||
|
||
== Parameters for Keycloak | ||
|
||
You need to disable some security context fields, as OpenShift sets those automatically. | ||
|
||
[source,yaml,subs="attributes+"] | ||
---- | ||
parameters: | ||
keycloak: | ||
ingress: | ||
servicePort: http <1> | ||
helm_values: | ||
podSecurityContext: null | ||
securityContext: null | ||
pgchecker: | ||
securityContext: null | ||
---- | ||
<1> It's not possible to use the `reencrypt` termination if using Ingress with a self-signed destination certificate. | ||
|
||
== Parameters for built-in Postgresql database | ||
|
||
If you are using the built-in database provider (by default unless `keycloak.database.provider` is overridden) you also need to adjust the following parameters. | ||
|
||
[source,yaml,subs="attributes+"] | ||
---- | ||
parameters: | ||
keycloak: | ||
helm_values: | ||
postgresql: | ||
securityContext: | ||
enabled: false | ||
volumePermissions: | ||
securityContext: | ||
runAsUser: auto | ||
shmVolume: | ||
chmod: | ||
enabled: false | ||
---- |
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,42 @@ | ||
/** | ||
* Adjust StatefuleSet generated by helm template: | ||
* * Fix the apiVersion | ||
*/ | ||
local com = import 'lib/commodore.libjsonnet'; | ||
local kap = import 'lib/kapitan.libjsonnet'; | ||
local inv = kap.inventory(); | ||
local params = inv.parameters.keycloak; | ||
|
||
local chart_output_dir = std.extVar('output_path'); | ||
|
||
local list_dir(dir, basename=true) = | ||
std.native('list_dir')(dir, basename); | ||
|
||
local chart_files = list_dir(chart_output_dir); | ||
|
||
local input_file(elem) = chart_output_dir + '/' + elem; | ||
local stem(elem) = | ||
local elems = std.split(elem, '.'); | ||
std.join('.', elems[:std.length(elems) - 1]); | ||
|
||
|
||
local fix_api_version(sts) = | ||
sts { | ||
apiVersion: 'apps/v1', | ||
}; | ||
|
||
local fixup_obj(obj) = | ||
if obj.kind == 'StatefulSet' then | ||
fix_api_version(obj) | ||
else | ||
obj; | ||
|
||
local fixup(obj_file) = | ||
local objs = std.prune(com.yaml_load_all(obj_file)); | ||
// process all objs | ||
[ fixup_obj(obj) for obj in objs ]; | ||
|
||
{ | ||
[stem(elem)]: fixup(input_file(elem)) | ||
for elem in chart_files | ||
} |
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,2 +1 @@ | ||
parameters: | ||
_instance: builtin | ||
--- |
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,6 +1,4 @@ | ||
parameters: | ||
_instance: external | ||
|
||
keycloak: | ||
database: | ||
provider: external | ||
|
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,12 @@ | ||
package external | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func Test_Postgresql_Helmchart_Not_Rendered(t *testing.T) { | ||
subChartDir := testPath+"/01_keycloak_helmchart/keycloak/charts" | ||
require.NoDirExists(t, subChartDir) | ||
} |
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