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

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

Open
surendar-b opened this issue Feb 25, 2022 · 1 comment

Comments

@surendar-b
Copy link
Contributor

surendar-b commented Feb 25, 2022

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

@gopaddle-io
Copy link
Owner

Please send pull requests to SODACODE-2022

@gopaddle-io gopaddle-io changed the title Verify is CCM is created for a ConfigMap which is not used in any deployment Verify if a CCM is created for a ConfigMap which is not used in any deployment Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants