blob: 470aa4ccaebe0ef2974220877e84f8f8c822180a [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: Pod
metadata:
name: {{ .Release.Name }}-wskadmin
labels:
name: {{ .Release.Name }}-wskadmin
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
spec:
restartPolicy: Always
{{ include "openwhisk.docker.imagePullSecrets" . | indent 2 }}
containers:
- name: wskadmin
image: "{{- .Values.docker.registry.name -}}{{- .Values.utility.imageName -}}:{{- .Values.utility.imageTag -}}"
imagePullPolicy: {{ .Values.utility.imagePullPolicy | quote }}
command: ["/bin/bash", "-c", "tail -f /dev/null"]
env:
- name: "WHISK_LOGS_DIR"
value: "/var/log"
# Provider database configuration
{{- if .Values.providers.db.external }}
# Use an external CouchDB instance for the providers
- name: "DB_PROTOCOL"
value: {{ .Values.providers.db.protocol | quote }}
- name: "DB_HOST"
value: {{ .Values.providers.db.host | quote }}
- name: "DB_USERNAME"
value: {{ .Values.providers.db.username | quote }}
- name: "DB_PASSWORD"
value: {{ .Values.providers.db.password | quote }}
- name: "DB_PORT"
value: {{ .Values.providers.db.port | quote }}
{{- else }}
# Use the internally deployed CouchDB service for the providers
- name: "DB_HOST"
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_host
- name: "DB_PROTOCOL"
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_protocol
- name: "DB_PORT"
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_port
- name: "DB_USERNAME"
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-db.auth
key: db_username
- name: "DB_PASSWORD"
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-db.auth
key: db_password
{{ end }}
- name: "DB_WHISK_ACTIONS"
{{- if .Values.providers.db.whisk_actions }}
value: {{ .Values.providers.db.whisk_actions }}
{{ else }}
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_whisk_actions
{{ end }}
- name: "DB_WHISK_AUTHS"
{{- if .Values.providers.db.whisk_auths }}
value: {{ .Values.providers.db.whisk_auths }}
{{ else }}
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_whisk_auths
{{ end }}
- name: "DB_WHISK_ACTIVATIONS"
{{- if .Values.providers.db.whisk_activations }}
value: {{ .Values.providers.db.whisk_activations }}
{{ else }}
valueFrom:
configMapKeyRef:
name: {{ .Release.Name }}-db.config
key: db_whisk_activations
{{ end }}