Skip to content

Commit

Permalink
[charts/csm-authorization-v2.0] Enable dependabot for authorization v2 (
Browse files Browse the repository at this point in the history
#494)

* enable dependabot for auth v2

* combine into one
  • Loading branch information
shaynafinocchiaro committed Oct 30, 2024
1 parent 23cbec8 commit e42fe3e
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 56 deletions.
44 changes: 22 additions & 22 deletions charts/csm-authorization-v2.0/charts/redis-csm/templates/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
spec:
initContainers:
- name: config
image: {{ .Values.redis.images.redis }}
image: {{ .Values.redis.images.redis.image }}
env:
- name: REDIS_PASSWORD
valueFrom:
Expand All @@ -48,7 +48,7 @@ spec:
cp /csm-auth-redis-cm/redis.conf /etc/redis/redis.conf
echo "masterauth $REDIS_PASSWORD" >> /etc/redis/redis.conf
echo "requirepass $REDIS_PASSWORD" >> /etc/redis/redis.conf
echo "Finding master..."
MASTER_FDQN=`hostname -f | sed -e 's/{{ .Values.redis.name }}-[0-9]\./{{ .Values.redis.name }}-0./'`
echo "Master at " $MASTER_FQDN
Expand All @@ -57,15 +57,15 @@ spec:
if [ "$(hostname)" = "{{ .Values.redis.name }}-0" ]; then
echo "This is Redis master, not updating redis.conf..."
else
echo "This is Redis replica, updating redis.conf..."
echo "replicaof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
echo "This is Redis replica, updating redis.conf..."
echo "replicaof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
fi
else
echo "Sentinel found, finding master..."
MASTER="$(redis-cli -h sentinel -p 5000 sentinel get-master-addr-by-name mymaster | grep -E '(^redis-csm-\d{1,})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')"
echo "replicaof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
MASTER="$(redis-cli -h sentinel -p 5000 sentinel get-master-addr-by-name mymaster | grep -E '(^redis-csm-\d{1,})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})')"
echo "replicaof $MASTER_FDQN 6379" >> /etc/redis/redis.conf
fi
volumeMounts:
volumeMounts:
- name: redis-primary-volume
mountPath: /data
- name: configmap
Expand All @@ -74,7 +74,7 @@ spec:
mountPath: /etc/redis/
containers:
- name: {{ .Values.redis.name }}
image: {{ .Values.redis.images.redis }}
image: {{ .Values.redis.images.redis.image }}
command: ["redis-server"]
args: ["/etc/redis/redis.conf"]
ports:
Expand All @@ -88,13 +88,13 @@ spec:
- name: config
mountPath: /etc/redis/
volumes:
- name: redis-primary-volume
- name: redis-primary-volume
emptyDir: {}
- name: config
- name: config
emptyDir: {}
- name: configmap
configMap:
name: redis-csm-cm
name: redis-csm-cm
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -116,43 +116,43 @@ spec:
spec:
containers:
- name: {{ .Values.redis.rediscommander }}
image: {{ .Values.redis.images.commander }}
image: {{ .Values.redis.images.commander.image }}
imagePullPolicy: IfNotPresent
env:
{{- $str := "" -}}
{{- $ns := include "custom.namespace" . -}}
{{- $ns := include "custom.namespace" . -}}
{{- $replicas := .Values.redis.replicas | int }}
{{- $sentinel := .Values.redis.sentinel }}
{{- range $i, $e := until $replicas }}
{{- if $i }}
{{- range $i, $e := until $replicas }}
{{- if $i }}
{{- $str = print $str "," -}}
{{- end }}
{{- end }}
{{- $str = printf "%s%s-%d.%s.%s.svc.cluster.local:5000" $str $sentinel $i $sentinel $ns -}}
{{- end }}
- name: SENTINELS
value: {{ $str | quote }}
- name: SENTINELS
value: {{ $str | quote }}
- name: K8S_SIGTERM
value: "1"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-csm-secret
key: password
key: password
- name: SENTINEL_PASSWORD
valueFrom:
secretKeyRef:
name: redis-csm-secret
key: password
key: password
- name: HTTP_PASSWORD
valueFrom:
secretKeyRef:
name: redis-csm-secret
key: password
key: password
- name: HTTP_USER
valueFrom:
secretKeyRef:
name: redis-csm-secret
key: commander_user
key: commander_user
ports:
- name: {{ .Values.redis.rediscommander }}
containerPort: 8081
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ spec:
spec:
initContainers:
- name: config
image: {{ .Values.redis.images.redis }}
image: {{ .Values.redis.images.redis.image }}
command: [ "sh", "-c" ]
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-csm-secret
key: password
args:
- |
replicas=$( expr {{ .Values.redis.replicas | int }} - 1)
args:
- |
replicas=$( expr {{ .Values.redis.replicas | int }} - 1)
for i in $(seq 0 $replicas)
do
do
node=$( echo "{{ .Values.redis.name }}-$i.{{ .Values.redis.name }}" )
nodes=$( echo "$nodes*$node" )
done
done
loop=$(echo $nodes | sed -e "s/"*"/\n/g")
for i in $loop
do
do
echo "Finding master at $i"
MASTER=$(redis-cli --no-auth-warning --raw -h $i -a $REDIS_PASSWORD info replication | awk '{print $1}' | grep master_host: | cut -d ":" -f2)
if [ "$MASTER" = "" ]; then
Expand Down Expand Up @@ -66,7 +66,7 @@ spec:
mountPath: /etc/redis/
containers:
- name: sentinel
image: {{ .Values.redis.images.redis }}
image: {{ .Values.redis.images.redis.image }}
command: ["redis-sentinel"]
args: ["/etc/redis/sentinel.conf"]
ports:
Expand All @@ -81,7 +81,7 @@ spec:
- name: redis-config
emptyDir: {}
- name: data
emptyDir : {}
emptyDir : {}
---
apiVersion: v1
kind: Service
Expand All @@ -100,7 +100,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Values.redis.sentinel }}-svc
spec:
spec:
type: NodePort
ports:
- port: 5000
Expand Down
6 changes: 4 additions & 2 deletions charts/csm-authorization-v2.0/charts/redis-csm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ redis:
rediscommander: rediscommander
replicas: 5
images:
redis: redis:7.4.0-alpine
commander: rediscommander/redis-commander:latest
redis:
image: redis:7.4.0-alpine
commander:
image: rediscommander/redis-commander:latest
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ spec:
serviceAccountName: authorization-controller
containers:
- name: authorization-controller
image: {{ required "Must provide the controller image." .Values.authorization.images.authorizationController }}
image: {{ required "Must provide the controller image." .Values.authorization.images.authorizationController.image }}
imagePullPolicy: Always
args:
- "--authorization-namespace={{ .Release.Namespace }}"
Expand Down
6 changes: 3 additions & 3 deletions charts/csm-authorization-v2.0/templates/proxy-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
containers:

