generating policies first version.
Still includes linkerd ports.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
apiVersion: policy.linkerd.io/v1alpha1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: {{ .app.Name }}-p{{ .port }}
|
||||
namespace: {{ .app.Namespace.Name}}
|
||||
spec:
|
||||
targetRef:
|
||||
group: policy.linkerd.io
|
||||
kind: Server
|
||||
name: {{ .app.Name }}-p{{ .port }}
|
||||
requiredAuthenticationRefs:
|
||||
- name: {{ .app.Name }}-p{{ .port }}
|
||||
namespace: {{ .app.Namespace.Name }}
|
||||
kind: MeshTLSAuthentication
|
||||
group: policy.linkerd.io
|
||||
{{- range $net := .clientNetworks }}
|
||||
- name: {{ $net.Network.Name }}
|
||||
namespace: default
|
||||
kind: NetworkAuthentication
|
||||
group: policy.linkerd.io
|
||||
{{- end }}
|
||||
@@ -2,16 +2,12 @@
|
||||
apiVersion: policy.linkerd.io/v1alpha1
|
||||
kind: MeshTLSAuthentication
|
||||
metadata:
|
||||
name: {{ .Name }}
|
||||
namespace: {{ .Namespace.Name }}
|
||||
name: {{ .app.Name }}-{{.port}}
|
||||
namespace: {{ .app.Namespace.Name }}
|
||||
spec:
|
||||
{{- if .ServiceAccounts }}
|
||||
identityRefs:
|
||||
{{- range $sa := .ServiceAccounts }}
|
||||
{{- range $sa := .serviceAccounts }}
|
||||
- kind: ServiceAccount
|
||||
name: {{ $sa }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
fail (printf "no service accounts defined for app %s" .Name )
|
||||
{{- end}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user