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

k8 client-go upgrade #25

Merged
merged 2 commits into from
Jan 24, 2018
Merged

k8 client-go upgrade #25

merged 2 commits into from
Jan 24, 2018

Conversation

Aergonus
Copy link
Collaborator

Title should really be k8 references update/upgrade

Updated all references to client-go accordingly. Glide deps had to be updated. This PR builds upon #24

Environment:

-sh$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:39:33Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:27:48Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Verified build works, no visible changes to output

test-framework.yaml

---
apiVersion: v1
kind: Namespace
metadata:
  name: test-system
---
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: counter
    namespace: test-system
  spec:
    replicas: 2
    template:
      metadata:
        labels:
          kube-monkey/enabled: enabled
          kube-monkey/identifier: monkey-victim-counter
          kube-monkey/mtbf: "1"
          kube-monkey/kill-all: "kill-all"
      spec:
        containers:
        - args:
          - /bin/sh
          - -c
          - 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done'
          image: gcr.io/google_containers/busybox
          imagePullPolicy: Always
          name: test-counter
        restartPolicy: Always
---
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: singlecounter
    namespace: test-system
  spec:
    replicas: 1
    template:
      metadata:
        labels:
          kube-monkey/enabled: enabled
          kube-monkey/identifier: monkey-victim-single-counter
          kube-monkey/mtbf: "2"
      spec:
        containers:
        - args:
          - /bin/sh
          - -c
          - 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 1; done'
          image: gcr.io/google_containers/busybox
          imagePullPolicy: Always
          name: test-single-counter
        restartPolicy: Always
---
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: opt-out-counter
    namespace: test-system
  spec:
    replicas: 1
    template:
      metadata:
        labels:
          kube-monkey/enabled: disabled
          kube-monkey/identifier: not-a-counter-victim
          kube-monkey/mtbf: "1"
      spec:
        containers:
        - args:
          - /bin/sh
          - -c
          - 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 86400; done'
          image: gcr.io/google_containers/busybox
          imagePullPolicy: Always
          name: not-a-counter-victim
        restartPolicy: Always
---
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: fail-deploy
    namespace: test-system
  spec:
    replicas: 2
    template:
      metadata:
        labels:
          kube-monkey/enabled: enabled
          kube-monkey/identifier: failure-test
          kube-monkey/mtbf: "1"
      spec:
        containers:
        - args:
          - /bin/sh
          - -c
          - 'i=0; while true; do echo "$i: $(date)"; i=$((i+1)); sleep 300; done'
          image: invalidimage
          imagePullPolicy: Always
          name: fail-deploy
        restartPolicy: Always
---
# missing-secret.yaml
# a failed deployment
  apiVersion: extensions/v1beta1
  kind: Deployment
  metadata:
    name: secret-pod
    namespace: test-system
  spec:
    replicas: 2
    template:
      metadata:
        labels:
          kube-monkey/enabled: enabled
          kube-monkey/identifier: missing-secret-test
          kube-monkey/mtbf: "1"
      spec:
        containers:
          - name: missing-secret-test
            image: gcr.io/google_containers/busybox
            command: [ "/bin/sh", "-c", "env" ]
            volumeMounts:
              - mountPath: /etc/secret/
                name: myothersecret
        volumes:
          - name: myothersecret
            secret:
              secretName: myothersecret
        restartPolicy: Always

Sample output

kubectl logs kube-monkey-7bccdc67d6-zzrph                                                                                                                                                                                                                                       Wed Dec 27 21:50:06 2017

I1227 21:49:48.863641       1 config.go:71] Successfully validated configs
I1227 21:49:48.864404       1 main.go:52] Starting kube-monkey with v logging level 4 and local log directory /var/log/kube-monkey
E1227 21:49:48.864445       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
I1227 21:49:48.864584       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:49:48.868726       1 kubemonkey.go:18] Debug mode detected!
I1227 21:49:48.868737       1 kubemonkey.go:19] Status Update: Generating next schedule in 60 sec
I1227 21:50:48.868868       1 schedule.go:54] Status Update: Generating schedule for terminations
E1227 21:50:48.869003       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
I1227 21:50:48.869038       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:50:48.911960       1 schedule.go:47] Status Update: 3 terminations scheduled today
I1227 21:50:48.911992       1 schedule.go:49] Deployment counter scheduled for termination at 12/12/27127 128:2827:00 -0500 UTC
I1227 21:50:48.911996       1 schedule.go:49] Deployment fail-deploy scheduled for termination at 12/12/27127 128:4927:00 -0500 UTC
I1227 21:50:48.912000       1 schedule.go:49] Deployment secret-pod scheduled for termination at 12/12/27127 128:2427:00 -0500 UTC
I1227 21:50:48.912071       1 kubemonkey.go:62] Status Update: Waiting to run scheduled terminations.
E1227 21:50:48.912129       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
E1227 21:50:48.912147       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
E1227 21:50:48.912178       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
I1227 21:50:48.912189       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:50:48.912209       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
        ********** Today's schedule **********
        Deployment                      Termination time
        ----------                      ----------------
        counter                 12/12/27127 128:2827:00 -0500 UTC
        fail-deploy                     12/12/27127 128:4927:00 -0500 UTC
        secret-pod                      12/12/27127 128:2427:00 -0500 UTC
        ********** End of schedule **********
