kube-openid-connect

by devopstales

Helm chartv1.1.0App 1.0.0Verified publisher

A Helm chart for Kubernetes

About this chart

The following tables lists configurable parameters of the trivy-operator chart and their default values.

ParameterDescriptionDefault
TimeZoneTomezone for container timeEurope/Budapest
server.debugenable debug loggingfalse
server.oidcOutURLWhere to redirect after logout?https://devopstales.github.io/tags/kube-openid-connect/
server.oidcRedirectUrlHttpScemaIngress schema (http or https)http
server.oidcRedirectUrlHostIngress hostnamechart-example.local
server.oidcServerURLURL of OIDC provider endpointNot set
server.oidcClientIDYour unique client IDNot set
server.oidcSecretThe password for the Client IDNot set
server.k8sContextContext of the cluster in generated configNot set
server.k8sApiServerThe endpoint for kubectl to useNot set
server.k8sCaCrtThe Public CA cert for the clusterNot set
image.repositoryimagedevopstales/trivy-operator
image.pullPolicypullPolicyAlways
image.tagimage tag1.0
imagePullSecretsimagePullSecrets list[]
nameOverrideOverride the name partNot set
fullnameOverrideOverride the full nameNot set
serviceAccount.createcreate serviceAccounttrue
serviceAccount.annotationsadd annotation to serviceAccount{}
serviceAccount.namename of the serviceAccountNot set
podAnnotationsadd extra annotations for the pod{}
podSecurityContext.fsGroupmount id10001
securityContextadd extra securityContext for the pod{}
service.portport number5000
service.typetype of the serviceClusterIP
ingress.enabledenable ingresstrue
ingress.classNameingress calssNot Set
ingress.annotationsextra annotation to ingressNot set
ingress.hosts.hosthostname for ingresschart-example.local
ingress.hosts.paths[0].pathsubpath on ingress\
ingress.hosts.paths[0].pathTypeingress path typeImplementationSpecific
ingress.tlstls config for ingress[]

OIDC (Provider) Setup

You will need to obtain the OIDC details of the provider you need to use. This will contain the Issuer URL, Client ID and the Client Secret. In the case of Google (The provider which was used when initially creating this) go to the Developer / Credentials console. You will need to add the ingress url to both

  • Authorised JavaScript origins - https://kubeauth.k8s.intra
  • Authorised redirect URIs - https://kubeauth.k8s.intra/callback

If you used kops the credentials you're after are

apiVersion: kops/v1alpha2
kind: Cluster
  authorization:
    rbac: {}
  kubeAPIServer:
    authorizationRbacSuperUser: admin
    oidcClientID: UNIQUE_ID_REDACTED.apps.googleusercontent.com
    oidcIssuerURL: https://accounts.google.com
    oidcUsernameClaim: email

For G Suite : The redacted part of a ClientID is about 45 alphanumeric characters long (may also contain a hyphen or two) The client secret will be about 25 alphanumeric chacters (may also contain a hyphen or two)

For manually configure the Kubernetes ApiServer integration with OpeniD provider:

nano /etc/kubernetes/manifests/kube-apiserver.yaml
---
...
command:
- /hyperkube
- apiserver
...
- --oidc-issuer-url={{ .Values.server.oidcServerURL }}
- --oidc-client-id={{ .Values.server.oidcClientID }}
- --oidc-username-claim=email
- --oidc-groups-claim=groups
# for self sign cert or custom ca
#- --oidc-ca-file=/etc/kubernetes/pki/rootca.pem
systemctl restart kubelet

Deploy kube-openid-connect with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kube-openid-connect on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkube-openid-connect is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply