2021-01-13 14:47:39 +00:00
|
|
|
#! Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
2020-09-10 02:06:39 +00:00
|
|
|
#! SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
#@ load("@ytt:data", "data")
|
|
|
|
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Namespace
|
|
|
|
metadata:
|
2020-09-10 22:20:02 +00:00
|
|
|
name: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
labels:
|
2020-09-10 22:20:02 +00:00
|
|
|
name: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
Rename many of resources that are created in Kubernetes by Pinniped
New resource naming conventions:
- Do not repeat the Kind in the name,
e.g. do not call it foo-cluster-role-binding, just call it foo
- Names will generally start with a prefix to identify our component,
so when a user lists all objects of that kind, they can tell to which
component it is related,
e.g. `kubectl get configmaps` would list one named "pinniped-config"
- It should be possible for an operator to make the word "pinniped"
mostly disappear if they choose, by specifying the app_name in
values.yaml, to the extent that is practical (but not from APIService
names because those are hardcoded in golang)
- Each role/clusterrole and its corresponding binding have the same name
- Pinniped resource names that must be known by the server golang code
are passed to the code at run time via ConfigMap, rather than
hardcoded in the golang code. This also allows them to be prepended
with the app_name from values.yaml while creating the ConfigMap.
- Since the CLI `get-kubeconfig` command cannot guess the name of the
CredentialIssuerConfig resource in advance anymore, it lists all
CredentialIssuerConfig in the app's namespace and returns an error
if there is not exactly one found, and then uses that one regardless
of its name
2020-09-18 22:56:50 +00:00
|
|
|
name: local-user-authenticator
|
2020-09-10 22:20:02 +00:00
|
|
|
namespace: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
---
|
2020-09-17 23:07:31 +00:00
|
|
|
#@ if data.values.image_pull_dockerconfigjson and data.values.image_pull_dockerconfigjson != "":
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Secret
|
|
|
|
metadata:
|
|
|
|
name: image-pull-secret
|
|
|
|
namespace: local-user-authenticator
|
|
|
|
labels:
|
|
|
|
app: local-user-authenticator
|
|
|
|
type: kubernetes.io/dockerconfigjson
|
|
|
|
data:
|
|
|
|
.dockerconfigjson: #@ data.values.image_pull_dockerconfigjson
|
|
|
|
#@ end
|
|
|
|
---
|
2020-09-10 02:06:39 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2020-09-10 22:20:02 +00:00
|
|
|
name: local-user-authenticator
|
|
|
|
namespace: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
labels:
|
2020-09-10 22:20:02 +00:00
|
|
|
app: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2020-09-10 22:20:02 +00:00
|
|
|
app: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-09-10 22:20:02 +00:00
|
|
|
app: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
spec:
|
2020-11-02 16:57:05 +00:00
|
|
|
securityContext:
|
2021-01-13 14:47:39 +00:00
|
|
|
runAsUser: #@ data.values.run_as_user
|
|
|
|
runAsGroup: #@ data.values.run_as_group
|
Rename many of resources that are created in Kubernetes by Pinniped
New resource naming conventions:
- Do not repeat the Kind in the name,
e.g. do not call it foo-cluster-role-binding, just call it foo
- Names will generally start with a prefix to identify our component,
so when a user lists all objects of that kind, they can tell to which
component it is related,
e.g. `kubectl get configmaps` would list one named "pinniped-config"
- It should be possible for an operator to make the word "pinniped"
mostly disappear if they choose, by specifying the app_name in
values.yaml, to the extent that is practical (but not from APIService
names because those are hardcoded in golang)
- Each role/clusterrole and its corresponding binding have the same name
- Pinniped resource names that must be known by the server golang code
are passed to the code at run time via ConfigMap, rather than
hardcoded in the golang code. This also allows them to be prepended
with the app_name from values.yaml while creating the ConfigMap.
- Since the CLI `get-kubeconfig` command cannot guess the name of the
CredentialIssuerConfig resource in advance anymore, it lists all
CredentialIssuerConfig in the app's namespace and returns an error
if there is not exactly one found, and then uses that one regardless
of its name
2020-09-18 22:56:50 +00:00
|
|
|
serviceAccountName: local-user-authenticator
|
2020-09-17 23:07:31 +00:00
|
|
|
#@ if data.values.image_pull_dockerconfigjson and data.values.image_pull_dockerconfigjson != "":
|
|
|
|
imagePullSecrets:
|
|
|
|
- name: image-pull-secret
|
|
|
|
#@ end
|
2020-09-10 02:06:39 +00:00
|
|
|
containers:
|
2020-09-10 22:20:02 +00:00
|
|
|
- name: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
#@ if data.values.image_digest:
|
|
|
|
image: #@ data.values.image_repo + "@" + data.values.image_digest
|
|
|
|
#@ else:
|
|
|
|
image: #@ data.values.image_repo + ":" + data.values.image_tag
|
|
|
|
#@ end
|
|
|
|
imagePullPolicy: IfNotPresent
|
2021-07-26 16:18:43 +00:00
|
|
|
command:
|
|
|
|
- local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2020-09-10 22:20:02 +00:00
|
|
|
name: local-user-authenticator
|
|
|
|
namespace: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
labels:
|
2020-09-10 22:20:02 +00:00
|
|
|
app: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
selector:
|
2020-09-10 22:20:02 +00:00
|
|
|
app: local-user-authenticator
|
2020-09-10 02:06:39 +00:00
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: 443
|
2020-11-02 16:57:05 +00:00
|
|
|
targetPort: 8443
|