-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(hatchery): k8s hatchery uses service account instead of kubeconfig (
#4225) * feat(hatchery:k8s): use sa/rbac instead of embedded kubeconfig wasn't supposed to be added .. * revert some changes for alternate use cases, update readme
- Loading branch information
Showing
11 changed files
with
205 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
**/dist/* | ||
tests/ | ||
images/ | ||
tools/ | ||
docs/ | ||
contrib/ |
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,24 @@ | ||
FROM golang:1.12-stretch as BUILD | ||
|
||
WORKDIR /go/src/github.com/ovh/cds | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y libsecret-1-dev | ||
# separating for quicker build times since its for dev | ||
|
||
COPY . . | ||
|
||
RUN OS=linux ARCH=amd64 make build \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
FROM debian:jessie | ||
|
||
USER nobody | ||
WORKDIR /app | ||
|
||
COPY --from=BUILD --chown=nobody:nogroup /go/src/github.com/ovh/cds/engine/dist/* ./ | ||
COPY --from=BUILD --chown=nobody:nogroup /go/src/github.com/ovh/cds/engine/worker/dist/* ./ | ||
COPY --from=BUILD --chown=nobody:nogroup /go/src/github.com/ovh/cds/cli/cdsctl/dist/* ./ | ||
COPY --chown=nobody:nogroup engine/sql sql | ||
|
||
CMD ["/app/cds-engine-linux-amd64"] |
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
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,36 @@ | ||
{{- if .Values.rbac.create -}} | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: {{ template "cds.fullname" . }} | ||
labels: | ||
app: {{ template "cds.fullname" . }}-api | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods"] | ||
verbs: ["get", "list", "create", "update", "delete"] | ||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
verbs: ["list", "create"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ template "cds.fullname" . }} | ||
labels: | ||
app: {{ template "cds.fullname" . }}-api | ||
chart: {{ .Chart.Name }}-{{ .Chart.Version }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: {{ template "cds.fullname" . }} | ||
subjects: | ||
- name: {{ template "cds.serviceAccount.name" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
kind: ServiceAccount | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- if .Values.serviceAccount.create -}} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
{{- if .Values.image.imagePullSecrets }} | ||
imagePullSecrets: {{ toYaml .Values.image.imagePullSecrets | nindent 2 }} | ||
{{- end }} | ||
metadata: | ||
name: {{ template "cds.serviceAccount.name" . }} | ||
namespace: {{ .Release.Namespace | quote }} | ||
labels: | ||
app: {{ template "cds.fullname" . }}-api | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
{{- 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
Oops, something went wrong.