Skip to content

Commit

Permalink
skipper: update hostname-credentials-controller
Browse files Browse the repository at this point in the history
The logic previously implemented by secret-combiner was moved into
hostname-credentials-controller.

Signed-off-by: Alexander Yastrebov <[email protected]>
  • Loading branch information
AlexanderYastrebov committed Mar 4, 2024
1 parent 9557cae commit 7755b14
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 100 deletions.
14 changes: 14 additions & 0 deletions cluster/manifests/deletions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ pre_apply:
namespace: kube-system
kind: Deployment

# TODO: remove after rollout
- kind: CronJob
name: secret-combiner
namespace: kube-system
- kind: RoleBinding
name: secret-combiner
namespace: kube-system
- kind: Role
name: secret-combiner
namespace: kube-system
- kind: ServiceAccount
name: secret-combiner
namespace: kube-system

# everything defined under here will be deleted after applying the manifests
post_apply:
- name: cronjob-monitor
Expand Down
42 changes: 40 additions & 2 deletions cluster/manifests/skipper/hostname-credentials-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# {{ if eq .Cluster.ConfigItems.skipper_oauth2_ui_login "true" }}
# {{ $version := "main-11" }}
# {{ $version := "main-12" }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -56,6 +56,42 @@ subjects:
name: hostname-credentials-controller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: hostname-credentials-controller
namespace: kube-system
labels:
application: skipper-ingress
component: hostname-credentials
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- list
- get
- create
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: hostname-credentials-controller
namespace: kube-system
labels:
application: skipper-ingress
component: hostname-credentials
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: hostname-credentials-controller
subjects:
- kind: ServiceAccount
name: hostname-credentials-controller
namespace: kube-system
---
apiVersion: batch/v1
kind: CronJob
metadata:
Expand Down Expand Up @@ -91,10 +127,12 @@ spec:
args:
- -ingress-selector=application
- -credentials-namespace=kube-system
- -credentials-name-template={hostname}-grant-credentials
- -credentials-name-template={host}-grant-credentials
- -credentials-selector=application=skipper-ingress,component=hostname-credentials
- -credentials-labels=application=skipper-ingress,component=hostname-credentials
- -credentials-redirect-uri-path={{ .Cluster.ConfigItems.skipper_oauth2_redirect_uri_path }}
- -combined-secret-name=hostname-credentials
- -combined-secret-labels=application=skipper-ingress,component=hostname-credentials-combined
resources:
limits:
cpu: 10m
Expand Down
98 changes: 0 additions & 98 deletions cluster/manifests/skipper/secret-combiner.yaml

This file was deleted.

0 comments on commit 7755b14

Please sign in to comment.