I1227 21:50:48.912237       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:50:48.917404       1 chaos.go:120] Terminating ALL pods for deployment counter
E1227 21:50:48.925021       1 kubemonkey.go:68] Failed to execute termination for deployment secret-pod. Error: Deployment secret-pod has no running pods at the moment
I1227 21:50:48.925055       1 kubemonkey.go:73] Status Update: 2 scheduled terminations left.
E1227 21:50:48.930630       1 kubemonkey.go:68] Failed to execute termination for deployment fail-deploy. Error: Deployment fail-deploy has no running pods at the moment
I1227 21:50:48.930644       1 kubemonkey.go:73] Status Update: 1 scheduled terminations left.
I1227 21:50:48.936176       1 kubemonkey.go:70] Termination successfully executed for deployment counter
I1227 21:50:48.936187       1 kubemonkey.go:73] Status Update: 0 scheduled terminations left.
I1227 21:50:48.936191       1 kubemonkey.go:76] Status Update: All terminations done.
I1227 21:50:48.936262       1 kubemonkey.go:18] Debug mode detected!
I1227 21:50:48.936269       1 kubemonkey.go:19] Status Update: Generating next schedule in 60 sec
...
I1227 21:52:48.958817       1 schedule.go:54] Status Update: Generating schedule for terminations
E1227 21:52:48.958931       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
I1227 21:52:48.958961       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:52:48.966545       1 schedule.go:47] Status Update: 4 terminations scheduled today
I1227 21:52:48.966560       1 schedule.go:49] Deployment counter scheduled for termination at 12/12/27127 128:627:00 -0500 UTC
I1227 21:52:48.966565       1 schedule.go:49] Deployment fail-deploy scheduled for termination at 12/12/27127 128:4627:00 -0500 UTC
I1227 21:52:48.966568       1 schedule.go:49] Deployment secret-pod scheduled for termination at 12/12/27127 128:2727:00 -0500 UTC
I1227 21:52:48.966571       1 schedule.go:49] Deployment singlecounter scheduled for termination at 12/12/27127 128:5227:00 -0500 UTC
I1227 21:52:48.966645       1 kubemonkey.go:62] Status Update: Waiting to run scheduled terminations.
E1227 21:52:48.966693       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
        ********** Today's schedule **********
E1227 21:52:48.966707       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
        Deployment                      Termination time
I1227 21:52:48.966748       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
        ----------                      ----------------
I1227 21:52:48.966752       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
        counter                 12/12/27127 128:627:00 -0500 UTC
E1227 21:52:48.966794       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
        fail-deploy                     12/12/27127 128:4627:00 -0500 UTC
I1227 21:52:48.966842       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
        secret-pod                      12/12/27127 128:2727:00 -0500 UTC
E1227 21:52:48.966834       1 config.go:330] Expected to load root CA config from /var/run/secrets/kubernetes.io/serviceaccount/ca.crt, but got err: open /var/run/secrets/kubernetes.io/serviceaccount/ca.crt: no such file or directory
        singlecounter                   12/12/27127 128:5227:00 -0500 UTC
        ********** End of schedule **********
I1227 21:52:48.966975       1 kubernetes.go:20] API server host overriden to: http://<excerpted>
I1227 21:52:48.971531       1 chaos.go:120] Terminating ALL pods for deployment counter
E1227 21:52:48.973791       1 kubemonkey.go:68] Failed to execute termination for deployment fail-deploy. Error: Deployment fail-deploy has no running pods at the moment
I1227 21:52:48.973813       1 kubemonkey.go:73] Status Update: 3 scheduled terminations left.
I1227 21:52:48.974375       1 chaos.go:113] Terminating pod singlecounter-84d7b87fd8-6nbbs for deployment singlecounter
E1227 21:52:48.974625       1 kubemonkey.go:68] Failed to execute termination for deployment secret-pod. Error: Deployment secret-pod has no running pods at the moment
I1227 21:52:48.974637       1 kubemonkey.go:73] Status Update: 2 scheduled terminations left.
I1227 21:52:48.977829       1 kubemonkey.go:70] Termination successfully executed for deployment singlecounter
I1227 21:52:48.977854       1 kubemonkey.go:73] Status Update: 1 scheduled terminations left.
I1227 21:52:48.980523       1 kubemonkey.go:70] Termination successfully executed for deployment counter
I1227 21:52:48.980533       1 kubemonkey.go:73] Status Update: 0 scheduled terminations left.
I1227 21:52:48.980538       1 kubemonkey.go:76] Status Update: All terminations done.
I1227 21:52:48.980586       1 kubemonkey.go:18] Debug mode detected!
I1227 21:52:48.980590       1 kubemonkey.go:19] Status Update: Generating next schedule in 60 sec

Had to run `glide cache-clear` and then `glide update --strip-vendor`
@Aergonus
Copy link
Collaborator Author

Aergonus commented Jan 1, 2018

I think a client-go upgrade warrants version upgrade to 2.0

@Aergonus Aergonus mentioned this pull request Jan 1, 2018
Aergonus added a commit to Aergonus/kube-monkey that referenced this pull request Jan 2, 2018
This was referenced Jan 3, 2018
@asobti asobti merged commit 970ed42 into asobti:master Jan 24, 2018
@Aergonus Aergonus deleted the k8_upgrade branch January 24, 2018 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants