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

Argo Rollouts v0.8.2 を試す #50

Open
suzuki-shunsuke opened this issue May 19, 2020 · 1 comment
Open

Argo Rollouts v0.8.2 を試す #50

suzuki-shunsuke opened this issue May 19, 2020 · 1 comment

Comments

@suzuki-shunsuke
Copy link
Owner

suzuki-shunsuke commented May 19, 2020

https://argoproj.github.io/argo-rollouts/getting-started/

$ minikube start
$ kubectl create namespace argo-rollouts
$ kubectl apply -n argo-rollouts -f https://raw.githubusercontent.com/argoproj/argo-rollouts/stable/manifests/install.yaml
$ kubectl apply -f rollout.yaml
$ kubectl get rollout

rollout.yaml

apiVersion: argoproj.io/v1alpha1 # Changed from apps/v1
kind: Rollout # Changed from Deployment
# ----- Everything below this comment is the same as a deployment -----
metadata:
  name: example-rollout
spec:
  replicas: 5
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.15.4
        ports:
        - containerPort: 80
  minReadySeconds: 30
  revisionHistoryLimit: 3
  strategy:
  # ----- Everything above this comment are the same as a deployment -----
    canary: # A new field that used to provide configurable options for a Canary strategy
      steps:
      - setWeight: 20
      - pause: {}
$ kubectl patch rollout example-rollout --type merge -p '{"spec": {"template": { "spec": { "containers": [{"name": "nginx","image": "nginx:1.15.5"}]}}}}'
$ kb get rollout
NAME              DESIRED   CURRENT   UP-TO-DATE   AVAILABLE
example-rollout   5         5         1            5

$ kb get replicaset
NAME                         DESIRED   CURRENT   READY   AGE
example-rollout-66767759b    1         1         1       64m
example-rollout-76f5bddc69   4         4         4       65m

$  kb get pod
NAME                               READY   STATUS    RESTARTS   AGE
example-rollout-66767759b-7rw4j    1/1     Running   0          64m
example-rollout-76f5bddc69-6npjn   1/1     Running   0          65m
example-rollout-76f5bddc69-9pntf   1/1     Running   0          65m
example-rollout-76f5bddc69-bwz6q   1/1     Running   0          65m
example-rollout-76f5bddc69-dqmgb   1/1     Running   0          65m

service.yaml

apiVersion: v1
kind: Service
metadata:
  name: example-rollout
spec:
  type: NodePort
  selector:
    app: nginx
  ports:
  - protocol: TCP
    port: 4000
    targetPort: 80
$ kb apply -f service.yaml
$ minikube service example-rollout
$ curl -s --head 192.168.64.19:31228 | grep Server
Server: nginx/1.15.4
@suzuki-shunsuke
Copy link
Owner Author

suzuki-shunsuke commented May 30, 2020

https://raw.githubusercontent.com/argoproj/argo-rollouts/stable/manifests/install.yaml

でなにが作られるかというと

  • CRD
    • AnalysisRun
    • AnalysisTemplate
    • Experiment
    • Rollout
  • ServiceAccount
    • argo-rollouts
  • Role
    • argo-rollouts-role
  • ClusterRole
    • argo-rollouts-aggregate-to-admin
    • argo-rollouts-aggregate-to-edit
    • argo-rollouts-aggregate-to-view
    • argo-rollouts-clusterrole
  • RoleBinding
    • argo-rollouts-role-binding
  • ClusterRoleBinding
    • argo-rollouts-clusterrolebinding
  • Service
    • argo-rollouts-metrics
  • Deployment
    • argo-rollouts
$ kubectl apply --dry-run -f install.yaml
customresourcedefinition.apiextensions.k8s.io/analysisruns.argoproj.io created (dry run)
customresourcedefinition.apiextensions.k8s.io/analysistemplates.argoproj.io created (dry run)
customresourcedefinition.apiextensions.k8s.io/experiments.argoproj.io created (dry run)
customresourcedefinition.apiextensions.k8s.io/rollouts.argoproj.io created (dry run)
serviceaccount/argo-rollouts created (dry run)
role.rbac.authorization.k8s.io/argo-rollouts-role created (dry run)
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-admin created (dry run)
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-edit created (dry run)
clusterrole.rbac.authorization.k8s.io/argo-rollouts-aggregate-to-view created (dry run)
clusterrole.rbac.authorization.k8s.io/argo-rollouts-clusterrole created (dry run)
rolebinding.rbac.authorization.k8s.io/argo-rollouts-role-binding created (dry run)
clusterrolebinding.rbac.authorization.k8s.io/argo-rollouts-clusterrolebinding created (dry run)
service/argo-rollouts-metrics created (dry run)
deployment.apps/argo-rollouts created (dry run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

No branches or pull requests

1 participant