configurator icon indicating copy to clipboard operation
configurator copied to clipboard

Verify if a CCM is created for a ConfigMap which is not used in any deployment

Open surendar-b opened this issue 3 years ago • 1 comments

Describe the bug If the cluster has ConfigMap that is not used by any of the deployment, configurator not is creating a version (CCM). This needs to be verified. To Reproduce

1.Create a ConfigMaps to be used in a deployment

apiVersion: v1
kind: ConfigMap
metadata:
  name: demo-config-1
data:
   # file-like keys  
   user-interface.properties: |
      color.good=purple
      color.bad=yellow
    $ kubectl apply -f demo-config-1.yaml

2.Create a ConfigMap that will not be used in a deployment

apiVersion: v1
kind: ConfigMap
metadata:
  name: demo-config-2
data:
  # file-like keys
  game.properties: |
    android.apk=free fire,bgmi
    computer=stambled guys   
    $ kubectl apply -f demo-config-2.yaml
  1. Create deployment with ConfigMap mounted. (Node:- except 'demo-config' use some other CM)
apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: service-nginx
  template:
    metadata:
      labels:
        app: service-nginx
    spec:
      containers:
        - name: nginx
          image: nginx:1.14
          ports:
            - containerPort: 80
          volumeMounts:
           - name: nginx
             mountPath: "/config"
             readOnly: true
      volumes:
      - name: nginx
        configMap:
          name: demo-config-1
$ kubectl apply -f deployment.yaml
  1. Install configurator
helm install configurator gopaddle_configurator/configurator --version 0.4.0-alpha
  1. Verify annotation added in 'spec.template.metadata.annotation' level in deployment.
$ kubectl get deployment demo-deployment -o yaml
template:
    metadata:
      annotations:
        ccm-demo-config-1: qds24
  1. Verify the new version created for the 'demo-config-1' and 'demo-config-2'.
       $ kubectl get customconfigmap
  1. delete the demo-config-2
kubectl delete configmap demo-config-2
  1. Create demo-config-2 again
kubectl apply -f demo-config-2.yaml
  1. List the custom configmaps
kubectl get customconfigmap

Expected behavior In steps 6 & 9 configurator must create a new version for demo-config-2 ConfigMap

surendar-b avatar Feb 25 '22 13:02 surendar-b

Please send pull requests to SODACODE-2022

gopaddle-io avatar Feb 28 '22 14:02 gopaddle-io