-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfaf33a
commit 7891a04
Showing
10 changed files
with
61 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
name: ${context.app.id}-${context.env.id} |
12 changes: 12 additions & 0 deletions
12
modules/htc_res_defs/manifests/k8s-namespace/manifests.gtpl
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 @@ | ||
namespace.yaml: | ||
location: cluster | ||
data: | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
humanitec.io/app: ${context.app.id} | ||
humanitec.io/env: ${context.env.id} | ||
pod-security.kubernetes.io/enforce: restricted | ||
istio-injection: enabled | ||
name: {{ .init.name }} |
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 @@ | ||
namespace: {{ .init.name }} |
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 @@ | ||
name: {{ index (splitList "." "${context.res.id}") 1 }} |
11 changes: 11 additions & 0 deletions
11
modules/htc_res_defs/manifests/k8s-service-account/manifests.gtpl
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,11 @@ | ||
service-account.yaml: | ||
location: namespace | ||
data: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
humanitec.io/workload: {{ .init.name }} | ||
humanitec.io/app: ${context.app.id} | ||
humanitec.io/env: ${context.env.id} | ||
name: {{ .init.name }} |
1 change: 1 addition & 0 deletions
1
modules/htc_res_defs/manifests/k8s-service-account/outputs.gtpl
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 @@ | ||
name: {{ .init.name }} |
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,27 @@ | ||
update: | ||
- op: add | ||
path: /spec/serviceAccountName | ||
value: $${resources.k8s-service-account.outputs.name} | ||
- op: add | ||
path: /spec/automountServiceAccountToken | ||
value: false | ||
- op: add | ||
path: /spec/securityContext | ||
value: | ||
fsGroup: 1000 | ||
runAsGroup: 1000 | ||
runAsNonRoot: true | ||
runAsUser: 1000 | ||
seccompProfile: | ||
type: RuntimeDefault | ||
{{- range $containerId, $value := .resource.spec.containers }} | ||
- op: add | ||
path: /spec/containers/{{ $containerId }}/securityContext | ||
value: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
privileged: false | ||
readOnlyRootFilesystem: true | ||
{{- end }} |
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