2019/02/25

swagger 更新されない

Swagger.yamlを修正しても、8090をアクセスして変更されない
docker-componseでup ,down変わらない
docker image,containerでrmで変わらない

BrowerのCacheが。。。。
迷惑だから、勝手にCacheしないてを言いたい
(cmd shift r常識の、面倒)

2019/02/21

golang pointer compare

Pointer values are comparable. Two pointer values are equal if they point to the same variable or if both have value nil

2019/02/18

jmeter org.apache.commons.httpclient.NoHttpResponseException

規律的に半分が上記のエラーになった。
良くわからない、
Server側が一方的に拒否した?
HttpHeaderの設定で、KeepAliveをOffして、治った。
今回のテスト対象がnginx + djangoなので、keepaliveの設定が悪い疑惑!
また調べる。
https://road288.hatenablog.com/entry/2017/12/13/095408
https://qiita.com/edward999th/items/bc730faed3ca38760a26
https://www.ibm.com/developerworks/jp/opensource/library/os-django/index.html

2019/02/11

http options

投石问路

   サーバーがサポートするリクエストメソッドを調べるには、curlを使用してOPTIONS要求を発行します。
curl -X OPTIONS http://example.org -i
レスポンスには、許可されたメソッドを持つ Allow ヘッダが含まれています:
HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Date: Thu, 13 Oct 2016 11:45:00 GMT
Expires: Thu, 20 Oct 2016 11:45:00 GMT
Server: EOS (lax004/2813)
x-ec-custom-error: 1
Content-Length: 0

2019/02/10

gke cloudsql

  • create serviceAccount with cloudsql privelage
  • down cloudsql json key
  • create kubectl secert
    ```
    kubectl create secret generic cloudsql-oauth-credentials --from-file=credentails.json=.json
    ```
  • deployment.yaml
    ```
    volumes:
      - name: cloudsql-oauth-credentials
        secret:
          secretName: cloudsql-oauth-credentials
    
      - name: ssl-certs
        hostPath:
          path: /etc/ssl/certs
    
      - name: cloudsql
        emptyDir: {}
    
    
    - name: cloudsql-proxy
      image: gcr.io/cloudsql-docker/gce-proxy:1.11
      command: ["/cloud_sql_proxy",
                "-instances=projectName:region:instance=tcp:3306",
                "-credential_file=/secrets/cloudsql/credentials.json"]
      ports:
        - containerPort: 3306
          protocol: TCP
      securityContext:
        runAsUser: 2  # non-root user    allowPrivilegeEscalation: false
      volumeMounts:
        - name: cloudsql-oauth-credentials
          mountPath: /secrets/cloudsql
          readOnly: true
    ```

k8s message=Required "container.clusters.get" permission(s) for

circleICIの作業でGCR PUSH、K8S Deployの作業で、権限がない言われた。。
適切にCI のServiceAccountに
```
Kubernetes Engine Admin
Kubernetes Engine Cluster Admin
Storage Admin
Storage Object Viewer
```
を与えが、、それで権限ないで意味がわからない。。。イライラ

で、CI ServiceAccountを削除して、作り直し、だめ。。。
で、違う名前のCI ServiceAccountを作成して、OK
意味がわからない。。。

推測で、検証待ち。。
昔、誰が、権限がない同じ名前のCI用ServiceAccountを作成したことがあるからだめが、、