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

Issue 1230-1 : Use secrets in Pod Yamls. #1256

Merged
merged 3 commits into from
Apr 28, 2021
Merged
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
12 changes: 9 additions & 3 deletions K8s/api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,18 @@ spec:
value: keystone
- name: OS_AUTH_URL
value: http://KEYSTONE_IP/identity
- name: OS_USERNAME
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_USERNAME
- name: OS_PASSWORD
value: opensds@123
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_PASSWORD
- name: OS_PROJECT_NAME
value: service
- name: OS_USERNAME
value: opensds
- name: OS_USER_DOMIN_ID
value: Default
- name: SVC_FLAG
Expand Down
12 changes: 9 additions & 3 deletions K8s/file-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,18 @@ spec:
value: keystone
- name: OS_AUTH_URL
value: http://KEYSTONE_IP/identity
- name: OS_PASSWORD
value: opensds@123
- name: OS_PROJECT_NAME
value: service
- name: OS_USERNAME
value: opensds
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_USERNAME
- name: OS_PASSWORD
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_PASSWORD
- name: OS_USER_DOMIN_ID
value: Default
image: sodafoundation/multi-cloud-file:RELEASE_VERSION
Expand Down
1 change: 1 addition & 0 deletions K8s/k8s-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Run this file from multi-cloud folder.
kubectl apply -f rbac.yaml
kubectl apply -f soda-secret.yaml

#1. Create all the config Maps from files.
kubectl create configmap multicloud-config --from-file=../examples/multi-cloud.conf -n soda-multi-cloud
Expand Down
10 changes: 8 additions & 2 deletions K8s/mongo-service-0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ spec:
- name: "MONGO_CONFIGURE_REPLICA_SET"
value: "true"
- name: "MONGO_INITDB_ROOT_USERNAME"
value: "admin"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_USER"
- name: "MONGO_INITDB_ROOT_PASSWORD"
value: "mongo"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_PASSWORD"
- name: "MONGODB_ID"
value: "mongo-0"
livenessProbe:
Expand Down
10 changes: 8 additions & 2 deletions K8s/mongo-service-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ spec:
memory: "2Gi"
env:
- name: "MONGO_INITDB_ROOT_USERNAME"
value: "admin"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_USER"
- name: "MONGO_INITDB_ROOT_PASSWORD"
value: "mongo"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_PASSWORD"
- name: "MONGODB_ID"
value: "mongo-1"
livenessProbe:
Expand Down
10 changes: 8 additions & 2 deletions K8s/mongo-service-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ spec:
memory: "2Gi"
env:
- name: "MONGO_INITDB_ROOT_USERNAME"
value: "admin"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_USER"
- name: "MONGO_INITDB_ROOT_PASSWORD"
value: "mongo"
valueFrom:
secretKeyRef:
name: soda-secret
key: "MONGO_PASSWORD"
- name: "MONGODB_ID"
value: "mongo-2"
livenessProbe:
Expand Down
12 changes: 9 additions & 3 deletions K8s/s3api-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ spec:
value: keystone
- name: OS_AUTH_URL
value: http://KEYSTONE_IP/identity
- name: OS_PASSWORD
value: opensds@123
- name: OS_PROJECT_NAME
value: service
- name: OS_USERNAME
value: opensds
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_USERNAME
- name: OS_PASSWORD
valueFrom:
secretKeyRef:
name: soda-secret
key: OS_PASSWORD
- name: OS_USER_DOMIN_ID
value: Default
- name: SVC_FLAG
Expand Down
27 changes: 27 additions & 0 deletions K8s/soda-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2021 The SODA Authors.
#
# Licensed 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: Secret
metadata:
namespace: soda-multi-cloud
name: soda-secret
rajat-soda marked this conversation as resolved.
Show resolved Hide resolved
type: Opaque
stringData:
OS_USERNAME: opensds
OS_PASSWORD: opensds@123
MONGO_USER: admin
MONGO_PASSWORD: mongo