- name: proxy-server
image: {{ required "Must provide the proxy-server image." .Values.authorization.images.proxyService }}
image: {{ required "Must provide the proxy-server image." .Values.authorization.images.proxyService.image }}
imagePullPolicy: Always
env:
{{- $str := "" -}}
Expand Down Expand Up @@ -132,7 +132,7 @@ spec:
- name: csm-config-params
mountPath: /etc/karavi-authorization/csm-config-params
- name: opa
image: {{ required "Must provide the openpolicyagent image." .Values.authorization.images.opa }}
image: {{ required "Must provide the openpolicyagent image." .Values.authorization.images.opa.image }}
imagePullPolicy: IfNotPresent
args:
- "run"
Expand All @@ -143,7 +143,7 @@ spec:
- name: http
containerPort: 8181
- name: kube-mgmt
image: {{ required "Must provide the opaKubeMgmt image." .Values.authorization.images.opaKubeMgmt }}
image: {{ required "Must provide the opaKubeMgmt image." .Values.authorization.images.opaKubeMgmt.image }}
imagePullPolicy: IfNotPresent
args:
- "--namespaces={{ include "custom.namespace" . }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/csm-authorization-v2.0/templates/role-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
serviceAccountName: role-service
containers:
- name: role-service
image: {{ required "Must provide the role-service image." .Values.authorization.images.roleService }}
image: {{ required "Must provide the role-service image." .Values.authorization.images.roleService.image }}
imagePullPolicy: Always
ports:
- containerPort: 50051
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ spec:
serviceAccountName: storage-service
containers:
- name: storage-service
image: {{ required "Must provide the storage-service image." .Values.authorization.images.storageService }}
image: {{ required "Must provide the storage-service image." .Values.authorization.images.storageService.image }}
imagePullPolicy: Always
env:
{{- $str := "" -}}
Expand Down
12 changes: 6 additions & 6 deletions charts/csm-authorization-v2.0/templates/tenant-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ spec:
spec:
containers:
- name: tenant-service
image: {{ required "Must provide the tenant-service image." .Values.authorization.images.tenantService }}
imagePullPolicy: Always
image: {{ required "Must provide the tenant-service image." .Values.authorization.images.tenantService.image }}
imagePullPolicy: Always
env:
{{- $str := "" -}}
{{- $ns := include "custom.namespace" . -}}
{{- $ns := include "custom.namespace" . -}}
{{- $replicas := .Values.redis.replicas | int }}
{{- $sentinel := .Values.redis.sentinel }}
{{- range $i, $e := until $replicas }}
{{- if $i }}
{{- range $i, $e := until $replicas }}
{{- if $i }}
{{- $str = print $str "," -}}
{{- end }}
{{- end }}
{{- $str = printf "%s%s-%d.%s.%s.svc.cluster.local:5000" $str $sentinel $i $sentinel $ns -}}
{{- end }}
- name: REDIS_PASSWORD
Expand Down
27 changes: 18 additions & 9 deletions charts/csm-authorization-v2.0/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ cert-manager:
authorization:
# images to use in installation
images:
proxyService: dellemc/csm-authorization-proxy:v2.0.0-alpha
tenantService: dellemc/csm-authorization-tenant:v2.0.0-alpha
roleService: dellemc/csm-authorization-role:v2.0.0-alpha
storageService: dellemc/csm-authorization-storage:v2.0.0-alpha
authorizationController: dellemc/csm-authorization-controller:v2.0.0-alpha
opa: openpolicyagent/opa
opaKubeMgmt: openpolicyagent/kube-mgmt:8.5.7
proxyService:
image: dellemc/csm-authorization-proxy:v2.0.0-alpha
tenantService:
image: dellemc/csm-authorization-tenant:v2.0.0-alpha
roleService:
image: dellemc/csm-authorization-role:v2.0.0-alpha
storageService:
image: dellemc/csm-authorization-storage:v2.0.0-alpha
authorizationController:
image: dellemc/csm-authorization-controller:v2.0.0-alpha
opa:
image: openpolicyagent/opa
opaKubeMgmt:
image: openpolicyagent/kube-mgmt:8.5.7

# proxy-server ingress will use this hostname
# NOTE: additional hostnames can be configured in authorization.proxyServerIngress.hosts
Expand Down Expand Up @@ -70,8 +77,10 @@ redis:
rediscommander: rediscommander
replicas: 5
images:
redis: redis:7.4.0-alpine
commander: rediscommander/redis-commander:latest
redis:
image: redis:7.4.0-alpine
commander:
image: rediscommander/redis-commander:latest

vault:
- identifier: vault0
Expand Down

0 comments on commit e42fe3e

Please sign in to comment.