Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for from PR #18 + credentials directory #23

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/incubator/f5-bigip-ctlr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apiVersion: v1
description: Deploy the F5 Networks BIG-IP Controller for Kubernetes and OpenShift (k8s-bigip-ctlr).
name: f5-bigip-ctlr
version: 0.0.4
version: 0.0.6
home: https://github.com/F5Networks/charts
keywords:
- f5-bigip
sources:
- https://clouddocs.f5.com/containers/v2/kubernetes/kctlr-k8s-ingress-ctlr.html
27 changes: 27 additions & 0 deletions src/incubator/f5-bigip-ctlr/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,35 @@ Expand the name of the chart.
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "f5-bigip-ctlr.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "f5-bigip-ctlr.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "f5-bigip-ctlr.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "f5-bigip-ctlr.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.rbac.create -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: f5-bigip-ctlr-clusterrole
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
Expand Down Expand Up @@ -37,3 +38,4 @@ rules:
- update
- create
- patch
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{{- if .Values.rbac.create -}}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: f5-bigip-ctlr-clusterrolebinding
namespace: kube-system
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: f5-bigip-ctlr-clusterrole
name: {{ template "f5-bigip-ctlr.fullname" . }}
subjects:
- kind: ServiceAccount
name: f5-bigip-ctlr-serviceaccount
namespace: kube-system
name: {{ template "f5-bigip-ctlr.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
{{- end -}}
23 changes: 20 additions & 3 deletions src/incubator/f5-bigip-ctlr/templates/f5-bigip-ctlr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "f5-bigip-ctlr.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "-" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
Expand All @@ -23,7 +22,7 @@ spec:
app: {{ template "f5-bigip-ctlr.name" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: {{ .Values.serviceaccount }}
serviceAccountName: {{ template "f5-bigip-ctlr.serviceAccountName" . }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range $pullSecret := .Values.image.pullSecrets }}
Expand All @@ -33,6 +32,7 @@ spec:
containers:
- name: {{ template "f5-bigip-ctlr.name" . }}
image: "{{ .Values.image.user }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}"
{{- if .Values.secrets_env }}
env:
- name: BIGIP_USERNAME
valueFrom:
Expand All @@ -44,16 +44,33 @@ spec:
secretKeyRef:
name: {{ .Values.bigip_login_secret }}
key: password
{{ else }}
volumeMounts:
- name: bigip-creds
mountPath: "/tmp/creds"
readOnly: true
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /app/bin/k8s-bigip-ctlr
args:
{{- if .Values.secrets_env }}
- --bigip-username
- $(BIGIP_USERNAME)
- --bigip-password
- $(BIGIP_PASSWORD)
{{ else }}
- --credentials-directory
- /tmp/creds
{{- end }}
{{- range $key, $value := .Values.args }}
- --{{ $key | replace "_" "-"}}
- {{ $value | quote }}
{{- end }}
{{- if not .Values.secret_env }}
volumes:
- name: bigip-creds
secret:
secretName: {{ .Values.bigip_login_secret }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{- if .Values.rbac.create -}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: f5-bigip-ctlr-serviceaccount
namespace: kube-system
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
heritage: {{ .Release.Service }}
{{- end -}}
{{- end -}}
15 changes: 12 additions & 3 deletions src/incubator/f5-bigip-ctlr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@
# To create a secret using kubectl see
# http://clouddocs.f5.com/containers/latest/kubernetes/kctlr-secrets.html#secret-bigip-login
bigip_login_secret: f5-bigip-ctlr-login
serviceaccount: f5-bigip-ctlr-serviceaccount
# This namespace is where the Controller lives;
namespace: kube-system

rbac:
# Specifies whether RBAC resources should be created
create: true

serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:

args:
# See http://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest/#controller-configuration-parameters
# NOTE: helm has difficulty with values using `-`; `_` are used for naming
Expand Down
9 changes: 7 additions & 2 deletions src/stable/f5-bigip-ctlr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apiVersion: v1
description: Deploy the F5 Networks BIG-IP Controller for Kubernetes and OpenShift (k8s-bigip-ctlr).
description: Deploy the F5 Networks BIG-IP Controller for Kubernetes and OpenShift (k8s-bigip-ctlr).
name: f5-bigip-ctlr
version: 0.0.3
version: 0.0.6
home: https://github.com/F5Networks/charts
keywords:
- f5-bigip
sources:
- https://clouddocs.f5.com/containers/v2/kubernetes/kctlr-k8s-ingress-ctlr.html
27 changes: 27 additions & 0 deletions src/stable/f5-bigip-ctlr/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,35 @@ Expand the name of the chart.
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "f5-bigip-ctlr.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "f5-bigip-ctlr.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
{{- define "f5-bigip-ctlr.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "f5-bigip-ctlr.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.rbac.create -}}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: f5-bigip-ctlr-clusterrole
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
rules:
Expand Down Expand Up @@ -37,3 +38,4 @@ rules:
- update
- create
- patch
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{{- if .Values.rbac.create -}}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: f5-bigip-ctlr-clusterrolebinding
namespace: kube-system
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: f5-bigip-ctlr-clusterrole
name: {{ template "f5-bigip-ctlr.fullname" . }}
subjects:
- kind: ServiceAccount
name: f5-bigip-ctlr-serviceaccount
namespace: kube-system
name: {{ template "f5-bigip-ctlr.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
{{- end -}}
29 changes: 26 additions & 3 deletions src/stable/f5-bigip-ctlr/templates/f5-bigip-ctlr-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "f5-bigip-ctlr.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "-" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
Expand All @@ -23,10 +22,17 @@ spec:
app: {{ template "f5-bigip-ctlr.name" . }}
release: {{ .Release.Name }}
spec:
serviceAccountName: {{ .Values.serviceaccount }}
serviceAccountName: {{ template "f5-bigip-ctlr.serviceAccountName" . }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range $pullSecret := .Values.image.pullSecrets }}
- name: {{ $pullSecret }}
{{- end }}
{{- end }}
containers:
- name: {{ template "f5-bigip-ctlr.name" . }}
image: "{{ .Values.image.user }}/{{ .Values.image.repo }}:{{ .Values.image.tag }}"
{{- if .Values.secrets_env }}
env:
- name: BIGIP_USERNAME
valueFrom:
Expand All @@ -38,16 +44,33 @@ spec:
secretKeyRef:
name: {{ .Values.bigip_login_secret }}
key: password
{{ else }}
volumeMounts:
- name: bigip-creds
mountPath: "/tmp/creds"
readOnly: true
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /app/bin/k8s-bigip-ctlr
args:
{{- if .Values.secrets_env }}
- --bigip-username
- $(BIGIP_USERNAME)
- --bigip-password
- $(BIGIP_PASSWORD)
{{ else }}
- --credentials-directory
- /tmp/creds
{{- end }}
{{- range $key, $value := .Values.args }}
- --{{ $key | replace "_" "-"}}
- {{ $value | quote }}
{{- end }}
{{- if not .Values.secret_env }}
volumes:
- name: bigip-creds
secret:
secretName: {{ .Values.bigip_login_secret }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{- if .Values.rbac.create -}}
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: f5-bigip-ctlr-serviceaccount
namespace: kube-system
name: {{ template "f5-bigip-ctlr.fullname" . }}
labels:
app: {{ template "f5-bigip-ctlr.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "f5-bigip-ctlr.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
heritage: {{ .Release.Service }}
{{- end -}}
{{- end -}}
14 changes: 12 additions & 2 deletions src/stable/f5-bigip-ctlr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
# http://clouddocs.f5.com/containers/latest/kubernetes/kctlr-secrets.html#secret-bigip-login
bigip_login_secret: f5-bigip-ctlr-login
serviceaccount: f5-bigip-ctlr-serviceaccount
# This namespace is where the Controller lives;
namespace: kube-system

rbac:
# Specifies whether RBAC resources should be created
create: true

serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:

args:
# See http://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest/#controller-configuration-parameters
# NOTE: helm has difficulty with values using `-`; `_` are used for naming
Expand Down