}
KERNEL_OPTIMIZATION=false
+IS_HELM3=$(helm version --short|grep -e "^v3")
while [ -n "$1" ]; do # while loop starts
exit 1
fi
-HAS_COMMON_PACKAGE=$(helm search local/ric-common | grep ric-common)
+if [ -z $IS_HELM3 ]
+then
+ HAS_COMMON_PACKAGE=$(helm search local/ric-common | grep ric-common)
+else
+ HAS_COMMON_PACKAGE=$(helm search repo local/ric-common | grep ric-common)
+fi
if [ -z "$HAS_COMMON_PACKAGE" ];then
echo "****************************************************************************************************************"
name: tiller
namespace: kube-system
EOF
-kubectl apply -f ricplt-role.yaml
-rm ricplt-role.yaml
+
+if [ -z $IS_HELM3 ]
+then
+ kubectl apply -f ricplt-role.yaml
+ rm ricplt-role.yaml
+fi
# Add kernel optimization for radis services
for component in $COMPONENTS; do
helm dep up $DIR/../helm/$component
- helm install -f $OVERRIDEYAML --namespace "${PLTNAMESPACE:-ricplt}" --name "${RELEASE_PREFIX}-$component" $DIR/../helm/$component
+ COMPONENT="${RELEASE_PREFIX}-$component"
+ if [ -z $IS_HELM3 ]
+ then
+ COMPONENT=" --name $COMPONENT"
+ fi
+ helm install -f $OVERRIDEYAML --namespace "${PLTNAMESPACE:-ricplt}" $COMPONENT $DIR/../helm/$component
sleep 8
done
XAPPNAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *xapp:/{print $2}')
RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}')
+IS_HELM3=$(helm version --short|grep -e "^v3")
echo "Undeploying RIC platform components [$COMPONENTS]"
+HELM_FLAG=''
+if [ $IS_HELM3 ]
+then
+ HELM_FLAG=' -n '${PLTNAMESPACE:-ricplt}
+else
+ HELM_FLAG='--purge'
+fi
+
+
for component in $COMPONENTS; do
- helm delete --purge ${RELEASE_PREFIX}-$component
+ helm delete $HELM_FLAG ${RELEASE_PREFIX}-$component
done
kubectl delete cm -n ${PLTNAMESPACE:-ricplt} ricplt-recipe
volumeMounts:
- mountPath: /alarmadaptercfg
name: appconfig-file
- subpath: config-file.json
+ subPath: config-file.json
ports:
- name: "http"
containerPort: {{ include "common.serviceport.alarmadapter.http" . }}
# httpGet:
# path: /
# port: http
- restartPolicy: Always
securityContext:
# ubuntu
#runAsUser: 1000
#allowPrivilegeEscalation: false
+ restartPolicy: Always
volumes:
- name: config-volume
configMap:
namespace: {{ include "common.namespace.platform" . }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
-kind: Role
+kind: ClusterRole
metadata:
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
- namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
rules:
- apiGroups: [""]
resources: ["pods/portforward"]
{{- if or (eq (include "common.tillerTLSVerify" $ctx) "true" ) (eq (include "common.tillerTLSAuthenticate" $ctx) "true") }}
- apiGroups: [""]
resources: ["secrets"]
- resourceNames: [ {{ include "common.tillerHelmClientTLSSecret" $ctx | quote }} ]
- verbs: ["get"]
+ #resourceNames: [ {{ include "common.tillerHelmClientTLSSecret" $ctx | quote }} ]
+ verbs: ["get","list"]
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
-kind: RoleBinding
+kind: ClusterRoleBinding
metadata:
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
- namespace: {{ include "common.tillerDeployNameSpace" $ctx }}
+ namespace: {{ include "common.namespace.platform" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
- kind: Role
+ kind: ClusterRole
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-access
subjects:
- kind: ServiceAccount
namespace: {{ include "common.namespace.platform" . }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
-kind: Role
+kind: ClusterRole
metadata:
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
- namespace: {{ include "common.tillerNameSpace" $ctx }}
+ #namespace: {{ include "common.tillerNameSpace" $ctx }}
+ #namespace: {{ include "common.namespace.platform" . }}
rules:
- apiGroups: [""]
resources: ["configmaps", "endpoints", "services"]
verbs: ["get", "list", "create", "update", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
-kind: RoleBinding
+kind: ClusterRoleBinding
metadata:
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.namespace.xapp" . }}-getappconfig
namespace: {{ include "common.tillerNameSpace" $ctx }}
+ #namespace: {{ include "common.namespace.platform" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
- kind: Role
+ kind: ClusterRole
name: {{ include "common.serviceaccountname.appmgr" . }}-{{ include "common.tillerNameSpace" $ctx }}-getappconfig
subjects:
- kind: ServiceAccount
httpGet:
path: /
port: {{ include "common.serviceport.jaegeradapter.httpquery" . }}
- initialDelaySeconds: 5
+ initialDelaySeconds: 5
release: {{ .Release.Name }}
spec:
hostname: {{ include "common.name.xapp-onboarder" . }}
+ securityContext:
+ fsGroup: 0
+ runAsUser: 0
+ restartPolicy: Always
imagePullSecrets:
{{- $newctx := dict "ctx" $ "defaultregistry" .Values.xapponboarder.image.xapponboarder.registry }}
- name: {{ include "common.dockerregistry.credential" $newctx }}
image: {{ include "common.dockerregistry.url" $newctx }}/{{ .Values.xapponboarder.image.chartmuseum.name }}:{{ .Values.xapponboarder.image.chartmuseum.tag }}
{{- $newctx := dict "ctx" $ "defaultpullpolicy" .Values.xapponboarder.imagePullPolicy }}
imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
- securityContext:
- fsGroup: 0
- runAsUser: 0
envFrom:
- configMapRef:
name: {{ include "common.configmapname.xapp-onboarder" . }}-chartmuseum-env
# httpGet:
# path: /
# port: http
- restartPolicy: Always